MP uses AAC audio decoder for MKVs and MP4s! (1 Viewer)

damaster

Portal Pro
November 23, 2007
412
35
Canada Canada
TV-Server Version: 1.0
MediaPortal Version: 1.0 SVN 21688
MediaPortal Skin: StreamedMP
Windows Version: Windows Vista
CPU Type: AMD X2 6400+
HDD: WD SE16 500GB, Samsung SpinPoint 1TB
Memory: 2GB DDR2 800
Motherboard: Gigabyte GA-MA69GM-S2H
Video Card: ATI Radeon HD 3470
Video Card Driver: Catalyst 9.1
Sound Card AC3: Realtek HDMI Audio
1. TV Card: Hauppauge Nova-S Plus
1. TV Card Type: DVB-S
MPEG2 Video Codec: MPC - Mpeg2 decoder
MPEG2 Audio Codec: AC3Filter
h.264 Video Codec: PowerDVD 8 H.264/AVC/VC1 decoder
Satelite/CableTV Provider: Nimiq 82W, Nimiq 91W
HTPC Case: nMedia 2000B
Cooling: Scythe Mini Ninja
Power Supply: Corsair 450VX
Remote: Home Theater Master MX-700
TV: Panasonic 58" TH-58PZ800U
TV - HTPC Connection: HDMI

I recently updated to MediaPortal 1.0 and SVN 21688 and noticed that my 720p/1080p MKVs were not using the right audio decoder. I dug through the source code and discovered that for some very strange reason in VideoPlayerVMR9.cs the decoder configured for AAC audio is being used if the video file has .mkv or .mp4 extension.

This is ridiculous in my opinion and I don't understand how this got approved as a valid code change! MKV containers are not limited to AAC audio, and more often than not contain multi-channel AC3 or DTS audio. My AC3/DTS passthrough decoder of choice is AC3Filter but now I can't use it because it doesn't register as a valid AAC decoder and thus I can not select it in MediaPortal configuration!

Here is the section of code that I feel is wrong:
Code:
          if (extension.Equals(".mp4") || extension.Equals(".mkv"))
          {
            if (strH264VideoCodec.Length > 0)
            {
              h264videoCodecFilter = DirectShowUtil.AddFilterToGraph(graphBuilder, strH264VideoCodec);
            }
            if ([B]strAACAudioCodec[/B].Length > 0)
            {
              aacaudioCodecFilter = DirectShowUtil.AddFilterToGraph(graphBuilder, strAACAudioCodec);
            }
          }
UPDATE: This is clearly a bug that is causing problems for many folks and leaving them unable to play audio with their MKV files. As a result I am including a patch for the current SVN until this gets fixed in the official stream.

Attached is a patch for SVN 21688.
 

jacc1234

Portal Pro
April 11, 2008
167
7
Good catch. Is the same issue present with EVR? This is a fairly significant bug either way because the only way I can get perfect 1080p playback is by using AC3 filter for 5.1 audio.
 

damaster

Portal Pro
November 23, 2007
412
35
Canada Canada
Good catch. Is the same issue present with EVR? This is a fairly significant bug either way because the only way I can get perfect 1080p playback is by using AC3 filter for 5.1 audio.
This issue is independent of the renderer, so yes it happens with EVR and VMR. I am using EVR.

Ideally MP should choose the right decoder by looking at what is actually within the MKV container and not based solely on the file extension. For example, if it finds that the primary audio track is AC3/DTS multi-channel then it should use the general decoder configured for audio, but if it finds AAC audio only then should it use the decode configured for AAC audio.
 

tourettes

Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Ideally MP should choose the right decoder by looking at what is actually within the MKV container and not based solely on the file extension. For example, if it finds that the primary audio track is AC3/DTS multi-channel then it should use the general decoder configured for audio, but if it finds AAC audio only then should it use the decode configured for AAC audio.
    Most likely MP 1.0.x isn't going to get any bigger graph building related changes. What I see is that we shouldn't use any specific audio codecs for my videos playback but instead let directshow chose the correct codec based on the filter merits.

    MPII is a different case where the player framework will be re-written and one possibility would be to allow users to chose codecs on stream type basis (no locked down plans have been made yet).
     

    damaster

    Portal Pro
    November 23, 2007
    412
    35
    Canada Canada
    Ideally MP should choose the right decoder by looking at what is actually within the MKV container and not based solely on the file extension. For example, if it finds that the primary audio track is AC3/DTS multi-channel then it should use the general decoder configured for audio, but if it finds AAC audio only then should it use the decode configured for AAC audio.
    Most likely MP 1.0.x isn't going to get any bigger graph building related changes. What I see is that we shouldn't use any specific audio codecs for my videos playback but instead let directshow chose the correct codec based on the filter merits.

    MPII is a different case where the player framework will be re-written and one possibility would be to allow users to chose codecs on stream type basis (no locked down plans have been made yet).
    Back to the original issue: do you agree that it's a bug? MP shouldn't be using the AAC decoder for MKV and MP4 files, right? In my opinion, that's just wrong...
     

    Owlsroost

    Development Group
  • Team MediaPortal
  • October 28, 2008
    5,539
    5,037
    Cambridge
    United Kingdom United Kingdom
    Country flag
    Looking at the SVN change log - SourceForge.net Repository - [mediaportal] Log of /trunk/mediaportal/Core/Player/VideoPlayerVMR9.cs - looks like it was changed in response to this bug "mantis 1892: MKV videos with AAC audio may not play with sound using the internal player." on Dec 24th

    It does seem an odd thing to do for a 'universal' container format like MKV - I use MKV with MPEG-2 video and MPEG/AC3/LPCM audio so I can have files with chapter points e.g my own HDV camcorder footage.

    Tony
     

    damaster

    Portal Pro
    November 23, 2007
    412
    35
    Canada Canada
    Looking at the SVN change log - SourceForge.net Repository - [mediaportal] Log of /trunk/mediaportal/Core/Player/VideoPlayerVMR9.cs - looks like it was changed in response to this bug "mantis 1892: MKV videos with AAC audio may not play with sound using the internal player." on Dec 24th

    It does seem an odd thing to do for a 'universal' container format like MKV - I use MKV with MPEG-2 video and MPEG/AC3/LPCM audio so I can have files with chapter points e.g my own HDV camcorder footage.

    Tony
    Agreed about MKVs being quite a universal container in which the audio encoding is irrelevant to the actual container. This is why I feel like this change is very silly. I bet MKVs with AAC audio are a very small minority of the MKVs out there.

    Anyways, I've fixed it by patching my own install, but this bug really needs to get resolved.
     

    ronilse

    Retired Team Member
  • Premium Supporter
  • July 19, 2005
    4,422
    282
    Moss
    Norway Norway
    Country flag
    Hi,
    I'm not able to reproduce this, so which splitter do you use for mkv's (I use Matroska)?

    Regards
    Roy
     

    damaster

    Portal Pro
    November 23, 2007
    412
    35
    Canada Canada
    Hi,
    I'm not able to reproduce this, so which splitter do you use for mkv's (I use Matroska)?

    Regards
    Roy
    I use Matroska splitter, and here's how to reproduce:
    - In MP Configuration, under Videos -> Video Player: set AC3Filter as the "MPEG / AC3 audio decoder". Set ffdshow audio decoder as the "AAC audio decoder".
    - In MP, play an MKV with an AC3 or DTS audio track.
    - Open up GraphEdit, and connect to remote graph. You will see that instead of AC3Filter being used ffdshow will instead be used.

    It's quite clear cut in the code, but you can test it to confirm anyways.
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    toricred Using TMM, How to Stop Importer From Going to The Movie Database for Data General 1
    morpheus_xx [WiP] OnlineVideos: New browser based playback support using WebDriver, new Amazon siteutil MediaPortal 2 6
    toricred [solved] Configuring TV Server to use NAS General 1
    vvulture Using Windows 10 MediaPortal 1 Talk 8
    atlantic How to use Spotify inside Mediaportal? Listen Music 18
    Megane Too much RAM used (over 2 GB). General Support 18
    doskabouter 1.23.0 MatroskaTagInfo uses the wrong casing for tags Bugreports 27
    D how to disengage from one version of a plugin to use another Newcomers Forum 0
    D I just installed MP 1.23. Which version of Schedules Direct should I use, where do I obtain it from Newcomers Forum 6
    M Can i use my Vu+ Zero 4k Tuner for Mediaportal? General 0
    benicehavefun Using MePo TV Server 1.23 via MPExtended/WebMediaPortal as a Backend for Plex MPExtended 4
    G MP1 TV Server "failed to upgrade the database" using MS Sql Server Installation, configuration support 3
    1gkar Use Alternative Sites to Scrape Series Info My TVSeries 5
    T Can Emprex 3009ARF III MCE Remote Control be used to toggle Fullscreen/Windowed mode?? Remotes 7
    S [solved] Live TV subtitle issue if not using 100% font General 31
    N [Proposal] Make text input using remote control easier MediaPortal 2 4
    T Issues with MediaPortal not starting correctly using versions after 1.20 Final General Support 6
    erika jandova Using SD and MediaPortal 1 Newcomers Forum 4
    D Large xml database in My Movies Management. I remain unclear on use My Films as bridge to MP2.2 General 9
    N [solved] When MP2-Client is trying to register credentials, it uses the wrong machine name MediaPortal 2 7
    high [Help Me!] Atlassian Fisheye/Crucible still used? Team Lounge 8
    D [solved] HID remote for mp2 and w10 64 bit? using all tools: sony, cisco, homeworkx ng General 2
    Symphy Still being used? ASIO music player 0
    P no signal when scanning for channels using antenna and dual hd General Support 2
    N Using mediaportal in lieu of hauppauge wintv Newcomers Forum 10
    Similar threads

























    Top Bottom