1

everyone. How i can do this if i take frame by frame stream video by server, I have PPS and SPS, and configure mediaCodec with this parametrs, also I have width and height. I'll glad any help.This example how id did it.

Mediacodec, decode byte packet from server and render it on surface

Community
  • 1
  • 1
a23sokolov
  • 603
  • 3
  • 11
  • Possibly useful: http://stackoverflow.com/questions/13307086/decoding-raw-h264-stream-in-android and http://stackoverflow.com/questions/19742047/how-to-use-mediacodec-without-mediaextractor-for-h264 – fadden May 14 '15 at 15:52
  • @fadden U say that "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." but how i should detect that first sample end and start second sample? if u can take some code like in second link. I tried the same project, but it works fine only with MediaExtractor, If u explain how did with mp4 file on phone. I think i can do the same with server frames. – a23sokolov May 15 '15 at 05:38
  • If you're receiving an H.264 stream you'll need to parse the NAL units yourself. See e.g. http://stackoverflow.com/questions/23516805/h264-nal-unit-prefixes for information on the format. – fadden May 15 '15 at 15:23

0 Answers0