<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 21, 2022 at 6:07 PM Asaf Kave <<a href="mailto:kaveasaf@gmail.com">kaveasaf@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi All,<div><br></div><div>I want to embed .srt file to my MP4 output file using code, <b>not CLI</b>, I didn't find any good example for that, the only example I have is the remuxing.c demo.</div><div><br></div><div>What is the best way to do it? </div><div>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  <a href="https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/remuxing.c" target="_blank">https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/remuxing.c</a>).</div><div>2) Can I use avcodec_encode_subtitle from libavcodec to do it?</div><div>3) using complex filters?</div><div><br></div><div>Thanks in advance</div><div>Asaf</div></div></blockquote><div><br></div><div>Anyone? </div></div></div>