Playing Multiple Files via decodebin?

Stirling Westrup swestrup at gmail.com
Fri Jan 4 07:46:03 PST 2013


I spent most of yesterday reading through a very tedious debug output
of my application and its major components, and it looks like filesrc
does send a new-stream message and that decodebin does correctly
reconfigure itself internally.

The bug appears to be that decodebin creates new pads and I mess up
somewhere in the logic where I uncouple the old pads and reattach my
outputs to the new pads. Somehow the re-attached outputs never get the
right state, despite me trying to set them.

Anyway, I know what to look into now. Thanks for the help.

On Fri, Jan 4, 2013 at 4:42 AM, Paul d'AUBIGNY <visechelle at gmail.com> wrote:
> Hi Stirling,
>
> When setting the location property of filesrc for your next file, decodebin
> will not to renegotiate the new video format, it does not update elements
> inside (as far as I know). Therefore, it will not support the new format and
> I think that why you got a 'not negotiated'. In addition, letting the EOS
> event going through your pipeline elements might lead to resource
> deallocation, therefore even if the video files formats are the same, I
> suspect it might not work.
> One solution that I have in mind, is to use an event probe on decodebin
> srcpad. Inside the callback function of this event probe, you can detect EOS
> event, update filesrc location property, remove decodebin element and
> replace it with a new one just created, add the event probe to decodebin src
> pad in order to detect EOS for the next file and link all elements together.
> That should make it.
>
> You can find details about changing the pipeline elements dynamically here:
> http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-dynamic-pipelines.html
>
> Cheers,
>
> Paul HENRYS
>
> 2013/1/3 Stirling Westrup <swestrup at gmail.com>
>>
>> I have an application that tries to run through a playlist of multiple
>> video files of differing formats, playing each in turn.
>>
>> I am using filesrc ! decodebin for this, but my application dies with
>> a 'not negotiated' when changing from one file to the next.
>>
>> What should my behaviour be on EOS to switch to the next video in the
>> playlist?  Currently I do this:
>>
>> 1) Detect EOS
>> 2) Quit main_loop.
>> 3) set pipeline to "Ready"
>> 4) set filesrc's location to the next file name in list
>> 5) set pipeline state to 'Playing'
>> 6) enter main_loop
>>
>> Is there some major step I'm missing here, or is it more likely that
>> I'm messing up one of the above steps?
>>
>>
>> --
>> Stirling Westrup
>> Programmer, Entrepreneur.
>> https://www.linkedin.com/e/fpf/77228
>> http://www.linkedin.com/in/swestrup
>> http://technaut.livejournal.com
>> http://sourceforge.net/users/stirlingwestrup
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>



-- 
Stirling Westrup
Programmer, Entrepreneur.
https://www.linkedin.com/e/fpf/77228
http://www.linkedin.com/in/swestrup
http://technaut.livejournal.com
http://sourceforge.net/users/stirlingwestrup


More information about the gstreamer-devel mailing list