[Qt-interest] Qt/Phonon - video/audio capture?

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Fri Jun 12 13:52:31 CEST 2009


Miroslav Karpis wrote on Friday, June 12, 2009 1:36 PM:

> Hi,
> 
> please is it possible to somehow record the desktop to a video/audio
> file? - I would like to record all the actions that were done on
> desktop. Like a normal video capture program. The point is that I
> would like to have this 'capture' application inside Qt program.   

I am not a 'desktop capture' expert, but the naive solution is certainly to capture the entire desktop as a "screenshot" (see http://doc.qtsoftware.com/4.5/qdesktopwidget.html, render this widget into a QImage - I think there is even a Qt example code somewhere), and repeat this task at a framerate of say 15 FPS or more.

Then use a clever video codec which can encode these images fast enough ("realtime") into a video stream (MP4, MP2, DivX, MJPEG, ... don't hit me because I am lazily mixing up formats/containers here ;). Maybe http://www.ffmpeg.org would be of use here.

But I think existing solutions ("desktop recording software") apply better techniques: they probably analyse the mouse events and just store the relative movements of windows, menus etc. - just the part of the desktop which needs to be repainted is then encoded into the video (which would then be off course a custom format, other than h.264 etc.) - just like a clever window manager which knows which parts of the screen need to be repainted when a window is moved, when a menu pops up etc.

Off course that would be all custom development, Qt naturally can't provide you with a ready-to-use solution, other than helping you with grabbing (parts) of the desktop widget, giving you access to the pixel data etc.

Maybe other people come up with more ideas here.


Cheers, Oliver
-- 
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22



More information about the Qt-interest-old mailing list