OMX.google.aac.en codeR不要在媒体codeC工作EN code PCM到AAC时 [英] OMX.google.aac.encoder do not work in MediaCodec when encode pcm to aac

查看:2000
本文介绍了OMX.google.aac.en codeR不要在媒体codeC工作EN code PCM到AAC时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用在Android 4.1媒体codeC编码的WAV文件的PCM音轨成AAC,我的S3,有两个连接codeRS,OMX.google.aac.en coder和OMX。 SEC.aac.enc,第一个是使用,如果调用createEn coderByType,但它不能正常工作,输出无法播放(没有声音),如果调用createBy codecName与OMX.SEC .aac.enc,它的工作原理。虽然我的HTC ONE,只有OMX.google.aac.en codeR,并不起作用。我想我的code没有问题,因为它是从谷歌复制,以及第二EN codeR作品。

I am encoding pcm track of wav file into aac using MediaCodec on Android 4.1, on my S3, there are two encoders, OMX.google.aac.encoder and OMX.SEC.aac.enc, the first one is used if call createEncoderByType, but it does not work, the output can't be played(has no sound), if call createByCodecName with "OMX.SEC.aac.enc", it works. While on my HTC ONE, there is only "OMX.google.aac.encoder", and does not work. I think my code has no problem, because it was copied from google, and the second encoder works.

顺便说一句,我加ADTS头标到AAC流。

BTW, I added adts header to the aac stream.

推荐答案

在我的Nexus 5,媒体codec.createBy codecName()似乎从来没有带过codeRS的名称时工作(如由媒体codecList指定)。

On my Nexus 5, MediaCodec.createByCodecName() never seems to work when passing names of encoders (as specified by MediaCodecList).

这是我的Nexus的AAC EN $ C $ 5 CRS(4.4.4):

The AAC encoders on my Nexus 5 (4.4.4):

名称:OMX.google.aac.en codeR
类型:音频/ MP4A-LATM]

name: OMX.google.aac.encoder types: [audio/mp4a-latm]

名称:AACEn codeR
类型:音频/ MP4A-LATM]

name: AACEncoder types: [audio/mp4a-latm]

然而,这作品:

MediaCodec.createEncoderByType("audio/mp4a-latm");

请注意:奇怪的是,调用此方法时,日志显示:

Note: curiously, when calling this method the logs reveal:

A component of name 'OMX.qcom.audio.decoder.aac' already exists, ignoring this one.

这是一种奇怪的。

which is kind of odd.

因此​​,如果这是不是为你工作,那么它可能是在你执行EN codeR,而不是媒体codeC的创造。

So if this is not working for you, then it is probably in your implementation of the encoder rather than MediaCodec creation.

这篇关于OMX.google.aac.en codeR不要在媒体codeC工作EN code PCM到AAC时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆