How can I convert an AVI video frame (displayed with wx.media.MediaCtrl) to a PNG image file?

I have a small test program in which I use wx.media.MediaCtrl to play AVI video files (displayed in a panel). And I can pause the video to display single frames. How can I convert a single video frame, being displayed while paused, into a PNG image file? [Note, I am using WxPython 2.8.12.1, Python 2.7 on a Windows Vista (32-bit) platform.]

--V

Virgil Stokes wrote:

I have a small test program in which I use wx.media.MediaCtrl to play AVI video
files (displayed in a panel). And I can pause the video to display single
frames. How can I convert a single video frame, being displayed while paused,
into a PNG image file?

That's not possible through the MediaCtrl. It's designed for simple
playback. If that seems odd, consider that the MediaCtrl itself isn't
actually doing any of the work. It creates a DirectShow graph, and the
graph filters do the work. The MediaCtrl never touches the frames.

You can try using BitBlt to grab a copy of your main window, although if
the movie is being displayed through an overlay surface, that won't work.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

If you come up with a good answer, please let me know! I’m currently using FFmpeg to grab frame data from video files for still images, but that can be slow (especially for images later in longer files) and imprecise (generaly within a few frames, but it’s hard to get exactly the frame you want sometimes.)

David

···

On Thu, Jan 2, 2014 at 2:07 PM, Tim Roberts timr@probo.com wrote:

Virgil Stokes wrote:

I have a small test program in which I use wx.media.MediaCtrl to play AVI video

files (displayed in a panel). And I can pause the video to display single

frames. How can I convert a single video frame, being displayed while paused,

into a PNG image file?

That’s not possible through the MediaCtrl. It’s designed for simple

playback. If that seems odd, consider that the MediaCtrl itself isn’t

actually doing any of the work. It creates a DirectShow graph, and the

graph filters do the work. The MediaCtrl never touches the frames.

You can try using BitBlt to grab a copy of your main window, although if

the movie is being displayed through an overlay surface, that won’t work.

Tim Roberts, timr@probo.com

Providenza & Boekelheide, Inc.

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.