简体   繁体   中英

Getting frames from SurfaceView and decode in H264 with mediacodec

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?

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.

在此处输入图片说明在此处输入图片说明

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM