[FFmpeg-user] can't copy or transcode subtitles

Jim Worrall coniophora at gmail.com
Thu Apr 28 15:47:16 CEST 2011


[Sorry for not posting to the related thread I started, but the mail list does not send me copies of my mails (though I have that selection checked in the options page), and I received no reply]

I am having trouble getting subtitles to pass through in a file I am converting from mkv to m2ts.  I can't tell what format the subtitles are in.  The program VideoSpec just names them as "UTF-8".  When I try to extract them using ffmpeg, I only get any success when extracting them into an srt file as follows
ffmpeg -i 02.mkv -scodec copy -an -vn 02.srt -map 0.3
but the resulting file contains only the text lines, no time data.

There are two subtitle streams and I would like to keep them both.  I finally got the output file to have two subtitle streams by creating a second one with -newsubtitle and mapping, but ffmpeg gives the error below when it gets to the subtitles (doesn't matter whether the chinese or english one).

Thanks for any reply.

Here is the command and result:

ffmpeg -y -i 02.mkv -f mpegts -threads -0 \
> -vcodec libx264 -s hd720 -r 23.976 -b 1800K -vbsf h264_mp4toannexb \
> -acodec ac3 -ab 640K -ar 48K \
> -scodec copy -scodec copy \
> 02.m2ts -newsubtitle -map 0.0 -map 0.1 -map 0.2 -map 0.3
FFmpeg version UNKNOWN, Copyright (c) 2000-2011 the FFmpeg developers
  built on Apr 21 2011 18:00:17 with gcc 4.2.1 (Apple Inc. build 5666) (dot 3)
  configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --arch=x86_64 --enable-runtime-cpudetect
  libavutil    51.  0. 0 / 51.  0. 0
  libavcodec   53.  0. 0 / 53.  0. 0
  libavformat  53.  0. 0 / 53.  0. 0
  libavdevice  53.  0. 0 / 53.  0. 0
  libavfilter   2.  0. 0 /  2.  0. 0
  libswscale    0. 13. 0 /  0. 13. 0
[matroska,webm @ 0x101812400] max_analyze_duration reached
[matroska,webm @ 0x101812400] Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate: 47.95 (5000000/104271) -> 23.98 (24000/1001)
Input #0, matroska,webm, from '02.mkv':
  Duration: 00:42:43.58, start: 0.000000, bitrate: N/A
    Stream #0.0(eng): Video: h264 (High), yuv420p, 1024x576, PAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0.1(eng): Audio: aac, 48000 Hz, 5.1, s16 (default)
    Stream #0.2(chi): Subtitle: [0][0][0][0] / 0x0000 (default)
    Stream #0.3(eng): Subtitle: [0][0][0][0] / 0x0000
[buffer @ 0x101317490] w:1024 h:576 pixfmt:yuv420p
[scale @ 0x1013061b0] w:1024 h:576 fmt:yuv420p -> w:1280 h:720 fmt:yuv420p flags:0x4
[libx264 @ 0x1019a2600] Default settings detected, using medium profile
[libx264 @ 0x1019a2600] using SAR=1/1
[libx264 @ 0x1019a2600] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2
[libx264 @ 0x1019a2600] profile High, level 3.1
Output #0, mpegts, to '02.m2ts':
    Stream #0.0(eng): Video: libx264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], q=2-31, 1800 kb/s, 90k tbn, 23.98 tbc (default)
    Stream #0.1(eng): Audio: ac3, 48000 Hz, 5.1, s16, 640 kb/s (default)
    Stream #0.2(chi): Subtitle: srt (default)
    Stream #0.3(eng): Subtitle: [0][0][0][0] / 0x0000, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
  Stream #0.2 -> #0.2
  Stream #0.3 -> #0.3
Error while opening encoder for output stream #0.2 - maybe incorrect parameters such as bit_rate, rate, width or height




More information about the ffmpeg-user mailing list