I have a project that will need to be able to know the time a video file (such as .mp4
, .mov
, .mxf
etc.) was started (e.g. when record was pressed) and when the video file was ended in seconds since epoch.
So far what I have been doing is finding the File Modified
time and using that as the endpoint and then subtracting duration to find the beginning. This works pretty well in some cases but it appears that some cameras don't exactly write/modify files in a linear predictable way so sometimes the start/end times of the video files overlap when clearly you can't be recording 2 files at the same time.
Is there some other method or piece of metadata I could access using say ffprobe
(or alternative) in python to accurately determine when the video was started and when it was ended?
Your best tools are:
ffprobe
mediainfo
exiftool
You can find many types of datestamps in them but I've never tested them for accuracy. If between those tools and filesystem stamps you can't find the proper metadata then you need better tracking at the time of filming. I'm a filmmaker as well as programmer and I can't quite figure out why you would need epoch time but I do know you need better tracking during production.
Try a digital clapboard with a clock, or use a some sort of digital recorder where you can control timestamp creation during recording.
Also, as others have mentioned this question lacks focus. What problem are you trying to solve? I can only think of sync between media sources in which case use some software such as plural eyes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With