DBabo |
12-25-2009 10:30 PM |
ffmpeg - no sound after converting matroska file
hello,
Happy holidays.
some time ago i put together a quick script to convert avi into mpg and, eventually, to DVD. The central part of it is:
Code:
ffmpeg $PARAM ${output_mpg}
where PARAM is a set of parameters (see below) and output_mpg is an output mpg file.
In 95% of situations this has been sufficient and i enjoyed the end result. But today i came across a "curious" mkv file.
First, the output of the command was :
Code:
PARAM = -ss 00:00:00 -t 5400 -i ./topSecret.mkv -target ntsc-dvd -aspect 16:9
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include --enable-libamr-nb --enable-libamr-wb --enable-libdirac --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-x11grab
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Nov 6 2009 19:05:03, gcc: 4.1.2 20080704 (Red Hat 4.1.2-46)
Seems stream 0 codec frame rate differs from container frame rate: 47.95 (48000/1001) -> 23.98 (24000/1001)
Input #0, matroska, from './topSecret.mkv':
Duration: 01:30:06.12, start: 0.000000, bitrate: N/A
Stream #0.0(eng): Video: h264, yuv420p, 716x480, PAR 40:33 DAR 179:99, 23.98 tbr, 1k tbn, 47.95 tbc
Stream #0.1(rus): Audio: aac, 48000 Hz, 5.1, s16
Stream #0.2(eng): Audio: aac, 48000 Hz, 5.1, s16
Stream #0.3(rus): Audio: aac, 48000 Hz, 5.1, s16
Stream #0.4(eng): Audio: aac, 24000 Hz, stereo, s16
Stream #0.5(bul): Subtitle: 0x0000
Stream #0.6(dut): Subtitle: 0x0000
Stream #0.7(eng): Subtitle: 0x0000
Stream #0.8(eng): Subtitle: 0x0000
Stream #0.9(nor): Subtitle: 0x0000
Stream #0.10(por): Subtitle: 0x0000
Stream #0.11(rus): Subtitle: 0x0000
Stream #0.12: Attachment: mjpeg
Stream #0.13: Attachment: mjpeg
Stream #0.14: Attachment: mjpeg
Stream #0.15: Attachment: mjpeg
Stream #0.16: Attachment: mjpeg
Output #0, dvd, to 'out.mpg':
Stream #0.0(eng): Video: mpeg2video, yuv420p, 720x480 [PAR 32:27 DAR 16:9], q=2-31, 6000 kb/s, 90k tbn, 29.97 tbc
Stream #0.1(rus): Audio: ac3, 48000 Hz, stereo, s16, 448 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
[aac @ 0x8acc3f0]channel element 1.2 is not allocated
Error while decoding stream #0.1
Error while decoding stream #0.1
Error while decoding stream #0.1
Error while decoding stream #0.1
Error while decoding stream #0.1
The "error" message floods the screen so i cancelled out of the program.
I made the following change:
Code:
ffmpeg $PARAM -acodec copy ${output_mpg}
which produced the output:
Code:
PARAM = -ss 5400 -t 5406.12 -i ./topSecret.mkv -target ntsc-dvd -aspect 16:9
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include --enable-libamr-nb --enable-libamr-wb --enable-libdirac --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-x11grab
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Nov 6 2009 19:05:03, gcc: 4.1.2 20080704 (Red Hat 4.1.2-46)
Seems stream 0 codec frame rate differs from container frame rate: 47.95 (48000/1001) -> 23.98 (24000/1001)
Input #0, matroska, from './topSecret.mkv':
Duration: 01:30:06.12, start: 0.000000, bitrate: N/A
Stream #0.0(eng): Video: h264, yuv420p, 716x480, PAR 40:33 DAR 179:99, 23.98 tbr, 1k tbn, 47.95 tbc
Stream #0.1(rus): Audio: aac, 48000 Hz, 5.1, s16
Stream #0.2(eng): Audio: aac, 48000 Hz, 5.1, s16
Stream #0.3(rus): Audio: aac, 48000 Hz, 5.1, s16
Stream #0.4(eng): Audio: aac, 24000 Hz, stereo, s16
Stream #0.5(bul): Subtitle: 0x0000
Stream #0.6(dut): Subtitle: 0x0000
Stream #0.7(eng): Subtitle: 0x0000
Stream #0.8(eng): Subtitle: 0x0000
Stream #0.9(nor): Subtitle: 0x0000
Stream #0.10(por): Subtitle: 0x0000
Stream #0.11(rus): Subtitle: 0x0000
Stream #0.12: Attachment: mjpeg
Stream #0.13: Attachment: mjpeg
Stream #0.14: Attachment: mjpeg
Stream #0.15: Attachment: mjpeg
Stream #0.16: Attachment: mjpeg
Output #0, dvd, to 'out.mpg':
Stream #0.0(eng): Video: mpeg2video, yuv420p, 720x480 [PAR 32:27 DAR 16:9], q=2-31, 6000 kb/s, 90k tbn, 29.97 tbc
Stream #0.1(rus): Audio: libfaac, 48000 Hz, 5.1, s16
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 161 fps= 62 q=2.0 Lsize= 864kB time=5.34 bitrate=1325.8kbits/s
and the end result of the run was a DVD. Unfortunately dvd had no sound.
Please advise.
Thank you.
P.S. I do know that "ss" and "t" params don't work, but i doesn't bother me.
|