Currently I'm using the sample app from Sony developer of the action camera. This sample app connects to the action camera and get with HTTP packets the images. The images are in the payload of the HTTP and I'm able to draw them on a SurfaceView. What I'm trying to do is to get the frames from the SurfaceView and encode them in H264. I'm reading it can be done via MediaCodec but I'm a bit confused and the documentation is not explaining much. Any Mediacodec expert out here that can help me?
-
1Various examples here: https://github.com/google/grafika – fadden Mar 25 '15 at 15:39
-
Hi Fadden, which of the example is the most helpful for me? Also I see a lot GLSurfaceView, I'm drawing on a canvas with drawBitpmap. Do I have to swith my surfaceview to the GL one or I still can use it? Ty – Cloud57 Mar 25 '15 at 16:43
-
1You don't draw on the SurfaceView and then extract from the SurfaceView. You draw twice, once to the SurfaceView for display, once to a MediaCodec input Surface. Only one activity in Grafika uses GLSurfaceView, though it's probably the most relevant one, which is unfortunate because GLSurfaceView confuses things. However, GLSurfaceView is just a wrapper of functions around SurfaceView -- you can draw on any Surface with GL or Canvas (but not both at once). You will be able to get higher frame rates with GL rendering; not sure if that's important for what you're doing. – fadden Mar 25 '15 at 16:50
-
The scenario is: Sony Camera liveView -> Smartphone decode and render the liveView on surfaceView with canvas (it's not already h264)-> Smartphone encode in h264 with mediacodec and feed a client RSTP with the encoded stream wich will be sent to wowza – Cloud57 Mar 26 '15 at 08:37
2 Answers
You might want to try Intel INDE Media for Mobile, it has GLCapture class which accepts textures, encodes them and packs to stream, it has built-in streaming to WOWZA server
Tutorials are here: https://software.intel.com/en-us/articles/intel-inde-media-pack-for-android-tutorials
Samples are on github: https://software.intel.com/en-us/articles/intel-inde-media-pack-for-android-tutorials
There are samples for game capturing, but it should be easy to change it to switch from drawing game scenes to coping bitmap from camera to texture.

- 1,473
- 11
- 13
-
1great! please feel free to write to m4m@intel.com in case you have some more questions on M4M or have feedback\suggestions – Marlon Mar 27 '15 at 15:57
Please go through the EncodeDecodeTest.java of [this][1]
[1]: http://bigflake.com/mediacodec/ and [grafica] [1]
[1]: https://github.com/google/grafika , this will help you to do this.usually sony devices has some color format issues that you have to take care

- 1,399
- 12
- 22