[FFmpeg-user] Subtitles in mp4

Moritz Barsnick barsnick at gmx.net
Wed Jun 11 11:06:26 EEST 2025


On Tue, Jun 10, 2025 at 13:21:49 -0400, Mark Filipak wrote:
> My 5-step method is now a 4-step method, but, apparently, any further
> efficiency is not possible. I cover that at the bottom of this message.
[...]
> Isn't it curious that subtitles don't work in Step 1, but they do work in Step 5?

No, it isn't. In step 1, you are trying to "copy" PGS image-based
subtitles into MP4. MP4 supports _only_ text-based subtitles in the
mov_text format/codec. Nothing else. ffmpeg cannot do that, because
it's just not possible.

(MP4 is quite restrictive. That's why it's easier switching to a
player supporting more flexible containers than trying to convert
everything to MP4.)

In step 4, SubtitleEdit apparently converts the PGS subtitles to SRT -
likely by OCR. (Which is something ffmpeg cannot really do, even though
there is an OCR filter, converting video to text.)

SRT in turn can be reencoded to mov_text by ffmpeg - that's why step 5
works.

> FACT: Subtitles do work in mp4, so don't say that they don't work.

Only text-based mov_text subtitles.

> FACT: FFmpeg is able to make subtitles in mp4 if the subtitles come from an srt.

Partially because SRT is also text-based (and because someone
implemented the encoding, obviously).

> FACT: FFmpeg is not able to make subtitles in an mp4 if it is also making video.

No tool is capable of placing image-based subtitles into MP4 as a
separate track. You must either super-impose them onto the video, or
convert them to text (which ffmpeg cannot, as you correctly state).

Cheers,
Moritz


More information about the ffmpeg-user mailing list