1

I am trying to develop a simple application that show the video stream from an IP camera into a surfaceview. I am totally new to video decode/encode. In the last few days I have read a lot of information about mediacodec API and about how to implement it, but I can not find the right way. I still have to fully understand how buffers works and how depacketize the RTP packets from UDP and pass each frame to MediaCodec

I have a couple of Sony EP521 IP camera. From the CGI Command Manual I get that the cameras support Mpeg-4/H264 HTTP bit stream ("GET /h264...", the camera will send H.264 raw data as its response.) or RTP (UDP) bit stream.

My problem is that I do not know where to start:

  1. Which is the "best" way to implement this? (with best I mean the most reliable/correct but still easy way)
  2. Should I use HTTP bit stream or RTP?
  3. Are MediaCodec strictly needed or can I implement this in another way? (ie, android.media.mediaplayer class already support h.264 raw data over RTP (I do not if it actually does or not))
  4. How can I extract the video data from an HTTP bit stream?

I know that there are a lot if similar question, but no one seems to fully answer my doubts.

The camera also support MJpeg. This would be easier to implement, but for the moment I do not want to use MJpeg encoding.

Here the Camera CGI manual: http://wikisend.com/download/740040/G5%20Camera%20CGI%20manual.pdf

Thank you, and sorry If already been discussed.

rastabob
  • 63
  • 1
  • 1
  • 5
  • Possibly related: http://stackoverflow.com/questions/10736517/playing-video-on-textureview – Morrison Chang Feb 04 '15 at 19:20
  • Also possibly of interest: 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 Feb 05 '15 at 17:59

0 Answers0