force i-frame when using mediacodec with createInputSurface

微笑、不失礼 提交于 2019-12-11 01:26:52

问题


is it possible to trigger the encoder to send i-frames when using a surface as the input ? I know its possible when when queuing input buffers, but I didnt find a way to do so when using createInputSurface .


回答1:


You can't set flags on the buffers. This also affects BUFFER_FLAG_END_OF_STREAM, but for that you have the signalEndOfInputStream() call.

I frames will be sent every KEY_FRAME_RATE * KEY_I_FRAME_INTERVAL buffers. (I don't know how firm that is -- I suspect they might appear more or less often in practice.)



来源:https://stackoverflow.com/questions/22987816/force-i-frame-when-using-mediacodec-with-createinputsurface

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!