Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8374

Camera board • Re: Matching timestamped frames from HQ Camera wall lock times to .h264 video with 1ms precision

$
0
0
Hi, so just to summarise you're recording lots of frames and FFmpeg and encoder.frames_encoded agree about how many frames you have, but the problem is figuring out what their timestamps are.

I assume you're using the FileOutput class to write your .h264 file? If so, the first thing I'd try would be to add the "pts" parameter. This names a file (you can write to a file in memory) where it will output the sensor timestamps for each frame recorded (and no others). If you want wallclocks instead, you could convert those sensor timestamps to wallclock values afterwards by assuming a constant difference between them - unless your recordings are _very_ long, I think any drift will be negligible. You could measure this difference yourself, or pull a sensor/wallclock pair from any frame, just don't measure it before NTP has come along and adjusted your system time after boot!

If you can avoid an explicit "capture_metadata()" loop on top of the recording happening in the background, that might help performance marginally too.

Statistics: Posted by therealdavidp — Tue Mar 25, 2025 9:30 am



Viewing all articles
Browse latest Browse all 8374

Trending Articles