python-3.xaudiogstreamervorbislamemp3

How to change the bitrate of audio encoding in Gstreamer in the PLAYING state?



To my knowledge, changing the bitrate while playing is actually not possible with these codecs.

But I guess there are clean and simple ways to change the bitrate without introducing any gap in the stream: I'd like to learn about any of them.

(NB: I did write any, not all, I am not asking for the "best" way, I am not asking for a review, I just want something that works.)


Solution

  • Read through this ..

    You will:

    You can inspire yourself with the example from the link above.. However you are not doing any removing and adding new elements.. Do not forget to set it to NULL state as it will discard all internal states (well hopefully if its not buggy). Then You would just change the parameters with g_object_set...

    Also I never did this so you may also ask on IRC of #gstreamer at freenode if you are stuck or not sure.

    HTH