LinuxForum.Fans
Тема

Перекодирование mp3 в ogg (openSUSE)

Автор: sapsan 11 сообщений 6369 просмотров
#334881

Доброго времени суток!
Пытаюсь перекодировать mp3 в ogg и появляется ошибка:

text
ffmpeg -i 137749511564533.mp3 -acodec -aq 60 111.ogg -loglevel debug
ffmpeg version 2.0.1 Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug 17 2013 07:01:31 with gcc 4.7 (SUSE Linux)
  configuration: --shlibdir=/usr/lib64 --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --enable-shared --disable-static --enable-debug --disable-stripping --extra-cflags='-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -fPIC -I/usr/include/gsm' --enable-gpl --enable-x11grab --enable-version3 --enable-pthreads --enable-avfilter --enable-libpulse --enable-libvpx --enable-libopus --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libxvid --enable-libx264 --enable-libschroedinger --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-postproc --enable-libdc1394 --enable-librtmp --enable-libfreetype --enable-avresample --enable-libtwolame --enable-libvo-aacenc
  WARNING: library configuration mismatch
  avfilter    configuration: --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --shlibdir=/usr/lib64 --disable-stripping --enable-pthreads --enable-shared --enable-avfilter --disable-static --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libx264 --enable-nonfree --enable-postproc --enable-shared --enable-libdc1394 --enable-libtheora --enable-libschroedinger --enable-libvpx --enable-gpl --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-x11grab
  libavutil      52. 38.100 / 52. 38.100
  libavcodec     55. 18.102 / 55. 18.102
  libavformat    55. 12.100 / 55. 12.100
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 79.101 /  3. 17.100
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Splitting the commandline.
Reading option '-i' ... matched as input file with argument '137749511564533.mp3'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument '-aq'.
Reading option '60' ... matched as output file.
Reading option '111.ogg' ... matched as output file.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file 137749511564533.mp3.
Successfully parsed a group of options.
Opening an input file: 137749511564533.mp3.
[mp3 @ 0x1c2d0a0] Format mp3 detected only with low score of 1, misdetection possible!
[mp3 @ 0x1c2d0a0] File position before avformat_find_stream_info() is 0
[mp3 @ 0x1c2daa0] Header missing

ffmpeg установлен из репозитория PackMan. Подскажите, в какую сторону смотреть.

#334886

С опциями командной строки разберитесь:

text
Reading option '-acodec' ...
matched as option
'acodec' (force audio codec
('copy' to copy stream)) with
argument '-aq'.
Reading option '60' ...
matched as output file.
Reading option '111.ogg' ...
matched as output file.

man ffmpeg в помощь.

#334902

Нескромный вопрос: а нафига? Качество лучше не станет, объем увеличится.

#334903

Вывод в консоль:

text
ffmpeg  -i 137749511564533.mp3 -acodec aac out.aac -loglevel debug
ffmpeg version 2.0.1 Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug 17 2013 07:01:31 with gcc 4.7 (SUSE Linux)
  configuration: --shlibdir=/usr/lib64 --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --enable-shared --disable-static --enable-debug --disable-stripping --extra-cflags='-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -fPIC -I/usr/include/gsm' --enable-gpl --enable-x11grab --enable-version3 --enable-pthreads --enable-avfilter --enable-libpulse --enable-libvpx --enable-libopus --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libxvid --enable-libx264 --enable-libschroedinger --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-postproc --enable-libdc1394 --enable-librtmp --enable-libfreetype --enable-avresample --enable-libtwolame --enable-libvo-aacenc
  WARNING: library configuration mismatch
  avfilter    configuration: --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --shlibdir=/usr/lib64 --disable-stripping --enable-pthreads --enable-shared --enable-avfilter --disable-static --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libx264 --enable-nonfree --enable-postproc --enable-shared --enable-libdc1394 --enable-libtheora --enable-libschroedinger --enable-libvpx --enable-gpl --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-x11grab
  libavutil      52. 38.100 / 52. 38.100
  libavcodec     55. 18.102 / 55. 18.102
  libavformat    55. 12.100 / 55. 12.100
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 79.101 /  3. 17.100
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Splitting the commandline.
Reading option '-i' ... matched as input file with argument '137749511564533.mp3'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'aac'.
Reading option 'out.aac' ... matched as output file.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file 137749511564533.mp3.
Successfully parsed a group of options.
Opening an input file: 137749511564533.mp3.
[mp3 @ 0x23b7880] Format mp3 detected only with low score of 1, misdetection possible!
[mp3 @ 0x23b7880] File position before avformat_find_stream_info() is 0
[mp3 @ 0x23b8280] Header missing
[mp3 @ 0x23b7880] decoding for stream 0 failed
[mp3 @ 0x23b7880] Could not find codec parameters for stream 0 (Audio: mp3, 0 channels, s16p): unspecified frame size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mp3 @ 0x23b7880] File position after avformat_find_stream_info() is 1411
137749511564533.mp3: could not find codec parameters
[AVIOContext @ 0x23bff00] Statistics: 1411 bytes read, 0 seeks

Смущают очень сильно строки:

text
[mp3 @ 0x23b7880] Format mp3 detected only with low score of 1, misdetection possible!
......
[mp3 @ 0x23b8280] Header missing

Т.е. ffmpeg не может правильно прочитать исходный файл mp3

#334914
karl_muenhgausen написал:
Нескромный вопрос: а нафига? Качество лучше не станет, объем увеличится.

Производственная необходимость конвертировать в aac и ogg, качество не критично.

#334950

Можно попробовать sox
А вообще yars вроде верно подметил.

#334952

Еще меня смущает предупреждение о несовместимой конфигурации библиотек.
Я больше пользуюсь mencoder'ом.

#335056
karl_muenhgausen написал:
Качество лучше не станет, объем увеличится.

Качество даже ухудшится (хотя это услышит не каждое ухо и не на любой аппаратуре), а вот объём-то как раз на 20-30% (при сопоставимом битрейте) ужмётся.

#337150

Вроде разобрался с параметрами, но ffmpeg вылетает:

text
ffmpeg -i 20130913_102641_8001006845_9157801996.mp3 -vn -ar 8000 -ac 2 -ab 192 -f ogg output2.ogg -loglevel debug
ffmpeg version 1.0.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Mar 14 2013 08:43:43 with gcc 4.7 (SUSE Linux)
  configuration: --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --shlibdir=/usr/lib64 --disable-stripping --enable-pthreads --enable-shared --enable-avfilter --disable-static --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libx264 --enable-nonfree --enable-postproc --enable-shared --enable-libdc1394 --enable-libtheora --enable-libschroedinger --enable-libvpx --enable-gpl --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-x11grab
  WARNING: library configuration mismatch
  avutil      configuration: --enable-shared --disable-static --disable-doc --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --disable-stripping --extra-cflags='-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g'
  swscale     configuration: --shlibdir=/usr/lib64 --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --enable-shared --disable-static --enable-debug --disable-stripping --extra-cflags='-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -fPIC -I/usr/include/gsm' --enable-gpl --enable-x11grab --enable-version3 --enable-pthreads --enable-avfilter --enable-libpulse --enable-libvpx --enable-libopus --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libxvid --enable-libx264 --enable-libschroedinger --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-postproc --enable-libdc1394 --enable-librtmp --enable-libfreetype --enable-avresample --enable-libtwolame --enable-libvo-aacenc
  swresample  configuration: --shlibdir=/usr/lib64 --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --enable-shared --disable-static --enable-debug --disable-stripping --extra-cflags='-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -fPIC -I/usr/include/gsm' --enable-gpl --enable-x11grab --enable-version3 --enable-pthreads --enable-avfilter --enable-libpulse --enable-libvpx --enable-libopus --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libxvid --enable-libx264 --enable-libschroedinger --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-postproc --enable-libdc1394 --enable-librtmp --enable-libfreetype --enable-avresample --enable-libtwolame --enable-libvo-aacenc
  postproc    configuration: --shlibdir=/usr/lib64 --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --enable-shared --disable-static --enable-debug --disable-stripping --extra-cflags='-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -fPIC -I/usr/include/gsm' --enable-gpl --enable-x11grab --enable-version3 --enable-pthreads --enable-avfilter --enable-libpulse --enable-libvpx --enable-libopus --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libxvid --enable-libx264 --enable-libschroedinger --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-postproc --enable-libdc1394 --enable-librtmp --enable-libfreetype --enable-avresample --enable-libtwolame --enable-libvo-aacenc
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  3.100
  libswresample   0. 15.100 /  0. 17.102
  libpostproc    52.  0.100 / 52.  3.100
[mp3 @ 0x22d9d20] Format mp3 probed with size=2048 and score=51
[mp3 @ 0x22d9d20] File position before avformat_find_stream_info() is 0
[mp3 @ 0x22d9d20] max_analyze_duration 5000000 reached at 5040000
[mp3 @ 0x22d9d20] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 0x22d9d20] File position after avformat_find_stream_info() is 11264
Input #0, mp3, from '20130913_102641_8001006845_9157801996.mp3':
  Duration: 00:00:08.78, start: 0.000000, bitrate: 16 kb/s
    Stream #0:0, 72, 1/14112000: Audio: mp3, 8000 Hz, mono, s16, 16 kb/s
[abuffer @ 0x22fa720] Setting entry with key 'time_base' to value '1/8000'
[abuffer @ 0x22fa720] Setting entry with key 'sample_rate' to value '8000'
[abuffer @ 0x22fa720] Setting entry with key 'sample_fmt' to value 's16'
[abuffer @ 0x22fa720] Setting entry with key 'channel_layout' to value '0x4'
[graph 0 input from stream 0:0 @ 0x22f6dc0] tb:1/8000 samplefmt:s16 samplerate:8000 chlayout:0x4
[aformat @ 0x22dfb40] Setting entry with key 'sample_fmts' to value 's16'
[aformat @ 0x22dfb40] Setting entry with key 'sample_rates' to value '8000'
[aformat @ 0x22dfb40] Setting entry with key 'channel_layouts' to value '0x3'
[audio format for output stream 0:0 @ 0x22f9020] auto-inserting filter 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the filter 'audio format for output stream 0:0'
Assertion outlink->format == out_format failed at libavfilter/af_aresample.c:158
Аварийный останов
#350915

ffmpeg -i n.mp3 -ab 64k -acodec libvorbis out.ogv

#350946
"karl_muenhgausen" написал:
Качество лучше не станет, объем увеличится.

Ой не надо...

Обычная команда
ffmpeg -i input.mp3 -acodec libvorbis output.ogg
Эксперементальный кодек
ffmpeg -i input.mp3 -acodec vorbis -strict -2 output.ogg

Размер исходного файла mp3 4538594
Размер на выходе libvorbis 2676866
размер на выходе vorbis 4023481

Войдите или зарегистрируйтесь, чтобы ответить.