I am trying to develop a media player application in android. I am using dolphin player’s code as reference. But i don’t know how to change the audio and subtitle track on the fly while playing a video . using command line of ffmpeg it’s possible but how to do it with ffmpeg c++ code?
Share
Video file is a container that have a bunch of streams. First, you have to open video file and extract streams information (error checking avoided for smaller code):
Now you can iterate streams and find all audio streams:
Select which stream you would like to play and get a pointer to the codec and open it:
Decode the stream as usual after that.