PDA

View Full Version : Displaying/recording video from capture card buffer



pdm
8th December 2015, 06:11
Hi all. To set the stage.. I'm an electrical eng with moderate embedded programming experience, am somewhat new to Qt(I really like it), and am absolutely novice WRT video. I am building this program with 5.5.1, creator, and compiling with msvc2010.

I have an niche video capture card that I need to access(view/record) video data from. The video pixel info is 14bit grey scale in 2 bytes. The card has a library that will trigger my callback when a frame is available(60Hz rate). When in the callback, i will copy a video frame from the card pingpong buffer. I get a little lost with what to do with it afterward.

From some examples it seems that I should subclass QAbstractVideoSurface and send each image to a pixmap on my GUI. I am a little confused when the present method will be called, and what calls it. Also, is the present method where I should directly access the card memory or should this be done in the callback. I assume the callback should move the card buffer to a buffer in ram, and write it to disk. And the present method should map the buffer in ram to a QAbstractVideoBuffer or to the screen. Is this correct?What schedules the calls to the present method, and how long should my buffer hold on to the video frame?

The Qt documentation has been useful, but I am lacking a high level understanding of how things work, and what my options are to accomplish this task.
Any advice would be appreciated.