[FFmpeg-user] Preserving subtitles when transcoding mkv to wmv (or avi)?

Stefano Sabatini stefasab at gmail.com
Wed Dec 28 01:45:49 CET 2011


On date Wednesday 2011-12-28 01:04:09 +0100, Markus Fischer encoded:
> Hi,
> 
> when I transcode a mkv to avi, I cannot seem to retain the subtitles.

IIRC AVI doesn't support soft subtitles, mkv is one of the few formats
supporting it (and maybe MP4, I may be wrong).
 
> Example:
> 
> $ ffmpeg.exe -i sample.mkv -an -scodec copy -y test.wmv
> ffmpeg version N-36193-gf514695, Copyright (c) 2000-2011 the FFmpeg
> developers
>   built on Dec 26 2011 17:55:53 with gcc 4.6.2
>   configuration: --enable-gpl --enable-version3 --disable-w32threads
> --enable-runtime-cpudetect --enable-avisynth --enable-bzlib
> --enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb
> --enable-libfreetype --enable-libgsm --enable-libmp3lame
> --enable-libopenjpeg --enable-librtmp --enable-libschroedinger
> --enable-libspeex --enable-libtheora --enable-libvo-aacenc
> --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
> --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
>   libavutil      51. 33.100 / 51. 33.100
>   libavcodec     53. 48.100 / 53. 48.100
>   libavformat    53. 28.100 / 53. 28.100
>   libavdevice    53.  4.100 / 53.  4.100
>   libavfilter     2. 54.100 /  2. 54.100
>   libswscale      2.  1.100 /  2.  1.100
>   libswresample   0.  5.100 /  0.  5.100
>   libpostproc    51.  2.100 / 51.  2.100
> Input #0, matroska,webm, from 'sample.mkv':
>   Duration: 02:13:14.99, start: 0.000000, bitrate: 5857 kb/s
>     Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x696 [SAR 1:1 DAR
> 160:87], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
>     Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), s16, 1536
> kb/s (default)
>     Stream #0:2(eng): Subtitle: text (default)
> [buffer @ 0000000003C97DA0] w:1280 h:696 pixfmt:yuv420p tb:1/1000000
> sar:1/1 sws_param:
> Output #0, asf, to 'test.wmv':
>   Metadata:
>     WM/EncodingSettings: Lavf53.28.100
>     Stream #0:0(eng): Video: msmpeg4 (MP43 / 0x3334504D), yuv420p,
> 1280x696 [SAR 1:1 DAR 160:87], q=2-31, 200 kb/s, 1k tbn, 23.98 tbc (default)
>     Stream #0:1(eng): Subtitle: text (default)
> Stream mapping:
>   Stream #0:0 -> #0:0 (h264 -> msmpeg4)
>   Stream #0:2 -> #0:1 (copy)
> Could not write header for output file #0 (incorrect codec parameters ?)
> 
> Leaving out "-scodec copy" successfully transcodes the file.
> 
> Is this a problem with ffmpeg? or with the WMV container format?
> 
> I think AVI would also be an option, but in this case I get a clear
> message that a special format is required for the subtitles:
[...] 
> All I'm trying is get videos playing on my XBOX 360 properly supporting
> subtitles.

What you can try is to *burn* the subtitles on the video, using the
ass filter, so first you'll need to convert the subtitles to ass
(using ffmpeg -scodec ass). Otherwise you'll have to choose a
container with full support for soft subtitles.
-- 
ffmpeg-user random tip #0
Please try to use a reasonably recent version of ffmpeg before asking
questions to ffmpeg-user: older versions aren't supported here!


More information about the ffmpeg-user mailing list