Hello all.
I had a quick question about the Media control. I'm creating frames to be
saved as a movie. However, I'd like to have a 'preview' control (thinking
of using Media Control) to just be able to make sure the content is worth
saving. Probably the frames will be in memory, in a queue object, or a
list, or both. Is there anyway to set a frame rate (between 8 fps - 50 fps,
slow-mo to fast forward) and then use a list of .jpg photos in memory as the
content to watch?
If so, can someone give a quick overview how to load them? cStringIO? Do I
have to just point to the first, and the control will follow the 'chain', or
do I have to send each frame to the control, or maybe make a 'proxy frame'
and then copy in each photo to that?
Thanks! Happy Holidays to All!
-Dave
I'm not sure the media control can be used for what you want. Reading
the documentation and trying to use it myself, I note that it seems to
only have support for audio and video files.
If you load and decode the images beforehand, you could (relatively
easily) Blit() them to the window. Depending on the size of your window
and the speed of your machine, it may or may not be fast enough. I had
some code which was able to push ~10fps on a P2-400 with 320x200 jpegs
from disk.
As for defining the frame rate, you could use any one of a number of
controls for selecting it, as well as any number of mechanisms for
signaling a frame change (wx.Timer, threading.Timer with wx.PostEvent, ...).
- Josiah
···
"S. D. Rose" <s_david_rose@hotmail.com> wrote:
Hello all.
I had a quick question about the Media control. I'm creating frames to be
saved as a movie. However, I'd like to have a 'preview' control (thinking
of using Media Control) to just be able to make sure the content is worth
saving. Probably the frames will be in memory, in a queue object, or a
list, or both. Is there anyway to set a frame rate (between 8 fps - 50 fps,
slow-mo to fast forward) and then use a list of .jpg photos in memory as the
content to watch?
If so, can someone give a quick overview how to load them? cStringIO? Do I
have to just point to the first, and the control will follow the 'chain', or
do I have to send each frame to the control, or maybe make a 'proxy frame'
and then copy in each photo to that?