Re: time lapse feature



On Wed, May 27, 2009 at 9:52 PM,  <A J Delaney brighton ac uk> wrote:
> Filippo,
> On Mon, 2009-05-18 at 15:27 +0200, Filippo Argiolas wrote:
>> I agree that the proper way to do this should be to downrate the
>> pipeline and don't disconnect the "handoff" signal. You can also ask
>> for < 1 frames per second using fractional framerates (i.e. 1/30 gives
>> you one shot every 30 seconds).
> I've had a look at this but it doesn't seem viable.  However, my
> understanding comes only from the cheese codebase, so I may be wrong.
> But here's why I don't think it can be done this way.
>
> The function cheese_webcam_get_supported_framerates returns the list of
> framerates supported by a particular camera. However, a user may want to
> take 2 pictures per second.  Furthermore, this framerate may not be in
> the framerates GArray.  If it's not supported by the camera I don't
> think I should try and force the GStreamer element into such a mode.
>
> Unless I'm wrong, my original solution may be better (short of
> implementing a gstreamer timelapse element) i.e. create tmp folder, take
> n pictures per second, create video from these, store video in
> Pictures/Webcam/.

You can easily split the pipeline with tee and have two pipelines at
different framerates using the videorate element. Take a look at this
pipeline:

gst-launch-0.10 v4l2src ! video/x-raw-yuv, width=640, height=480 ! tee
name=t ! queue ! xvimagesink t. ! queue ! videorate ! video/x-raw-yuv,
framerate=2/1 ! xvimagesink

The webcam is set to its native framerate, the videorate element just
drops unneeded frames and gives you the frame rate you want (it works
the reverse too, duplicating frames to increase the framerate).
If I'm not wrong there is already a tee element in the pipeline, so it
shouldn't be too hard to implement this.
Hope this helps

Filippo


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]