MediaCodecAudioDecoder can not play HE-AAC encoded file.
Reported by
cwhong...@gmail.com,
Dec 5 2017
|
||||
Issue descriptionSteps to reproduce the problem: 1. Go https://www2.iis.fraunhofer.de/AAC/multichannel.html 2. Play any AAC-HE stream What is the expected behavior? Play well What went wrong? Can't play. Did this work before? N/A Does this work in other browsers? N/A Chrome version: Channel: n/a OS Version: All Flash Version: Hi all. I tried play he-aac stream on this page(https://www2.iis.fraunhofer.de/AAC/multichannel.html), but failed to decode when I use MCAD. Of course I modified default_renderer_factory.cc to create external decoder(i.e., MojoAudioDecoder -> MCAD finally) to make web engine to use MediaCodec and do not create FFmpegDecoder. I know you guys use MCAD for only EME but I have to use MediaCodec always, not FFmpeg, for some reason. I've been digging this problem and I think I found the wrong csd(codec specific code) is sent to MediaCodec in configuration. In ConfigureMediaFormatForAudio() kCodecAAC case in media_codec_bridge_impl.cc, ... csd[0] = profile << 3 | frequency_index >> 1; csd[1] = (frequency_index & 0x01) << 7 | channel_config << 3; ... that part always make the current stream AAC-LC stream even if stream is HE-AAC profiled stream. I think this mistake come from this patch(https://chromiumcodereview.appspot.com/16114009). It introduces some code for extracting information from extra data in packet(or frame?). The code copied from aac.cc that parses base frequency, channel config, extension freq and sort of things. But it was wrong because information was cut. I'll upload patch that remove code that modifying information wrong and just pass-through the extra_data as is to MediaCodec. Other uestions: 1. How can I test EME on mobile device? 2. Is there any EME contents encoded in various codec profiles (like he-aac he-aac-v2)? Are there test cases in chromium?
,
Dec 6 2017
Assigning to xhwhang@ for triage as it seems that the reporter is using MojoAudioDecoder. I'm not sure if this is something we ought to support though.
,
Dec 6 2017
cwhong893: Thanks for looking into this! It seems the root issue is in the demuxer side, not in MCAD then. If you can upload a CL for review it'll be appreciated! To test this, feel free to add a test case in https://cs.chromium.org/chromium/src/media/filters/audio_decoder_unittest.cc You don't need MojoAudioDecoder or EME to do this test. Actually I saw a he-aac test there using MCAD, can you help check why we don't see issues in that test? https://cs.chromium.org/chromium/src/media/filters/audio_decoder_unittest.cc?rcl=f4e2e65212a72810646656c41e68b359c426fa0d&l=441 For your follow up questions, you can test EME on https://shaka-player-demo.appspot.com/demo. We don't have detailed EME test with different codecs, because decryption and decoding are mostly independent.
,
Dec 6 2017
,
Dec 8 2017
Thank you guys for helping me clarification. @xhwang: Nice test case! Thanks. I'll debug based on test case you told me. I thought demuxer is right and media_codec_bridge_impl.cc is wrong, because when I just pass-through extra_data(that from demuxer) on ConfigureMediaFormatForAudio() to the Java_MediaCodecBridge_setCodecSpecificData() then playing he-aac stream is played well. Yeah, it was naive test but hint for us. I'll investigate more, but actually I'm not codec expert guy thus I need some more time and your helping. Thank you. |
||||
►
Sign in to add a comment |
||||
Comment 1 by sandeepkumars@chromium.org
, Dec 6 2017Labels: Needs-triage-Mobile Needs-Feedback Triaged-Mobile