[FFmpeg-user] HLS: multiple retries on HTTP 404 errors

den.bkh at yandex.ru den.bkh at yandex.ru
Mon Jan 29 15:44:17 EET 2018


I copy live HLS stream with the command like this: 
ffmpeg -probesize 10000000 -y -i "https://rfe-lh.akamaihd.net/i/rfe_tvmc5@383630/index_0720_av-p.m3u8?sd=10&rebase=on" \
-t 7200 -map 0:0 -map 0:1 -c copy o.mkv

It works most of the time, but sometimes some requests for new HLS segments result in "HTTP error 404 Not Found" errors:
[hls,applehttp @ 0x55e993a7ef80] Opening 'https://rfe-lh.akamaihd.net/i/rfe_tvmc5@383630/segment151719160_0540_av-p.ts?sd=10&rebase=on' for reading
[hls,applehttp @ 0x55e993a7ef80] Opening 'https://rfe-lh.akamaihd.net/i/rfe_tvmc5@383630/segment151719161_0540_av-p.ts?sd=10&rebase=on' for reading
[https @ 0x55e9942e2420] HTTP error 404 Not Found
[hls,applehttp @ 0x55e993a7ef80] Failed to open segment of playlist 0
[hls,applehttp @ 0x55e993a7ef80] Opening 'https://rfe-lh.akamaihd.net/i/rfe_tvmc5@383630/segment151719162_0540_av-p.ts?sd=10&rebase=on' for reading
frame=101178 fps= 25 q=-1.0 size= 1048779kB time=01:07:39.98 bitrate=2116.2kbits/s speed=1.01x   

>From this log we can see that the request for the segment with name "segment151719161_0540_av-p.ts" results in HTTP 404 error. It looks like a bug of the streaming service, but I also think that this segment could be available if we make another request(maybe after some timeout). 

Is it possible to configure ffmpeg to do multiple retries on HTTP errors for buggy/missed/not-yet-created HLS segments?

More information about the ffmpeg-user mailing list