Does MediaCodec in Android support audio encodec?

ε祈祈猫儿з 提交于 2019-12-23 05:28:08

问题


I am trying to build a video system. I get the data from Camera through Preview, then I give the data to Mediacodec and let it do the video encoding job. Now I am focus on the audio part. I am not sure which API to use for the audio caperture and audio encoding.

I've done some search. But it seems that most of the demos use MediaRecord. Since I've replaced the MediaRecord with MediaCodec, I think I need to find some new way to do the audio part. How to capeture the audio? Can MediaCodec do audio codec?

Thank You!


回答1:


Yes. The MediaMuxerTest demonstrates using two MediaCodec encoder instances (one for audio, one for video) and MediaMuxer to "clone" a movie file.

Note the audio/mp4a-latm MIME type is used for audio.



来源:https://stackoverflow.com/questions/20835655/does-mediacodec-in-android-support-audio-encodec

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