> Subject: Re: [Kdenlive-devel] How to get a single frame
> On Wednesday 20 October 2004 14:49, L=FAcio Fl=E1vio Corr=EAa wrote:
> > Hi people. I'm trying to get a single frame from a file, and put it =
> > QPixmap for example. Reading piave source code, I found a function =
> > veml_snapShot(), but didn't understand how to do that. Any idea?
> you can ask piave to save a single frame to a file (at the same time =
> it to a smaller size if requested). The intention of this command was =
> load these pictures into kdenlive and display them in the timeline, =
> have a few frames of the clip instead of only the name. I actually=20
> implemented this half way, but I couldn't figure out what to do when =
> user 'cut's a clip. On this action, kdenlive would need to ask piave =
> couple of new frames. That didn't work, so I didn't commit it.
For the record, here was my plan to implement clip images in Kdenlive.
1. there needs to be an image manager, so that we know to delete images =
when they are no longer needed, and so that we can limit the maximum =
number of images loaded at once.
2. Part of the image manager : images should only be requested/loaded =
when necessary. Consider loading in a file that has a couple of thousand =
clips in the timeline (extreme but possible), we do not want to request =
several thousand images from piave in one go.
3. When we want to draw a clip on the timeline we request an image from =
the image manager. The image manager will either return the image (if it =
is available) or it will fire a request for the image to piave and =
return a NULL image.
NOTE - it is very important that Kdenlive does not wait until piave =
returns an image. Firstly, the image may take some time to generate. =
Secondly, piave might crash or be terminated by the user before it =
returns an image. We do not want the user interface to *ever* wait for =
4. Whenever piave returns an image to Kdenlive, we check to see if any =
part of the timeline needs to be redrawn (since the image is now =
available) and invalidate parts of the timeline widget as necessary.
> To test it, just send a command like the following from kdenlive to a =
> instance after setting a scenelist (may contain effects and =
> <snapShot time=3D"0" />
In case those reading do not know, you can send arbitrary commands to =
piave via the debug window.