[Videos] - Adding madVR support | Page 3

Discussion in 'Improvement Suggestions' started by Klarerwind, March 17, 2011.

  1. tourettes
    • Premium Supporter

    tourettes Retired Team Member

    Joined:
    January 7, 2005
    Messages:
    17,301
    Likes Received:
    4,595
    Ratings:
    +4,810 / 3
    What would be needed is to have a callback that will provide a texture that contains only the video frame. MediaPortal's skin engine needs to be able to draw under and on top of that video frame. Skin Engine is responsible for calling the D3DDevice.Present(). Callback should be called when the frame is about to be rendered (there is slight overhead on the Skin Engine since it will do some drawing as well).

    In addition to that there is fortcoming MediaPortal Audio Renderer that works like Reclock - video renderer is responsible for making the minor adjustments to allow the audio resampling to be used to eliminate dropped frames (the ones that are caused by A/V clocks running on different rates) and to allowe non 1:1 matching fps vs hz to used like with Reclock.

    Hare's what the audio renderer's control interface looks like:

    Code (Text):
    1.  
    2. struct CLOCKDATA
    3. {
    4.   double driftMultiplier;
    5.   double driftHWvsSystem;
    6.   double currentDrift;
    7.   double resamplingAdjustment;
    8. };
    9.  
    10. // {91A198BA-1C78-4c31-A50F-0F5C7578F078}
    11. static const GUID IID_IAVSyncClock = { 0x91a198ba, 0x1c78, 0x4c31, { 0xa5, 0xf, 0xf, 0x5c, 0x75, 0x78, 0xf0, 0x78 } };
    12. DEFINE_GUID(CLSID_IAVSyncClock, 0x91a198ba, 0x1c78, 0x4c31, 0xa5, 0xf, 0xf, 0x5c, 0x75, 0x78, 0xf0, 0x78);
    13.  
    14. MIDL_INTERFACE("91A198BA-1C78-4c31-A50F-0F5C7578F078")
    15. IAVSyncClock: public IUnknown
    16. {
    17. public:
    18.   virtual HRESULT STDMETHODCALLTYPE AdjustClock(DOUBLE adjustment) = 0;
    19.   virtual HRESULT STDMETHODCALLTYPE SetBias(DOUBLE bias) = 0;
    20.   virtual HRESULT STDMETHODCALLTYPE GetBias(DOUBLE *bias) = 0;
    21.   virtual HRESULT STDMETHODCALLTYPE GetMaxBias(DOUBLE *bias) = 0;
    22.   virtual HRESULT STDMETHODCALLTYPE GetMinBias(DOUBLE *bias) = 0;
    23.   virtual HRESULT STDMETHODCALLTYPE GetClockData(CLOCKDATA *clockData) = 0;
    24.   virtual HRESULT STDMETHODCALLTYPE SetEVRPresentationDelay(DOUBLE EVRDelay) = 0;
    25.  
    26. };
    27.  



     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. madshi

    madshi Portal Member

    Joined:
    August 13, 2011
    Messages:
    10
    Likes Received:
    3
    Ratings:
    +3 / 0
    Home Country:
    Germany Germany
    In other words you want the renderer to just do the color conversion and scaling etc, but you want to do the presentation yourself? It would be possible to add such a rendering mode option to madVR, but it would bypass a lot of carefully implemented presentation code. Presentation is an important part of madVR. If we bypass that, we lose some of the things that make madVR better than other renderers. Here's a list of things that we would lose:

    - most importantly: smooth playback without any judder/stuttering
    - automatic windowed <-> exclusive mode switching
    - automatic display mode changing
    - 3:2 stutter removal for 24fps playback on 60Hz displays
    - support for true 10bit output
    - internal Reclock replacement without any audio quality loss (by doing the adjustments on the video side of things)
    - black/dark frame insertion

    The bottom 4 features are not implemented in madVR yet, but might eventually come in a future version (or not). Maybe you can implement some of these things inside MediaPortal, but you'd practically have to reinvent what madVR already does (or will eventually do).

    Wouldn't it be possible to allow madVR to take care of the presentation? I could add all kinds of callbacks which would allow you to draw under and over the video frame etc. That's no problem at all. But losing the presentation part of madVR would be a substantial loss, IMHO.
     
  4. Holzi
    • Team MediaPortal

    Holzi Super Moderator

    Joined:
    April 21, 2010
    Messages:
    7,928
    Likes Received:
    1,591
    Gender:
    Male
    Location:
    Ba-Wü
    Ratings:
    +2,228 / 8
    Home Country:
    Germany Germany
    Show System Specs
    AW: Adding madVR support

    I really would love to see madVR support! Would be a great improvement imo! =)
    Thanks!
     
  5. tourettes
    • Premium Supporter

    tourettes Retired Team Member

    Joined:
    January 7, 2005
    Messages:
    17,301
    Likes Received:
    4,595
    Ratings:
    +4,810 / 3
     
  6. tourettes
    • Premium Supporter

    tourettes Retired Team Member

    Joined:
    January 7, 2005
    Messages:
    17,301
    Likes Received:
    4,595
    Ratings:
    +4,810 / 3
    I haven't been following the madVR thread on doom9 forum's lately (6 months maybe :)). Just because I can't got enough free time. It would be nice to have madVR support in MP 1.3.0, but it probably needs lot of work (not as much on madVR as MP side). It would require some interested dev to hop in to make the required changes on MP side - I simply have already too much on my hands with the current components I'm working on (and as said there is just not that much free time... at least not as much I would like / need to have)

    btw. Does DVD navigator currently work with the madVR? I think it was problematic at least at some time in the past.
     
  7. hoborg

    hoborg Portal Pro

    Joined:
    June 13, 2008
    Messages:
    4,413
    Likes Received:
    1,593
    Location:
    Nový Jičín
    Ratings:
    +1,621 / 2
    Home Country:
    Czech Republic Czech Republic
    Show System Specs
    And how to solve deinterlacing? Using CUVID is not a solution for 2/3 users...
     
  8. tourettes
    • Premium Supporter

    tourettes Retired Team Member

    Joined:
    January 7, 2005
    Messages:
    17,301
    Likes Received:
    4,595
    Ratings:
    +4,810 / 3
    Not everyone would have to use madVR. 95% of the people wont see anything different with madVR and MP's internal EVR presenter when playing a Blu-ray on 1:1 matching screen.

    • madVR implements some way to allow HW deinterlace to be used
    • LAV CUVID type of video decoders for other GPU types are created
    • probably pixel shaders on MP side could be used to deinterlace (who creates such, not me :))
    • people buy Nvidia :)

    In any case it is not this thread's topic to expand madVR's support for anything else than the MP related API.
     
  9. Owlsroost
    • Team MediaPortal

    Owlsroost Development Group

    Joined:
    October 28, 2008
    Messages:
    5,537
    Likes Received:
    2,829
    Location:
    Cambridge
    Ratings:
    +4,131 / 1
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    Exactly - supporting hardware de-interlacing is a critical feature (for me at least - 99% of the video content I play is interlaced).

    Tony
     
    • Like Like x 1
  10. Owlsroost
    • Team MediaPortal

    Owlsroost Development Group

    Joined:
    October 28, 2008
    Messages:
    5,537
    Likes Received:
    2,829
    Location:
    Cambridge
    Ratings:
    +4,131 / 1
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    What is this used for - mimicing what a real film projector does maybe (i.e. the 48Hz flicker) ?

    Tony
     
  11. madshi

    madshi Portal Member

    Joined:
    August 13, 2011
    Messages:
    10
    Likes Received:
    3
    Ratings:
    +3 / 0
    Home Country:
    Germany Germany
    Theoretically MPC-HC's internal renderers do that, too. But my users report that madVR still does it better than any other renderer. Furthermore some madVR users have CRTs with high refresh rates (e.g. 120Hz) and only madVR achieves smooth playback in that situation, according to what my users report.

    On my own HTPC with integrated NVidia 9400 GPU, I'm only getting smooth playback with madVR, when playing 25fps movies @ 50Hz. All other renderers I've tried so far fail miserably.

    Exclusive mode is important, IMHO. It's needed for 10bit output. It's probably needed for frame packed 3D output (which is another feature which would require madVR to do the presentation, btw). And it's required for many users to reliably get rid of tearing. Finally, exclusive mode allows madVR to present several video frames in advance, which are then flipped by in driver land in the hardware vsync interrupt (I think).

    So basically whenever I fire a render callback, it would end up with a "D3D.Present" call in your code? That's still kinda problematic, though. madVR usually pre-renders frames in advance and then presents them to very strict timing ranges. If I fire that callback, and if you take more than just a few microseconds for your rendering, presentation might already be off, resulting in problems, especially with high refresh rates...

    That's too bad... :(

    I understand. My free time is quite limited, as well, sadly... :( Anyway, if there's any dev reading this and wanting to work on madVR support, just let me know. My email address is listed in the madVR readme.

    I've been told it works for some DVDs, when using specific MPEG2 decoders - but maybe not for all DVDs. I think it might start working for all DVDs once I add support for an external subtitle pin, so that the DVD navigator can overlay the menus.

    madVR has not reached v1.0 yet. Have some patience... ;)

    Some projectors already have this feature built in (but in a rather bad way, IMHO).

    Yes, basically it simulates what a real film projector does. The purpose is not the simulation in itself, though. The main purpose of black/dark frame insertion is to reduce the "sample-and-hold" effect. Digital type displays are "hold" type displays. Which means that the image is visible at all times. There are no black phases (like there were with CRT). With digital displays, the image doesn't move smoothly. It jumps a bit every video frame. Our eyes/brain try to follow movements, but due to the jumping, our eyes/brain see a lot of blurring. Motion is just not sharp, anymore. This can be reduced by using intermedia frame interpolation. But doing that introduces the "soap opera" effect. Alternatively dark/black frame insertion helps making motion appear sharper.

    CRTs didn't have problems with displaying sharp motion because there were not hold-type displays. As annoying as the flickering was, it helped a lot in making motion sharp.
     
    • Like Like x 1
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!