简体   繁体   中英

android mediacodec: real time decoding h264 nals

I'm trying to decode h264 nals in real time with android low level media api.
Each nal contains one full frame, so i expect that after feeding input with my nal and calling dequeueOutputBuffer it would "immediatly" (with the litle delay of course) display my frame but it doesn't. I see the first frame and the dequeue returns the first buffer only afer feeding the decoder with the second one which at this time should render the second frame. Frames are encoded with zerolatency preset of x264 so no b-frame etc...

I guess that there might be a way to set the encoder to render the frame immediatly after it got it but i couldn't find any good documentation/explanations on that. Any suggestion?

Just because frames are encoded with zero latency setting does not mean they will be decoded with zero latency. Two seperate things. So depending on codec level (resolution, bitrate, framerate) and profile you may have to decode upto 16 frames of h264 video to get aframe out.

只有在解码前帧之后才能解码p帧

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM