I have a stream (rtmp) and I would like to generate some subtitles for it(based on what's happened on stream). I can generate it like a pipe, or some other way. I use script like this:
for i in $(seq -f "%02g" 0 20); do echo " 00:00:$i,000 --> 00:00:$i,999 caption $i "; sleep 1; done | ffmpeg -nostdin \ -i "rtmp://domain.com/streamName live=1" \ -f srt -re -i - \ -c copy \ -c:s text \ -flush_packets 1 -f flv rtmp://output
the first part of a script is create a pipe with actually subs, pipe it to ffmpeg, and ffmpeg should merge subs with the stream. The point is that ffmpeg starts generating output only after the pipe is closed, and subtitles generation is ended. Is it possible to force ffmpeg start generation of output as soon as first lines in pipe appears?