0

How can I switch between audio tracks in a video using PyGST, but without using playbin2? I'm using this pipeline, but I have no idea about how to select a specific audio stream in the video and connecting it to the audiosink:

uridecodebin name=pipe1 pipe1. ! videobalance name=balance ! textoverlay name=text ! xvimagesink name=videosink pipe1. ! volume name=volume ! autoaudiosink name=audiosink

Any example would be useful. Thank you

joar
  • 15,077
  • 1
  • 29
  • 54
ov1d1u
  • 958
  • 1
  • 17
  • 38

1 Answers1

0

Instead of "pipe1. ! volume name=volume ! autoaudiosink name=audiosink" you can write pipe1.srcXX ! volume name=volume ! autoaudiosink name=audiosink" where XX is the pad you want to connect to. You will need to listen to newly added pads with a signal handler and ideally connect them all to an input-selector. This you can then use to switch tracks.

ensonic
  • 3,304
  • 20
  • 31