[FFmpeg-user] Subtitles disappear

Cecil Westerhof Cecil at decebal.nl
Mon Jan 4 16:43:34 EET 2021

"Mark Filipak (ffmpeg)" <markfilipak at bog.us> writes:

> On 01/03/2021 08:00 PM, Cecil Westerhof via ffmpeg-user wrote:
>> I convert a video with the following statement
>>      ffmpeg -y -i input.mkv -nostdin -vf scale=1024:-2 -crf 23 -acodec
>> libmp3lame -qscale:a 9 -preset veryfast Temp/output.mp4
>> The input file has subtitles, but the output file does not.
>> What to change to have also subtitles in the output file?
>> And if I can do things better, I do not mind to hear it. ;-)
> MP4 containers don't support subtitle streams. I use MKV.

If I remember well I have seen MP4's with subtitles. But maybe they
used SRT files.

> You can specify codecs with these
> -codec:v
> -codec:a
> -codec:s

With converting to MKV (and -codec:s copy) it seems to work. The
reason I used MP4 is that in the past MKV files did not work on
Android. I will later test if this still is a problem. Even if this is
the case, it will not be very important because I do not often play
them on Android. Just something to think about the moment I will.

An added bonus by converting to MKV is that it seems about 50% as
fast. But maybe that will be different if the input file is a MP4.

Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

More information about the ffmpeg-user mailing list