[Kdenlive-devel] How to get a single frame

jasonwood at blueyonder.co.uk jasonwood at blueyonder.co.uk
Thu Oct 21 15:31:44 UTC 2004


> Subject:	Re: [Kdenlive-devel] How to get a single frame
> On Wednesday 20 October 2004 14:49, Lúcio Flávio Corrêa wrote:
> > Hi people. I'm trying to get a single frame from a  file, and put it in a
> > QPixmap for example. Reading piave source code, I found a function called
> > 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 scaling 
> it to a smaller size if requested).  The intention of this command was to 
> load these pictures into kdenlive and display them in the timeline, i.e. you
> have a few frames of the clip instead of only the name.  I actually 
> implemented this half way, but I couldn't figure out what to do when the 
> user 'cut's a clip.  On this action, kdenlive would need to ask piave for 
> 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 piave.

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 piave 
> instance after setting a scenelist (may contain effects and everything):
>
>  <snapShot time="0" />

In case those reading do not know, you can send arbitrary commands to piave via the debug window.

Cheers,
Jason
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 3967 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdenlive/attachments/20041021/91877f7a/attachment.bin>


More information about the Kdenlive mailing list