Enable and Disable audio, video or subtitle dynamically

Sebastian Dröge sebastian at centricular.com
Tue Jul 12 06:27:38 UTC 2016


On Sa, 2016-07-09 at 03:09 -0700, DeepakRohan wrote:
> Hi,
>     I want to enable and disable audio, video and subtitle in an mkv file
> using gstreamer pipeline.
> My application creates pipeline in the below form.
> 
> gst-launch-1.0 subtitleoverlay name=overlay ! autovideosink filesrc
> location=Lucy.mkv ! matroskademux name=d d.video_0 ! queue ! decodebin ! 
> overlay.video_sink d.audio_0 ! queue ! decodebin ! alsasink d.subtitle_0 !
> queue ! overlay.subtitle_sink.
> Having the above pipeline, I want to perform disable and enable of the
> elementary streams present in the input.
> 
> Please let me know how to do this.

You will have to dynamically relink the pipeline then, that is use pad
probes to know when this can be safely done and then change the
pipeline topology. For the generic ideas behind this see:
https://coaxion.net/blog/2014/01/gstreamer-dynamic-pipelines/


Is there any reason why you don't want to use playbin? On playbin you
can enable/disable audio, video or subtitles by just setting the flags
property on it accordingly. Inside playbin/playsink you can also find
an implementation that you can use to understand what you need to do if
you want to implement this yourself.

-- 

Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160712/f6496680/attachment.sig>


More information about the gstreamer-devel mailing list