Skip to content
Advertisement

Tag: android-mediacodec

Out of order BufferInfo.presentationTimeUs timestamps in mediacodec decoder

I am getting irregular newBufferInfo.presentationTimeUs because of which if I put Thread.sleep to slow down the playback, a lot of frames are dropped. Actually, with Surface the frames timestamps are synchronized automatically with system timestamp without sleep, however it does not work with giving output to OpenGLES. https://developer.android.com/reference/android/media/MediaCodec#releaseOutputBuffer(int,%20long) I thought mExtractor.getSampleTime() is the problem but even after removing it, the

Rendering same video to 2 Surfaces from a MediaCodec

MediaCodec has 2 ways of operating: you either pass a Surface for it to render to, or you read the output buffer and paint it to the screen yourself. In the first case, where I pass a surface: is it possible to paint the same MediaCodec decoded video to 2 surfaces? The decoding loop looks something like this: Answer The

Advertisement