I'm new here and fresh to Android development. Here is my first question here.
I'm using MediaExtractor
and MediaCodec
to play mp4
file, with video and audio. Now I get one pair of extractor/codec for video and another pair of extractor/codec for audio, realized in two separate threads.
My question is: can I use just one extractor with two codecs to play video and audio synchronously?
If yes, How to do it? When I used extractor.selecttrack for one, the other won't work...
Thanks a lot.
Thanks to everyone's answer here. I have figure this out. I made a mistake that the extractor can only select one track. Actually, you can select more than one track, and extractor.advance() will read each track at one time subsequently.
Thanks to everyone's answer here. I have figure this out. I made a mistake that the extractor can only select one track. Actually, you can select more than one track, and extractor.advance() will read each track at one time subsequently.