Flushing the data in partial pipeline

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Flushing the data in partial pipeline

Baby Octopus
Hi,

I need to stream files one after. My pipeline looks like this

filesrc1 ! decodebin1 ! ----
                                    |
                                     -----> input-selector ! x264enc ! udpsink
                                    |
filesrc2 ! decodebin2 ! ----

filesrc + decodebin combo is created based on playlist size

The problem that filesrc2 should not be played from the beginning. It should playback somewhere from the middle. I can not handle seek on filesrc2 unless I set it to paused/playing. The moment I set it to playing, I'll have content from both the sources getting mixed in the pipeline and flushing becomes harder

Is there a way to flush something like only one part of segment, i.e., only initial data of filesrc2 which is prerolled?

Thanks a ton in advance

~BO
Reply | Threaded
Open this post in threaded view
|

Re: Flushing the data in partial pipeline

Nicolas Dufresne-5
Le mercredi 15 février 2017 à 07:26 -0800, Baby Octopus a écrit :

> I need to stream files one after. My pipeline looks like this
>
> filesrc1 ! decodebin1 ! ----
>                                     |
>                                      -----> input-selector ! x264enc
> !
> udpsink 
>                                     |
> filesrc2 ! decodebin2 ! ----
>
> filesrc + decodebin combo is created based on playlist size
>
> The problem that filesrc2 should not be played from the beginning. It
> should
> playback somewhere from the middle. I can not handle seek on filesrc2
> unless
> I set it to paused/playing. The moment I set it to playing, I'll have
> content from both the sources getting mixed in the pipeline and
> flushing
> becomes harder
>
> Is there a way to flush something like only one part of segment,
> i.e., only
> initial data of filesrc2 which is prerolled?
Yes, this is what is being done in GES/nlesource. nlesource is a GstBin
that wraps uridecodebin and that run has a seek thread. It installs
blocking probe on the internal change, on it's callback, it will
operate a seek in it's thread (cannot be done on the streaming thread).
The rest of the code has the purpose of making sure the playback
position is correct even though there was a seek and some other stuff.
It's in general very complex. I suggest to install GES for that. You
can then use it directly, or if you need more pipeline control, you
could use NLE elements, I believe they are installed.

https://cgit.freedesktop.org/gstreamer/gst-editing-services/tree/plugin
s/nle/nlesource.c
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Flushing the data in partial pipeline

Baby Octopus
Thanks a ton for your reply. I pretty much had the same implementation in mind

How does one use nlesource element? I thought its more like nlesource location=/root/input.mp4 ! decodebin ! ..... But it doesn't seem to be that way

I tried exactly what nlesource does
1. Create a bin with demuxer
2. When 'sometimes' src pad is created in demuxer, create a blocking probe
3. In probe callback spawn a thread which does the flushing seek. Once seek is done, remove the probe

The seek does return a success but downstream element mpegtsmux seems to have *no Caps* in its sink pad in collected buffer. *Is creating a blocking pad creating issue in caps fixation?*

Thanks in advance

~BO
Reply | Threaded
Open this post in threaded view
|

Re: Flushing the data in partial pipeline

Nicolas Dufresne-5
Le jeudi 16 février 2017 à 01:42 -0800, Baby Octopus a écrit :
> How does one use nlesource element? I thought its more like nlesource
> location=/root/input.mp4 ! decodebin ! ..... But it doesn't seem to
> be that
> way

Well, in fact, you should probably use urinlesource. Note that
nlesource will handle one stream only, so if you want both audio and
video, you'll need multiple nlesource.

"nleurisource uri=file:///path/to/vid.ext inpoint=<seek_start_ns> duration=<in_ns> caps="video/x-raw" ! ..."

Note that I think the most recent version of nle is not usable in gst-
launch-1.0, and the parameters are not commited. You must commit the
nlsource state using the action signal "commit"
(g_signal_emit_by_name(...)). I have not followed the development
lately, so other changes may have happen. nlesources are generally used
inside an nlecomposition bin. NLE is considered unstable, hence the
element API and ABI may still change. It was forked from GNL for this
reason, but GNL has been abandoned.

regards,
Nicolas

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (188 bytes) Download Attachment