How to use MediaCodec without MediaExtractor for H264

前端 未结 2 1688
一向
一向 2020-11-29 21:22

I need to use MediaCodec without the MediaExtractor and I\'m reading the file using a FileInputStream. Currently it is not working, it is showing a greenish scrambled image

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-29 21:41

    I'm assuming you're reading a raw H.264 elementary stream and not an MP4 file.

    It looks like you're feeding fixed-size blocks of data to the decoder. That doesn't work. You need to put a single access unit into each buffer.

提交回复
热议问题