Memory leak in MPC HC codec? (1 Viewer)

Spaldo

MP Donator
  • Premium Supporter
  • May 7, 2008
    495
    12
    FlashFXP Development Team
    Home Country
    Is anyone able to fill us in as to what exactly the bug is and what the filter does ?

    I am interested in trying to see if we can find an alternative, etc.
     

    damaster

    Portal Pro
    November 23, 2007
    412
    35
    Home Country
    Canada Canada
    Is anyone able to fill us in as to what exactly the bug is and what the filter does ?

    I am interested in trying to see if we can find an alternative, etc.

    Not sure what you're asking here. I've already made it quite clear what the bug is, but here's another way of explaining it:
    With every invocation and usage of the MPC Video Decoder in DXVA mode to play a video it uses up a certain amount of memory, let's say X bytes. When the video is stopped, it should release those X bytes that were previously allocated, however it does not. It only releases Y bytes where Y < X. As a result, you have a leak of (X - Y) bytes. As one continues to play N movies, that leak grows, such that the MediaPortal.exe process now uses N * (X - Y) additional bytes of memory, which are wasted because they were never properly de-allocated. The problem here is that the value of (X - Y) is rather large and so after playing about 16 1080p videos in DXVA mode, N * (X - Y) reaches nearly 1GB! Note that in software decoding mode this is not a problem at all and (X - Y) is so tiny it is negligible or Y = ~X.

    What does the filter do? It is a free H.264/AVC/VC1 DirectShow video decoder that supports DXVA (hardware acceleration) and is thus an excellent choice for playing 720p/1080p H.264 encoded videos on most modern ATI/Intel/Nvidia GPUs that have built-in support for hardware-based HD decoding. It also backs off to software decoding when/if the encoded video is not compliant with DXVA requirements, making it a very versatile DirectShow video decoder.

    What's the alternative? Use another DXVA-capable H.264 decoder such as the Cyberlink PowerDVD 8 decoders. The problem, however, with that decoder is that if a video isn't compliant to the DXVA requirements then the decoder can't play it and it locks up or results in distorted video. In other words, it isn't as lenient as the MPC decoder and does have a software-based back-off strategy.

    Or use an entirely software base decoder such as CoreAVC or ffdshow, but then that puts unnecessary load on the CPU, generates more heat, and more noise, etc. and doesn't make effective use of the GPUs that are very capable of easily decoding HD video.

    With hardware decoding, my CPU usage is below 1%, my GPU usage is 20-30% and my video is glitch-free and smooth as butter (this on Vista, with EVR and Aero enabled). I can run CPU-intensive work in the background and my 1080p videos won't drop a single frame.

    As I explained previously, this memory leak in the MPC decoder is a problem for anyone that keeps the MediaPortal.exe process running for long periods of time as it will run out of memory after playing a dozen or more 1080p videos with hardware acceleration.
     

    Spaldo

    MP Donator
  • Premium Supporter
  • May 7, 2008
    495
    12
    FlashFXP Development Team
    Home Country
    Ah ok, thanks for the post & explanation. Lets hope they do some work on it!

    I currently have quite a gfx card with hardware support, however, am using CCCP and I think it may be using ffdshow, etc.

    Do you have suggestions so that I can see what difference it makes trying to use hardware instead ? What I should install, etc
     

    Sh4nn0w

    MP Donator
  • Premium Supporter
  • September 14, 2006
    321
    23
    Home Country
    United Kingdom United Kingdom
    Using hardware means less load on your CPU.

    Try the MPC filter or PowerDVD trial if you want to see the difference. MPC filter works, just likely to cause problems with long term use, if you don't want to keep restarting Mediaportal/HTPC.
     

    damaster

    Portal Pro
    November 23, 2007
    412
    35
    Home Country
    Canada Canada
    Ah ok, thanks for the post & explanation. Lets hope they do some work on it!

    I currently have quite a gfx card with hardware support, however, am using CCCP and I think it may be using ffdshow, etc.

    Do you have suggestions so that I can see what difference it makes trying to use hardware instead ? What I should install, etc

    I would recommend you uninstall the CCCP pack and use the SAF pack available here: https://forum.team-mediaportal.com/...-55/standalone-filters-mediaportal-saf-44614/.

    You could also try following the install guide in my signature which details how to set things up for hardware decoding.
     

    Spaldo

    MP Donator
  • Premium Supporter
  • May 7, 2008
    495
    12
    FlashFXP Development Team
    Home Country

    damaster

    Portal Pro
    November 23, 2007
    412
    35
    Home Country
    Canada Canada
    I would recommend you uninstall the CCCP pack and use the SAF pack available here: https://forum.team-mediaportal.com/...-55/standalone-filters-mediaportal-saf-44614/.

    Thanks, I will uninstall CCCP and try something else.

    Out of interest, the latest version of DivX actually supports both xvid and mkv files now. Would this be a viable alternative ?

    That's a pure software decoder. I would still recommend MPC or PowerDVD 7/8 for hardware decoding.

    Now, let's get this thread back on topic please.

    I hope that it gets resolved too, although I must admit that for me it is not a problem that I would have easily noticed as the memory retention issue would not reflect my type of usage of MP. I imagine for those people, like yourself, whose stopping and starting of MP is quite minimal then the problem would manifest itself more often.

    Fingers crossed for you :)

    So it seems this issue is getting little or no attention over at the Doom9 forums :(

    Vimes, would you please also add a comment to the SourceForge forum?: https://sourceforge.net/forum/forum.php?thread_id=2994581&forum_id=583789

    Thanks
     

    Vimes

    MP Donator
  • Premium Supporter
  • January 19, 2009
    230
    33
    Earth, for now
    Home Country
    United Kingdom United Kingdom
    NP - I have left a comment there for you :)

    I think that it might take a little while to build up some positive action on this issue as not all people will be aware that there is a problem due to not using that particular filter in a way that you do within MP.

    Good luck though :)
     

    edterbak

    Portal Pro
    March 4, 2008
    2,114
    1,176
    Home Country
    Netherlands Netherlands
    @ Damaster: I just registerd on doom as well. Ill post a message within 5 days. I have to wait before posting. :(

    NP - I have left a comment there for you :)

    I think that it might take a little while to build up some positive action on this issue as not all people will be aware that there is a problem due to not using that particular filter in a way that you do within MP.

    Good luck though :)

    Damaster also saw this problem within mediaplayer classic. So its not only in MP. Sounds like they should look into it i think.
     

    Vimes

    MP Donator
  • Premium Supporter
  • January 19, 2009
    230
    33
    Earth, for now
    Home Country
    United Kingdom United Kingdom
    @ Damaster: I just registerd on doom as well. Ill post a message within 5 days. I have to wait before posting. :(

    NP - I have left a comment there for you :)

    I think that it might take a little while to build up some positive action on this issue as not all people will be aware that there is a problem due to not using that particular filter in a way that you do within MP.

    Good luck though :)

    Damaster also saw this problem within mediaplayer classic. So its not only in MP. Sounds like they should look into it i think.

    Yes I noted that also :)

    However unless you keep the same session of MP or media player classic open for each and every time that you play a movie using that particular filter then the memory retention is reset as either MP or MP classic is opened and closed. For those who leave the application open and do not often reboot their PC's etc etc etc then they may become aware of a memory leakage or just attribute it to their PC "just needing to reboot".
     

    Users who are viewing this thread

    Top Bottom