For audio/video files that are in a container storage format, an option is maybe to not just download as a file as is, but to write the audio/video in a container streaming format. Typical is MPEG TransportStream, such a .ts file can be played and started to play as in theory there is no end an no beginning. VLC and mpv can both do it, although VLC does a better job in ad-hoc detecting file-length so seeking works better. mpv has extra options for it. I use this to play ongoing recording from DVB-T2, that is actually MPEG-TS over the air. And cameras as well.There are two good features in this flag:
1) If a download fails towards the end then now the file is corrupt and won't play, whereas with the new flag it will be recoverable as is. Much better than a dead file. It has happened to me on a number of occasions.
2) If a download is longish, say 2 hours or so, then it is no longer needed to wait until it is done to play it from the start. You can play the file while it is downloading. Very useful for example if we are dealing with a news show and are eager to see it right away.
What I don't know whether ffmpeg is smart enough to to do seeks in/via http static content. Maybe that flag in this topic is meant for that I don't know. So if you have:
Code:
ffmpeg -i http://mediafiles.bbc.org/files/videofile.mp4 -map v -map a -c:v copy c:a copy -f mpegts videofile.ts
Statistics: Posted by redvli — Wed Oct 02, 2024 6:42 am