[gst-devel] Queues

Wim Taymans wim.taymans at gmail.com
Wed Jun 3 17:36:38 CEST 2009


On Wed, 2009-06-03 at 17:18 +0200, ldac wrote:
> 
>     Thanks Wim,
> 
> I have implemented that pipeline in C code, and I try to do a clean
> shut down for the pipeline as you have suggested me (I am not able to
> use the last command-line version with -c option) with no improvement.
> But I am almost sure that you're right and my problem is that I am
> doing wrong the EOS propagation throught the pipeline. 
> 
>     I do this to stop the pipeline (when I press certain key):
> 
> GstEvent* eos_event = NULL;
> eos_event = gst_event_new_eos( );
> r = gst_element_send_event( pipeline, eos_event );
> 
>     Where the code that is running is:
> 
> pipeline = gst_pipeline_new( "pipe" );
> video_src = gst_element_factory_make( "v4lsrc", "video-source" );
> .....
> audio_src = gst_element_factory_make( "alsasrc", "audio-source" );
> .....
> gst_bin_add_many( GST_BIN( pipeline ), video_src, video_enc,
> video_parse, audio_src, audio_enc, muxer, sink, NULL );
> gst_element_link_with_filter( video_src, video_enc );
> gst_element_link( video_enc, video_parse );
> .....
> gst_element_set_state( gpipeline, GST_STATE_PLAYING );
> g_main_loop_run( gloop );
> .....
> 
>     Should I send the EOS in other way??? I am doing something
> wrong???
> 
After sending the EOS to the pipeline, wait for the EOS message to
appear on the bus before setting the pipeline to NULL. This makes sure
all data is processed in the pipeline and you can safely shut it down.

Wim


>     Thank you very much.
>     LD.
> 
> 
> Wim Taymans wrote: 
> > On Wed, 2009-06-03 at 11:17 +0200, ldac wrote:
> >   
> > > Hi all,
> > > 
> > > I am launching the following pipe to record audio and video into an
> > > AVI file. When I stop the pipeline and I play the file, audio goes too
> > > fast and video has some interruptions and also goes faster. But if I
> > > run "half" pipeline just with the audio goes fine, and the other half
> > > with the video too ...
> > > 
> > > gst-launch-0.10 v4lsrc capture-width=720 capture-height=576 fps-n=25
> > > fps-d=1 ! \
> > >    'video/x-raw-yuv,width=720,heigh=576,framerate=(fraction)25/1' ! \
> > >    videoencoder width=720 height=576 codec-type=std_avc qp=20 !
> > > h264parse ! mux.\
> > >    alsasrc ! ffenc_mp2 ! mux. \
> > >    avimux name=mux ! filesink location=test.avi
> > > 
> > >     I guess that "queues" can fix the problem, but I have tried
> > > placing them in some positions, but without improvement. Could someone
> > > tell me how/where/why should I use/place the "queues"??? Is there
> > > something else wrong "conceptually" talking? Which clock are both
> > > branches (video and audio) using? Is a muxer problem?
> > >     
> > 
> > You are probably not shutting down the pipeline cleanly (you need to
> > send EOS down the pipeline before shutting it down so that the muxer can
> > write the headers correctly).
> > 
> > Newer gst-launch versions also have the -e option to perform controlled
> > shutdown.
> > 
> > Wim
> >   
> > > Thanks.
> > >     All the best.
> > >     LD.
> > > 
> > > 
> > > 
> > > ------------------------------------------------------------------------------
> > > OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
> > > looking to deploy the next generation of Solaris that includes the latest 
> > > innovations from Sun and the OpenSource community. Download a copy and 
> > > enjoy capabilities such as Networking, Storage and Virtualization. 
> > > Go to: http://p.sf.net/sfu/opensolaris-get
> > > _______________________________________________ gstreamer-devel mailing list gstreamer-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> > >     
> > 
> > 
> > ------------------------------------------------------------------------------
> > OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
> > looking to deploy the next generation of Solaris that includes the latest 
> > innovations from Sun and the OpenSource community. Download a copy and 
> > enjoy capabilities such as Networking, Storage and Virtualization. 
> > Go to: http://p.sf.net/sfu/opensolaris-get
> > _______________________________________________
> > gstreamer-devel mailing list
> > gstreamer-devel at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> >   
> 
> ------------------------------------------------------------------------------
> OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
> looking to deploy the next generation of Solaris that includes the latest 
> innovations from Sun and the OpenSource community. Download a copy and 
> enjoy capabilities such as Networking, Storage and Virtualization. 
> Go to: http://p.sf.net/sfu/opensolaris-get
> _______________________________________________ gstreamer-devel mailing list gstreamer-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gstreamer-devel





More information about the gstreamer-devel mailing list