Accessing video RGB data

Stefan Sauer ensonic at hora-obscura.de
Sat Oct 8 13:45:23 PDT 2011


On 10/07/2011 02:20 PM, Erick Pérez wrote:
>>> I don't need to modify movie frames, but I need to read them and do
>>> some calculations. Calculations might take some time, so I need a way
>>> to control how gstreamers feeds the frames. That is, I need a way to
>>> ask next frame from gstreamer instead of gstreamer feeding them at a
>>> constant rate.
>>>
>>> How can I get a new frame only when requested?
>> In your pad_probe just do the calculation as you need. ximagesink will
>> throw away late frames. A smarter way might be to do:
>>
>> ... ! colorspace ! tee name = t ! queue leaky=upstream ! appsink
>>                                              t. ! queue ! ximagesink
>>
>> This way you can use get the frames from appsink (better that using
>> pad-probes or fakesink with the handoff signal). Also the playback gets
>> not disturbed and you process the frames on appsink as you manage. All
>> other frames get dropped.
> Hey, I'm in the same situation, I want to get the frames, and I know I
> can manage the frame rate by using something videorate element, but
> that will drop frames. I want to process some stuff for every frame on
> the picture, so I need to slow down the frame rate playback sometimes,
> but without losing frames. I've seen a way to slow down the playback
> using gnonlin filesource element, but that doesn't convince me either.
> Is there other way ?
>
If you don't want to drop frames and just process frames as fast as you
can turn sync off on the sink.

Stefan


More information about the gstreamer-devel mailing list