Discarding Frames

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Discarding Frames

Wes Miller
Administrator
I would like to process an mjpeg stream stored in a  matroska container file to build a new file with fewer frames in it.  Specifically, I have a list of random frames I want to keep.  

This feels like a good use for appsink, but will discarding frames mess up the header info?  

I suppose the header comes through the appsink first as the first (more?) frame.

Can I 1use the caps to detect header from image frame?  

Will I need to dissect my header and adjust it?  

Where might I find specs to follow?

Many thanks,

Wes Miller
Reply | Threaded
Open this post in threaded view
|

Re: Discarding Frames

Tim-Philipp Müller-2
On Thu, 2010-06-03 at 15:08 -0700, Wes Miller wrote:

> I would like to process an mjpeg stream stored in a  matroska container file
> to build a new file with fewer frames in it.  Specifically, I have a list of
> random frames I want to keep.  
>
> This feels like a good use for appsink, but will discarding frames mess up
> the header info?  
>
> I suppose the header comes through the appsink first as the first (more?)
> frame.
>
> Can I 1use the caps to detect header from image frame?  
>
> Will I need to dissect my header and adjust it?  
>
> Where might I find specs to follow?

You could use a pipeline such as e.g. matroskademux ! queue ! capsfilter
caps=image/jpeg ! matroskamux and then set up a buffer probe on the
capsfilter's sink pad (there may not be any need for the queue or the
capsfilter). Whenever a buffer is pushed through, your probe callback
will be called and you can decide whether the buffer should be dropped
or kept by returning TRUE or FALSE.

Alternatively, just write a small element that does the same thing and
either pushes out the buffer it receives in its chain function or drops
it.

Cheers
 -Tim


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel