android camera sps,GitHub - zhoushuqiang/cameraMediaCodec: On Android platform, use MediaCodec to en...

cameraMediaCodec

On Android platform, use MediaCodec to encode camera preview data and decode it to surface after that.

For now, encoder part(capture+encoder+preview) is OK, decoder part(decoder+render) is OK. The test tool is the first step of a real-time video application, like "Skype".

The data flow of encoder part is like that: get yuv data from camera preview callback, restore it into a queue(FIFO). In another thread, call QueueInputBuffer to handle the queue and call DequeueOutputBuffer to get Avc buffer. The process speed of DequeueOutputBuffer is related with QueueInputBuffer, vise versa. If QueueInputBuffer is slow, DequeueOutputBuffer will be slow.

The data flow of decoder part is: in a thread, parsing the AVC buffer. If SPS/PPS found, restart the decoder. If not, call QueueInputBuffer to take away AVC buffer, and also call DequeueOutputBuffer to get raw video data.

For decoder part, need parse SPS/PPS ahead before calling configure, because we have to set "csd-0" and "csd-1" explicitly. Currently I call configure every time SPS/PPS with different picture size happens.

Make sure the preview callback return ASAP, for a high FPS. So don't handle input buffer directly in preview callback.

Make sure there is only one time buffer copy from camera to encoder.

There are two main features for a realtime application:

requested key frame

width/height/fps/bitrate config on the fly

Both support nearly perfect

New feature, but under testing:

support SVC encoder

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值