Watch multi-stream video file while being recorded by ffmpeg
I am using ffmpeg to record four 1080p video streams simultaneously and I would like to view these streams in real time while they are being recorded. Ideally I would like to view them from a separate machine, using some convenient Linux data sharing method like ssh/sshfs/..., but that is a nice-to-have. Is there a practical way to accomplish this?
The ffmpeg recording command that I currently use is like this:
ffmpeg \ -f v4l2 -i $cam0 \ -f v4l2 -i $cam1 \ -f v4l2 -i $cam2 \ -f v4l2 -i $cam3 \ -f matroska \ -map 0 \ -map 1 \ -map 2 \ -map 3 \ -c copy \ $output.mkv
My problem would be solved if I could use a command like
vlc to play one or more of the video streams, always tracking close to the end of the stream, playing more as data becomes available. I haven't found such an option though.
One alternative might be to have the recording ffmpeg process also tile the four 1080p videos into one 4K grid and pipe that to ffplay. Then I could at least preview on the same machine that is recording. I have not been able to work out the right ffmpeg command to do the tiling though and would appreciate an example.