How do I feed H.264 NAL units to Android MediaCodec for decoding?

后端 未结 2 509
甜味超标
甜味超标 2021-02-02 03:18

I\'m trying to figure out how to use Android\'s MediaCodec class to decode H.264 video. To start, I\'m trying to manually parse the NAL units out of an H.264 file and feed them

2条回答
  •  死守一世寂寞
    2021-02-02 03:56

    AFAIK you need to take the header out as well as feed it with SPS/PSS as first buffers, But getting -1 is not a big deal it will be a normal behaivour. Some devices will crash if they are not feeded by SPS/PPS before the other NALs

提交回复
热议问题