[Libav-user] How can I programmatically add .srt subtitle file to MP4 file

Asaf Kave kaveasaf at gmail.com
Mon Feb 21 18:07:57 EET 2022


Hi All,

I want to embed .srt file to my MP4 output file using code, *not CLI*, I
didn't find any good example for that, the only example I have is the
remuxing.c demo.

What is the best way to do it?
1) In the remuxing demo, I see that using libformat I can write chunks of
the subtitles file ( using av_interleaved_write_frame function see line
169  https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/remuxing.c).
2) Can I use avcodec_encode_subtitle from libavcodec to do it?
3) using complex filters?

Thanks in advance
Asaf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20220221/a15b6fc4/attachment.htm>


More information about the Libav-user mailing list