I'm trying to convert my video file. Here is

Input #0, avi, from 'file.mpg':
  Metadata:
    encoder         : MEncoder SVN-r37289
  Duration: 01:32:15.60, start: 0.000000, bitrate: 123104 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 25 tbr, 25 tbn, 25 tbc
    Stream #0:1: Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo, s16, 224 kb/s

File itself works fine and has amazing sound. Unfortunately whenever I try to execute ffmpeg to convert this video I get output file with no audio (and this is not because of -map).

Even when I'm trying to extract just audio without video to another file it produces audio track with no audio. Here is a couple of examples I have with pure audio conversion (it doesn't matter what target format I want to use):

 $ ffmpeg -i abi.mpg -map 0:1 output.mp3 
Input #0, avi, from 'abi.mpg':
  Metadata:
    encoder         : MEncoder SVN-r37289
  Duration: 01:32:15.60, start: 0.000000, bitrate: 123104 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 122872 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
    Stream #0:1: Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo, s16p, 224 kb/s
File 'output.mp3' already exists. Overwrite ? [y/N] y
Output #0, mp3, to 'output.mp3':
  Metadata:
    TSSE            : Lavf56.4.101
    Stream #0:0: Audio: mp3 (libmp3lame), 48000 Hz, stereo, s16p
    Metadata:
      encoder         : Lavc56.1.100 libmp3lame
Stream mapping:
  Stream #0:1 -> #0:0 (mp2 (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
size=       3kB time=00:01:20.66 bitrate=   0.3kbits/s    
video:0kB audio:3kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.779762%

You see! 3kB file size for 1:20 minutes and if I'm trying to play source file the sound is playing well.

And here even debug output:

 $ ffmpeg -i file.mpg -ss 8 -c:a libfaac -b:a 192k -map 0:1 output.m4a
Input #0, avi, from 'file.mpg':
  Metadata:
    encoder         : MEncoder SVN-r37289
  Duration: 01:32:15.60, start: 0.000000, bitrate: 123104 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 122872 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
    Stream #0:1: Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo, s16p, 224 kb/s
File 'output.m4a' already exists. Overwrite ? [y/N] y
Output #0, ipod, to 'output.m4a':
  Metadata:
    encoder         : Lavf56.4.101
    Stream #0:0: Audio: aac (libfaac) (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 192 kb/s
    Metadata:
      encoder         : Lavc56.1.100 libfaac
Stream mapping:
  Stream #0:1 -> #0:0 (mp2 (native) -> aac (libfaac))
debug=1     8kB time=00:04:10.07 bitrate=   0.3kbits/s    
debug=2     8kB time=00:04:26.19 bitrate=   0.3kbits/s    
debug=4     9kB time=00:04:42.34 bitrate=   0.3kbits/s    
debug=8     9kB time=00:04:42.34 bitrate=   0.3kbits/s    
size=      12kB time=00:05:46.84 bitrate=   0.3kbits/s    
video:0kB audio:11kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.049674%
Input file #0 (abi.mpg):
  Input stream #0:0 (video): 9655 packets read (5932032000 bytes); 
  Input stream #0:1 (audio): 24 packets read (16128 bytes); 24 frames decoded (27648 samples); 
  Total: 9679 packets (5932048128 bytes) demuxed
Output file #0 (output.m4a):
  Output stream #0:0 (audio): 25 frames encoded (25600 samples); 26 packets muxed (11193 bytes); 
  Total: 26 packets (11193 bytes) muxed
24 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x1ab91a0] Statistics: 30 seeks, 49 writeouts
[AVIOContext @ 0x1afc500] Statistics: 5954303224 bytes read, 369 seeks

Am I doing something wrong?

upd1. here's ffmpeg information:

ffmpeg version 2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
  built on Oct  5 2014 09:31:05 with gcc 4.9.1 (Debian 4.9.1-16)
  configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security ' --extra-ldflags='-Wl,-z,relro' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/x86_64-linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl --enable-libass --enable-libopus --enable-fontconfig --enable-libpulse --disable-mips32r2 --disable-mipsdspr1 --disable-mipsdspr2 --enable-libvidstab --enable-libzvbi --enable-avresample --disable-htmlpages --disable-podpages --enable-libiec61883 --enable-libfdk-aac --enable-vaapi --enable-libx265 --enable-libdc1394 --disable-altivec --shlibdir=/usr/lib/x86_64-linux-gnu
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
Hyper fast Audio and Video encoder
  • What version of ffmpeg are you testing this with? Please don't truncate your command line outputs. Does it work with other files? Which player are you using to check the audio file? (Does it work with others?) Could also be related to this bug – slhck Oct 18 '14 at 17:53
  • @slhck, sorry, question was updated. ffmpeg info is in there now. Yes, conversion works with other files. I usually check all files with mplayer, though in this case it's obviously not player fault, as 3kB file ca not contain 2 minutes 192k audio. thanks for the link I will check it. – rush Oct 18 '14 at 18:09
  • Yup. I guess it'd make sense to file a bug report then, ideally with the sample file that exhibits the issue. – slhck Oct 18 '14 at 18:21
  • bug was reported – rush Oct 18 '14 at 22:39
up vote 2 down vote accepted

ffmpeg calculates incorrect time ranges while conversion mp2 -> any is ongoing. that's why after conversion interruption produced audio track was too short to hear it and it seemed that it's empty.

run the full conversion produced the good output.

  • Interesting, good to know! – slhck Oct 19 '14 at 13:31

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.