[gst-devel] caps negotiantion again

Michael Lausch mla at lausch.at
Thu Sep 8 14:41:06 CEST 2005


On Wed, 2005-08-31 at 10:48 +0200, Jan Schmidt wrote:
> On Wed, 2005-08-31 at 10:00 +0200, Michael Lausch wrote:
> > hi,
> t. 
> > 
> > neither the decoder (ffmpeg) nor the xvimagesink element have a property
> > named format. do i have to use an ffmpegcolorspace element between them?
> > how can i change the YUV format on it's pads? or on the ffmpegcolorspace
> > element itself?
> 
> The caps that the elements use is decided by the caps negotiation
> process. You can constrain the choice by using 'filtered caps'. In
> gst-launch syntax, you do gst-launch videotestsrc !
> video/x-raw-yuv,format='(fourcc)'I420,width=640,height=480 ! xvimagesink
> 
> Programmatically, you use gst_pad_link_filtered and supply a set of caps
> to filter by.

this was the solution. 

in python:

 def link_video_chain(self, elem, pad):
        print >>sys.stderr,"\nlink_video_chain_called";

        self.vdecoder = gst.element_factory_make('ffdec_mpegvideo');

        self.vsink = gst.element_factory_make('xvimagesink');
        
        #self.filter1 = gst.element_factory_make('ffdeinterlace');
        self.filter2 = gst.element_factory_make('ffmpegcolorspace');


        #self.pipeline.add(self.filter1);
        
        self.pipeline.add(self.filter2);
        self.pipeline.add(self.vdecoder);
        self.pipeline.add(self.vsink);
        

        rc = self.demuxer.link(self.vdecoder);
        rc = self.vdecoder.link(self.filter2);
        
        filter_caps =gst.caps_from_string("video/x-raw-yuv,format=(fourcc)I420");
        rc = self.filter2.link(self.vsink, filter_caps);
        self.pipeline.sync_children_state();


now the problem ist, that audio and video are not in sync. the audio is
running in it's own gst thread. hmm... i think i need to change the
implementation how the elements are created and linked. 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20050908/2d2eb7a3/attachment.pgp>


More information about the gstreamer-devel mailing list