How to save playable infinite video? The situation is described here.

In short, I need a way to save infinite video real-time, playable while being saved. Suppose, there are ways to do this.

I imagine it's done like in web DASH, in chunks, but saved locally.
Ideally (though not necessary) so that any modern player program could play it by clicking on file.
Also prefer open software and standards like ffmpeg and vp9.

Thanks for help!
All you have to do is output to a .ts container.  It's designed for broadcasting systems, so it works fine with incomplete files.

ffmpeg -i INPUT -c copy OUTPUT.ts


You just have to put a compatible codec in the container.  I haven't been able to find a list of what's compatible, but through testing I've found that H.264 and H.265 work.

.ts containers aren't the best once the file is complete, though, because seeking can take a while and they're about 7% bigger, so you can copy the data into an .mp4 container (assuming you're using H.264) when you're finished with

ffmpeg -i INPUT.ts -c copy OUTPUT.mp4