[Libav-user] Muxing a .srt file into a .mp4 file ?

pehache pehache.7 at gmail.com
Sun Apr 22 20:03:30 CEST 2012


Le 22/04/12 19:41, pehache a écrit :
> Le 22/04/12 16:22, pehache a écrit :
>>
>>
>> And finally, the only command which succeeds is with the output .mkv
>> file, and specifying -scodec copy:
>>
>> ===================================================================
>> *****$ ffmpeg -i Good_Bye_Lenin.DVDRIP.HQ.deFR.mp4 -i
>> Good_Bye_Lenin.de.srt -vcodec copy -acodec copy -map 0.0 -map 0.1 -map
>> 1.0 -y toto.mkv
>> ===================================================================
>
> I meant :
>
> *****$ ffmpeg -i Good_Bye_Lenin.DVDRIP.HQ.deFR.mp4 -i
> Good_Bye_Lenin.de.srt -vcodec copy -acodec copy -scodec copy -map 0.0
> -map 0.1 -map 1.0 -y toto.mkv

Hum... The above is OK, but if I try to include another subtitle stream 
it fails:

===================================================================
toto2:COMEDIE_DRAMATIQUE pierre$ ffmpeg -i 
Good_Bye_Lenin.DVDRIP.HQ.deFR.mp4 -i Good_Bye_Lenin.de.1.srt -vcodec 
copy -acodec copy -scodec copy -map 0.0 -map 0.1 -map 1.0 -map 0.3 -y 
toto.mkv -newsubtitle
ffmpeg version 0.7.11, Copyright (c) 2000-2011 the FFmpeg developers
   built on Mar 17 2012 12:11:52 with gcc 4.2.1 (Apple Inc. build 5666) 
(dot 3)
   configuration: --prefix=/opt/local --enable-gpl --enable-postproc 
--enable-swscale --enable-avfilter --enable-libmp3lame 
--enable-libvorbis --enable-libtheora --enable-libdirac 
--enable-libschroedinger --enable-libopenjpeg --enable-libxvid 
--enable-libx264 --enable-libvpx --enable-libspeex 
--mandir=/opt/local/share/man --enable-shared --enable-pthreads 
--cc=/usr/bin/gcc-4.2 --arch=x86_64 --enable-yasm
   libavutil    50. 43. 0 / 50. 43. 0
   libavcodec   52.123. 0 / 52.123. 0
   libavformat  52.111. 0 / 52.111. 0
   libavdevice  52.  5. 0 / 52.  5. 0
   libavfilter   1. 80. 0 /  1. 80. 0
   libswscale    0. 14. 1 /  0. 14. 1
   libpostproc  51.  2. 0 / 51.  2. 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x102052000] max_analyze_duration 5000000 
reached at 5013333

Seems stream 0 codec frame rate differs from container frame rate: 
180000.00 (180000/1) -> 25.00 (25/1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Good_Bye_Lenin.DVDRIP.HQ.deFR.mp4':
   Metadata:
     major_brand     : mp42
     minor_version   : 0
     compatible_brands: mp42isomavc1
     creation_time   : 2012-04-07 09:59:01
     encoder         : HandBrake 0.9.6 2012022800
   Duration: 01:52:41.32, start: 0.000000, bitrate: 1274 kb/s
...
     Stream #0.0(und): Video: h264 (High), yuv420p, 704x384, 999 kb/s, 
25 fps, 25 tbr, 90k tbn, 180k tbc
     Metadata:
       creation_time   : 2012-04-07 09:59:01
     Stream #0.1(fra): Audio: aac, 48000 Hz, stereo, s16, 131 kb/s
     Metadata:
       creation_time   : 2012-04-07 09:59:01
     Stream #0.2(deu): Audio: aac, 48000 Hz, stereo, s16, 131 kb/s
     Metadata:
       creation_time   : 2012-04-07 09:59:01
     Stream #0.3(fra): Subtitle: dvdsub, 4 kb/s
     Metadata:
       creation_time   : 2012-04-07 09:59:01
     Stream #0.4(und): Subtitle: text / 0x74786574
     Metadata:
       creation_time   : 2012-04-07 09:59:01
[srt @ 0x102053200] Estimating duration from bitrate, this may be inaccurate
Input #1, srt, from 'Good_Bye_Lenin.de.1.srt':
   Duration: N/A, start: 0.000000, bitrate: N/A
     Stream #1.0: Subtitle: srt
Output #0, matroska, to 'toto.mkv':
     Stream #0.0(und): Video: libx264, yuv420p, 704x384, q=2-31, 999 
kb/s, 90k tbn, 90k tbc
     Metadata:
       creation_time   : 2012-04-07 09:59:01
     Stream #0.1(fra): Audio: aac, 48000 Hz, stereo, 131 kb/s
     Metadata:
       creation_time   : 2012-04-07 09:59:01
     Stream #0.2: Subtitle: srt
     Stream #0.3(fra): Subtitle: [0][0][0][0] / 0x0000, 64 kb/s
     Metadata:
       creation_time   : 2012-04-07 09:59:01
Stream mapping:
   Stream #0.0 -> #0.0
   Stream #0.1 -> #0.1
   Stream #1.0 -> #0.2
   Stream #0.3 -> #0.3
Encoder (codec id 94210) not found for output stream #0.3
===================================================================

Note that I have exactly the same error if I map #1.0 to #0.3




More information about the Libav-user mailing list