[gst-devel] Saving a live stream

Hayden Andrews hayden at heydan.co.uk
Mon Feb 2 10:12:09 CET 2009


Hi Arnout,

Thanks heaps again for your reply. I tried the 'identity' idea at the 
end of last week, and the test was apparently very successful .... 
except that the person who tested it stopped the stream source before 
stopping the saveStream script, so the script exited on it's own accord 
because of the received EOS. I have only just this morning updated the 
script, and it will hopefully be tested in the next few days.

Now, when the Perl script receives a signal to exit, it blocks the src 
pad of the souphttpsrc element, and then sends an EOS signal to the next 
element in the pipe. The script then ends on it's own accord upon seeing 
the EOS signal on the bus.

Thanks for your help! Much appreciated! Hopefully this test will produce 
what we want! :)

H

Arnout Vandecappelle wrote:
> On Friday 30 January 2009 11:02:07 Hayden Andrews wrote:
>   
>> I'm going to try the 'identity' idea as your element is not yet in the
>> build of GStreamer that is on the production machine.
>>     
>
>  I doubt it ever will be since there are no sponsors for it.
>
>   
>> I'm not filled with confidence when you suggest that something else is
>> bound to go wrong! Is this not a fairly standard scenario?
>>     
> [snip]
>
>  Although I never actually tried it, I think the identity single-segment thing 
> will do want you want automatically if you select your chunk using a seek 
> event.  The seek event will be interpreted by the demuxer, and I believe it 
> will send a synchronous newsegment on all its src pads.
>
>
>   
>> I guess that I should be sending this EOS to the
>> pipe before calling quit() ??? How do I go about doing that?
>>     
>
>  I don't know how to do it in perl, but it's probably similar to the way you 
> do it in C.
>
>  You have to push an EOS event to an element or a pad upstream from the mixer.  
> You can choose any element, but probably the source element (souphttpsrc?) is 
> the easiest.  In C it would be something like:
>
>     gst_pad_send_event(srcelement, gst_event_new_eos());
>
>  Actually, it's possible that just setting the source element state to NULL is 
> sufficient to trigger the EOS.  You anyway have to set the source element 
> state to NULL, otherwise it will keep on pushing buffers after the EOS, which 
> is not allowed.
>
>  After sending the EOS, you can wait for an EOS message to appear on the bus.  
> This message indicates that all sinks have recieved an EOS.  After that you 
> can tear down the pipeline.
>
>  Regards,
>  Arnout
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090202/977e8194/attachment.htm>


More information about the gstreamer-devel mailing list