OMX.google.aac.en codeR不要在媒体codeC工作EN code PCM到AAC时媒体、工作、不要在、codeR

2023-09-07 09:59:12 作者:待我称帝便封你为后i

我使用在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.