[FFmpeg-user] Can I set a "wait-timeout" for ffmpeg to not abort a stream download?

Bo Berglund bo.berglund at gmail.com
Mon Nov 15 16:51:14 EET 2021

On Mon, 15 Nov 2021 20:18:53 +1000, Adam Nielsen via ffmpeg-user
<ffmpeg-user at ffmpeg.org> wrote:

>Your best bet is probably going to be scripting it, so that when it
>terminates, the script runs ffmpeg again to re-establish a new
>connection to the server.

OK, I can then probably run the script that extracts the m3u8 URL repeatedly
until it succeeds and then run the original command again with the possibly
modified m3u8 URL (it is read from file).
One way the problem may occur is that the m3u8 URL becomes invalid, and then I
need a new one obviously.

On a new invocation I will have to adjust the -t argument to handle the time
until the original stop was supposed to be done of course.
Maybe I should modify my script to use the end time in hh:mm:ss notation rather
than the number of seconds of video length as the time parameter...
Then convert internally to the duration.
I need something that can convert back and forth between time in seconds and
time as hh:mm:ss too.
Is there a readymade function that can add/subtract time in hh:mm:ss format and
return the same format?
I think ffmpeg can actually handle -t hh:mm:ss in addition to -t sss

Can I somehow specify to ffmpeg that it should *append* the new data to the
already downloaded first part? Or do I have to get this new bit separately and
then paste them together?

>You may also want to investigate why the connections are getting
>dropped, however depending on how important the streaming is, even a
>perfect system will occasionally drop TCP connections so being able to
>handle that happening will make your set up much more robust.

I have seen while watching live on the source webpage that it sometimes towards
the top of the hour seems to black out the player for a while and then resume.
It could take anywhere from 10 seconds to a couple of minutes when it happens.

The aborted recording does not have any of that it just suddenly ends.

Don't know what this is all about, but I don't think it is some network problem
at least not here (I am on a rock solid 250/100 Mbps fiber connection).
Possibly the streaming site has some such problem....

Bo Berglund
Developer in Sweden

More information about the ffmpeg-user mailing list