T
T
Timofey Fedyanin2014-01-28 11:43:21
Data synchronization
Timofey Fedyanin, 2014-01-28 11:43:21

How to display a sequence of frames on the screen with a given FPS without gaps?

Good day!
There is a task to record the frames displayed on the projector with a camera.
The camera and the projector are hardware synchronized.
Frames are displayed using cv::imshow (without openGL).
Video capture gives 50fps, but not evenly (frames are issued according to the scheme 37ms -> frame -> 3ms -> frame. Therefore, the video capture cycle cannot be used as a clock, image tearing occurs (tearing) and some kind of darkness in general.
When using a software timer (std::chrono) Frames are lost periodically (most likely a strobe effect.
Please tell me how to display a sequence of frames on the screen with a given FPS without gaps. (For example, MPC-HC can almost do this when VSYNC is on, although sometimes it loses a frame)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bak, 2014-01-28
@Tim06ka

Buffer a couple of frames. Use the fifo queue, start rendering when it has 2-3 frames. On the timer, take a frame from the queue and show that the video capture puts frames in the queue whenever it wants.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question