I created a video player using MediaCodec
and MediaExtractor
, but when I try to change the media position using MediaExtractor
seekTo
method it is really slow (took 10 seconds to seek for a 1080P video) while the SDK MediaPlayer
can seek in real-time. Any idea to fix this?
MediaExtractor extractor = new MediaExtractor();
extractor.setDataSource(SAMPLE);
.
.
.
extractor.seekTo(480000000, MediaExtractor.SEEK_TO_CLOSEST_SYNC);
Update
Theo original project is here
I've found the bug that caused the seeking to be slow. It was the sync clock used for maintaining media FPS.
I've just uploaded the new working project with the following features:
https://github.com/mafshin/MediaCodecDemo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With