Reputation: 13
hi,I try to use Android MediaCodec to encode. I follow the code of "grafika", but I find the encode video drop some frames. I check my input, every frame is different from each other, but in my encode output video, for example, frame 71 is same to frame 72, frame 99 is same to frame 100. the other frame is same to the input sequence.
I use OpenGL ES, and use surface in encode. My frame rate is 30, bitrate is 1920*1080*30, and Iframe intervel is 1s.
Anything wrong with mediacodec encode?
Upvotes: 0
Views: 579
Reputation: 451
If you are sending your frames to the encoder via a Surface, you may need to pass along (separately) the correct presentation times for each frame as the encoder may not get the right presentation times. In other words, after you pull an output buffer from the MediaCodec, you may want to correct the value of presentationTimeUs for the output buffer info.
Upvotes: 2