<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Feb 27, 2022 at 10:19 AM Strahinja Radman <<a href="mailto:dr.strashni@gmail.com">dr.strashni@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><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 27 Feb 2022 at 09:13, Asaf Kave <<a href="mailto:kaveasaf@gmail.com" target="_blank">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"><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" target="_blank">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>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="https://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br>
To unsubscribe, visit link above, or email<br>
<a href="mailto:libav-user-request@ffmpeg.org" target="_blank">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" dir="auto"></blockquote><div dir="auto"><br></div><div dir="auto">Hello, </div><div dir="auto"><br></div><div dir="auto">You should just be able to load the subtitle and remux it with the video. So algorithm would be</div><div dir="auto">1. Open video and subtitle </div><div dir="auto">2. Open new output file and add two streams (subtitle and video) </div><div dir="auto">3. Read packets from video and subtitle using av_read_frame() which will give you AVPacket*</div><div dir="auto">4. Send those packets to av_interleaved_write_frame()</div><div dir="auto">5. Close the file (very important for some containers)</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" dir="auto"></blockquote><div dir="auto"><br></div><div dir="auto">Kind regards,</div><div dir="auto">Strahinja</div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" dir="auto"><br>
</blockquote></div></div>-- <br><div dir="ltr"><br>Regards<br>Strahinja Radman</div>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="https://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br>
To unsubscribe, visit link above, or email<br>
<a href="mailto:libav-user-request@ffmpeg.org" target="_blank">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".<br></blockquote><div><br></div><div>Thank you  Strahinja,</div><div>I am going with your approach, but still have some issues with subtitles formatting and style, because MP4 uses only "mov_text", I need to transcode my subtitles, and I saw that there is a lack of code in the "movtextenc.c".</div><div><br></div><div>Asaf</div></div></div>