[FFmpeg-devel] Creating a real-time subtitle source

Sean Dunn sean at wavexr.com
Thu Apr 1 00:32:08 EEST 2021


I would like to modify ffmpeg to accept real time SRT data from a tcp
listener. This is my first dive into ffmpeg's architecture. So far in my
prototype, I've been able to mark the tcp listener as non-blocking
(returning EAGAIN), but I have an issue with the emitted subtitle packets,
and I'd like to ask for guidance before I go too far.

Issue: I would like to make the return of a packet from srt_read_packet()
(srtdec.c) optional. My approach has been to return EAGAIN in that case,
which the thread logic seems to support. But, if the subtitle packet queue
is empty for long enough, ffmpeg will cease to send any AV packets as well,
and my stream will halt.

What changes do I need to think about to make this work when all SRT
packets aren't known at input load time?

Thank you,
Sean

-- 
// Sean Dunn, Chief Architect, Wave | www.wavexr.com


More information about the ffmpeg-devel mailing list