How to save playable infinite video?
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