Embed recording start timestamp and sync video to timestamp using ffmpeg

How (if possible) do I embed a timestamp of when a video started recording? I can -metadata creation_time="YYYY-mm-ddTHH:II:SS" but is there a better way to do that?

I’d also like to be able to generate a grid with each input synchronized to that timestamp. For example I have video from 4 cameras, as a folder of video files for each camera all starting at varying starts and with varying durations. Is it possible to do an hstack,vstack filter to make a grid of all 4 cameras, either hanging the last frame or switching to black while there’s no video for a specific camera?

For example, if all cameras start at the same time, all 4 would be visible, if camera 4’s video ends before the others, it would go black and the other 3 would still be there, then if another video file for camera 4 happens to start during that window, it would come back from black and be visible with the other 3.

Read more here: Source link