Here's a question I can't seem to find by googling:
I've got a script that runs some functions on a device while recording what happens with a webcam. I've got ffmpeg streaming off v4l2 to a MKV file.
But I want to be able to know when in the video file certain events happened: Like, I know that at real-time 3:09:26 I generated an error, but I don't know when in the video that is
because I can know I started the video at 3:09:00 but it might take like 1/4th of a second to 3 seconds for the camera to actually start recording, and the same for stopping
now one fallback I could do is to have something in the video I know the absolute time of: like, flash a light and record when I did it, and then later synchronize the video with that flash. But that's complicated.
what'd be nicer is something like a way to record metadata timestamps into the video that tell me when (in clock time, not video time) each frame was recorded
I could add a filter that overlays the current time down to the millisecond on the video... but then I need to OCR it back off.
anyway to restate the problem:
I'm trying to go from "thing that happened at 3:06:25 pm" to "2 minutes and 15 seconds into this video file", and I currently can't do that with any accuracy, because the start-stop times on the video are too fuzzy
and I also need this to be accessible to scripts.
so, like, putting a (physical or virtual) clock in frame doesn't help because it just means I have to build a system to OCR the clock value back out.
@foone I'm assuming that your problem is that you want to accurately _set_ the creation_time metadata on e.g. an mp4 file, not that you're trying to read it back out: https://superuser.com/a/1497131
I'm also assuming that your recording device's time is reasonably accurate / synced to NTP.
Interestingly, it seems like phones probably get this right, so if you could control a phone, it might just work...
@evana that would work, except it doesn't seem ffmpeg writes that creation_time metadata. if I use ffprobe to view it, it doesn't show a creation-time