How to get number of recorded frames in obs filter?

mariosF

New Member
Hello,
I am working on an obs filter which records the timestamp of each recorded frame along with a count of the total frames so far. Since the timestamps need to be as close to the source as possible it is implemented using a source filter but applied on the scene only. To do this I am using a OBS_SOURCE_TYPE_FILTER with the OBS_SOURCE_VIDEO flag. Then I defined the callback for video_tick where if OBS is recording I record the timestamp at every tick.

The problem is that the number of recorded timestamps does not match up with the final video frames (recorded video frames has fewer frames than the tick count). This makes sense since there may be dropped frames in the final recording due to various factors. How can I know the total recorded frames DURING the recording and within the filter? I have tried video_output_get_skipped_frames and video_output_get_total_frames but the former always gives 0 and the latter has almost the same discrepancy as just counting the incrementing the ticks at every video_tick. Is there a reliable way to know if a frame at video_tick is actually recorded in the file?

Any suggestions?

Thank you!
 

mariosF

New Member
To clarify, in order to know if obs is recording I am currently using the frontend api event OBS_FRONTEND_EVENT_RECORDING_STARTED/STOPPED/PAUSED/UNPAUSED
 
Top