I load the m3u8 stream as follows:
#EXTM3U
#EXT-X-TARGETDURATION:5
#EXT-X-ALLOW-CACHE:YES
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:1.000,
seg-1.ts
#EXTINF:2.000,
seg-2.ts
#EXTINF:3.000,
seg-3.ts
#EXTINF:5.000,
seg-4.ts
ffmpeg -i " https://example.com/mystream.m3u8 " -c copy "videoname.mp4"
But sometimes some segments get lost (HTTP request may return an error). Are there any options for reconnecting to the connection if it failed?
source
share