5

Am doing a project on live video broadcasting.

On sender side, am capturing the video using an android phone, getting the H264 frames and packetising them into RTP packets following the respective RFCs ->RFC 3984. The sending side has no issues. the stream is received and played by VLC.

On the receiver side, again an android mobile. i got the RTP packets successfulyy. its a RTP stream that contains H264 Dynamic Payload. i want to unpack this stream and decode it and render it on the receiver side using android mediacodec API. Somebody please guide me on how to realise this.

thank you.

Ravi
  • 371
  • 6
  • 11
  • Are you otherwise able to play back an H.264 stream on a device? i.e. is this a general "how do I play raw video" question, or something specific to your RTP use case? – fadden Dec 17 '13 at 15:51
  • am not able to playback the data am receiving... I dunno how to do it.... you can take it as both kind of question and guide me please – Ravi Dec 18 '13 at 04:00
  • There are a number of examples on http://bigflake.com/mediacodec/. You could try something like `ExtractMpegFramesTest`, but feed it NAL units from your network rather than using `MediaExtractor`. You'll need to feed it SPS/PPS somehow (possibly related: http://stackoverflow.com/questions/20077240/). – fadden Dec 18 '13 at 06:14

2 Answers2

1

You will need to depacketize by putting in the parameter sets and the correct nalu header. This is relatively simple bar little documentation and i cannot share my code for this but i can share my hardware android decoder stuff which is in a previous post:

MediaCodec crash on high quality stream

This is all you need to do to decode h.264 in realtime android does the rest.

Community
  • 1
  • 1
redbrain
  • 162
  • 2
  • 11
0

You need to depacketize the RTP packets from UDP and pass each frame to MediaCodec if you set a videoview for your MediaCodec you will have render what you get, This is what I will try to do will update you with the results

hamed
  • 11
  • 1