Problem ending filesink

Tim Müller tim at centricular.com
Fri Nov 15 10:52:07 PST 2013


On Fri, 2013-11-15 at 10:36 -0800, yoyosuper8 wrote:

Hi,

> Hi, I'm trying to figure out how to send a EOS message to finalize the
> filesink and terminate the file that is saving to properly. At the moment,
> data is being saved to a file, but not finalizing it properly.
> 
> Here is my pipeline:
> 
> ( "filesrc location=/storage/sdcard0/sampledat blocksize=614400 ! " +
>   "capsfilter
> caps=\"video/x-raw,format=NV12,width=320,height=240,framerate=30/1\" ! " +
>   "videoconvert ! amcvidenc-omxtiducati1videoh264e bitrate=300
> i-frame-interval=8 ! " +
>   "h264parse ! qtmux ! filesink location=" + "/storage/sdcard0/test.avi";
> 
> What I'm doing is that I have a button that starts this pipeline, but I want
> to press another button that "stops" the recording and finalizes the
> recorded file properly. I just don't know how to send an EOS message across
> the pipeline or filesink to terminate properly. 

This:

  gst_element_send_event (pipeline, gst_event_new_eos())

should inject an EOS event at filesrc, and travel down via the encoder
and muxer (which will clean up properly and write headers) to the
filesink, which will then post an EOS message for you on the bus.

Assuming that encoder element passes this through properly.

Cheers
 -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com






More information about the gstreamer-devel mailing list