简体   繁体   中英

Gstreamer change source on PLAYING state

Hello guys I wanna know how can I switch between different sources in my pipeline without changing state for example if I have :

Source 1

 filesrc location=file1 ! decodebin ! autovideosink

Source 2

 filesrc location=file2 ! decodebin ! autovideosink

Source 3

 filesrc location=file3 ! decodebin ! autovideosink

I want to accomplish something like switching between channels on TV. Is it possible to change location property dynamically ? I searched over and over and didn't found anything specific.If you could point me to some code examples C or python I would be grateful.

You cannot change filesrc location dynamically, alternatively you can change your logic a bit, Instead of filesrc use a fdsrc and write a separate application which reads data from your file1 and pumps to fdsrc's fd. so when you want to switch from file1 to file2/file3 you just need to tell your application to start pumping data from file2/file3 instead.

Hope that helps!

IMO your best bet is just to kill the old process and start a new one.

In a long running scenario on a diverse file set you'd be counting on a wide variety of GStreamer elements to reliably clean themselves up.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM