MadVR Expert Guide

From wiki.jriver.com
Jump to navigation Jump to search

This guide can be used to custom configure Media Center's Red October HQ mode to obtain better performance on lower end hardware, or to optimize the quality of playback even further.

However, if you want to roll up your sleeves and dive in, then read on. This guide was originally posted by 6233638 on Interact. It can be found here.

Configuring madVR

madVR has a lot of options, which can be confusing for new users. It can also be quite demanding of your hardware in its default configuration. Unlike most HTPC tasks, madVR uses your GPU to handle its advanced scaling and image processing, and that is often a component that people do not consider when building a HTPC.

To access the madVR configuration, you need to start playing a video (I would then recommend pausing it) right-click anywhere on the screen, and go to:

DirectShow Filters → madVR

Devices

Configure Devices in MadVR Settings

There may be a few devices already listed here even if you have not used madVR before, as the build Media Center downloads has some pre-configured. You can simply right-click and delete them—but leave the entry for your display. You can select what type of device is connected in this tab, but it doesnʼt affect anything other than the icon displayed.

Below that is the Identification section, but there is nothing to configure there—it just gives you some additional information based on your displayʼs EDID data.

Next is the Properties Tab.

Properties tab in MadVR Settings

This allows you to set the levels madVR will output to Windows, and the level of dithering used.

Regardless of what your display accepts, whether it is 16–235 or 0–255, it should be left at 0–255 to avoid having the image appear “washed out”. Typically if you need to send 16–235 to a display, you will use the video card output to set that, not the video renderer.

And unless you specifically know that your display is using less than 8-bit natively, you should leave that option at 8-bit. Reducing it increases the amount of dithering (noise) madVR will add to the image.

Calibration

Calibration tab in MadVR Settings

madVR has a number of advanced calibration options, but I will not be going over them in detail in this guide—calibration could have a whole guide written about it alone.

Unless you are looking to use the more advanced calibration features of madVR, it is generally best to leave it configured as shown above. With HD content these settings mean that color should look the same as other video renderers, but with SD video, it allows madVR to perform the colorspace transformations required for SMPTE-C and EBU/PAL content. These colorspace transformations require a small amount of GPU power, so if your computer is really struggling to play back video smoothly in madVR, it will have to be disabled.

The yCMS and 3DLUT options are a lot more complicated to use, and are also more demanding of your GPU.

Display Modes

Display Modes tab in MadVR Settings

madVR includes a display mode switcher for automatic resolution and refresh rate changing.

Most people will be using madVR to handle video scaling, so it will only be used to change refresh rates. These are simply entered using comma separated values. Be sure that your display actually supports the resolutions you have selected. I would suggest that you try switching to them via your graphics cardʼs control panel first.

The treat 25p movies as 24p (requires Reclock) option is useful for those of us with PAL film-based content (typically DVDs) as it allows either ReClock or JRiverʼs VideoClock (the text needs updated) to play back PAL content at the original 24p speed, rather than being sped-up to 25fps. All this option does is tell madVR to switch to the best display mode for 24p when you are playing back 25p content—how that is handled is up to the player. (which is fine if you are using ReClock/VideoClock)

madVRʼs display mode switcher is a bit more advanced than Media Centerʼs switcher right now, so I would recommend using it instead. With IVTC content (which I will detail later) it switches the display to 24p, whereas JRiverʼs switcher does not.

Updated 13/06/2013: There is an issue with Windows 8 where most video cards will switch to 23Hz and 59Hz when an application tries to set the refresh rate to 24Hz or 60Hz. madVR 0.86.3 fixes this problem. Media Center's switcher currently does not, and will switch to 23/59Hz rather than 24/60Hz as specified.

Color & Gamma

Color & Gamma tab in MadVR Settings

This section allows you to perform simple color & gamma adjustments to any video being rendered by madVR. It is probably best that these are left alone for most users.

Processing

Decoding

Color & Gamma tab in MadVR Settings

madVR has the option to handle video decoding itself. I recommend leaving that up to your player though. Media Center uses LAV Video for decoding.

In Media Center, under Tools → Options → Video there is an option to use hardware accelerated video decoding, which I recommend trying if you are having difficulty playing videos, or want to reduce power consumption during media playback.

Updated 13/06/2013: Media Center now uses LAV's DXVA2 Copy-Back decoding with Nvidia cards, so no further configuration is necessary when using hardware acceleration.

Deinterlacing

The deinterlacing options in madVR are very specific to the types of content that you watch, so it is difficult to make recommendations.

In my case, I have a lot of interlaced PAL DVDs, which are often misidentified as being Video-Type content rather than Film-Type content, so forcing film mode works best for me. Film mode will activate IVTC for interlaced video if madVR detects that it is natively 24/25p content, regardless of the source framerate. (e.g. 24p in a 29fps file) You can always override the deinterlacing mode used either by adding deint=on/off/video/film/ivtc to the filename, or switch modes at any time by pressing Ctrl+Alt+Shift+T when a video is playing.

The one recommendation I will make, is to leave the only look at pixels in the frame center option enabled—I have have problems with cadence detection not working correctly when this is off.

Scaling Algorithms

Image scaling is one of the main reasons to use madVR. It offers very high quality scaling options that rival or best anything I have seen.

Most video is stored using chroma subsampling in a 4:2:0 video format. In simple terms, what this means is that the video is basically stored as a black-and-white “detail” image (luma) with a lower resolution “color” image (chroma) layered on top. This works because the detail image helps to mask the low resolution of the color image that is being layered on top.

So the scaling options in madVR are broken down into three different categories: Chroma Upscaling, which is the color layer. Image Upscaling, which is the detail (luma) layer. Image downscaling, which only applies when the image is being displayed at a lower resolution than the source—1080p content on a 720p display, or in a window on a 1080p display for example.

Chroma upscaling is performed on all videos—it takes the quarter resolution chroma image, and upscales it to the native luma resolution of the video. If there is any further scaling to be performed; whether that is upscaling or downscaling, then the image upscaling/downscaling algorithm is applied to both chroma and luma.

Image Upscaling tab in MadVR Settings

There are a number of different scaling algorithms available in madVR, and what you choose depends on both the performance of the video card in your system, and personal preference.

Image scaling is a balancing act (mostly) between three variables:

  • Sharpness
  • Aliasing
  • Ringing

Sharpness is an obvious one—it's how sharp the image appears. Aliasing is often seen as jagged edges on diagonal lines/curves rather than smooth edges, or as moiré patterns if you are downscaling. Ringing often shows as “halo” artefacts or darkened edges around bright objects, which can sometimes give the appearance of additional sharpness.

madVR gives you a rough guide when selecting algorithms, but may be misleading in some cases.

In terms of scaling performance (rendering speed, not image quality) the algorithms in madVR are roughly tiered as:

High Performance:

  • Nearest Neighbor
  • Bilinear

Medium Performance:

  • Mitchell-Netravali
  • Catmull-Rom
  • Bicubic
  • SoftCubic

Low Performance:

  • Lanczos 3 / Spline 3
  • Jinc

Depending on your graphics card, the DXVA2 option may either be a high performance option, or a medium performance one. There is also an anti-ringing filter, and a linear light option, both of which increase GPU demands when enabled. (though I do not recommend the linear light option in most cases)

Initially, your goal should be smooth video playback rather than the best image quality, so I would recommend setting all scaling algorithms to Bilinear. I will write up a post later that will go into detail about the differences between scaling algorithms, and which ones I recommend based on their performance and image quality. As a rough guide, this image was based on settings I recommended after some discussion over at the Doom9 madVR topic.

Rendering

This section deals with what are mostly performance-related settings, and options that may be required to get the best performance out of your specific graphics card. Unless you are actually experiencing performance issues, most of these settings are best left alone.

General Settings

General Rendering Settings tab in MadVR Settings

I have never used madVR on XP, so I couldn't tell you what the use managed upload textures setting does.

The delay playback start until render queue is full options will pause the video playback until a number of frames have been rendered in advance of playback. This potentially avoids some stuttering right at the start of video playback, or after seeking through a video—but it will add a slight delay to both. It is disabled by default, but I prefer to have it enabled. If you are having problems where a video fails to start playing, this is the first option I would disable when troubleshooting.

Enable windowed overlay changes the way that windowed mode is rendered, and will generally give you better performance. The downside to windowed overlay is that you cannot take screenshots of it with the “Print Screen” key on your keyboard, and any transparent aspects of Media Center's UI which overlays the video might look a bit strange. Other than that, it's mostly a “free” performance increase for people running Windows 7/8. It does not work with AMD graphics cards.

Enable automatic fullscreen exclusive mode allows madVR to use “fullscreen exclusive mode” for video rendering. This can potentially give you some big performance improvements, and allows for several frames to be sent to the video card in advance, which can help eliminate random stuttering during playback. It will also prevent things like notifications from other applications being displayed on the screen at the same time, and similar to the Windowed Overlay mode, it stops “Print Screen” from working. The main downside to Fullscreen Exclusive mode is that when switching in/out of FSE mode, the screen will flash black for a second. (similar to changing refresh rates) Media Center's mouse-based interface is rendered in such a way that it would not be visible in FSE mode, so madVR gets kicked out of FSE mode any time you use it, and you get that black flash on the screen. I personally find this distracting, and as such, have disabled FSE mode, because I don't need the additional performance for smooth playback on my computer. (I have an Nvidia GTX 570) The "10ft interface" is unaffected, and renders correctly inside FSE mode.

Disable desktop composition This option will disable Aero during video playback. Back in the early days of madVR this may have been necessary on some systems, but I don't recommend enabling this option now. Typically the main thing that happens is that it breaks v-sync and you get screen tearing. (horizontal lines over the video)

Use a separate device for presentation. By default this option is now disabled, but I see a big increase in performance when it is enabled using Nvidia graphics cards. You will have to experiment with this one.

Use a separate device for DXVA processing similar to the option above, this may or may not improve performance.

CPU/GPU Queue Size This sets the size of the decoder queue (CPU) and upload/render queues. (GPU) Unless you are experiencing problems, I would leave it at the default settings of 12/8. The higher these queue sizes are, the more memory madVR requires. With larger queues you could potentially have smoother playback on some systems, but increased queue sizes also mean increased delays when seeking if the delay playback… options are enabled. Depending on your system, if you are having trouble getting smooth playback with madVR, sometimes turning the queue sizes all the way up or all the way down seems to help. It really depends on the machine.

Updated 13/06/2013: As of madVR 0.86.2, the decoder queue can now be increased to a maximum of 128 frames. In my experience, this increases the amount of RAM madVR uses to around 800MB with 1080p video. It may also greatly slow down seeking or switching between full-screen/windowed modes when delay playback… is enabled. If you have the memory to spare, and your system is capable of filling the queues, it may result in smoother video playback. (far less chance of dropped frames occurring) In general, the decoder queue should only be set as high as your system can actually fill. There's no point in setting it to 128 frames if your system can only fill 30/128.

Windowed Mode

Windowed Mode Settings tab in MadVR Settings

As the name suggests, these settings apply to madVR running in Windowed Mode. That means they apply when madVR is running in a Window, or when Fullscreen Exclusive mode is disabled.

Increasing the number of backbuffers could potentially result in smoother playback at the cost of increased memory usage. As always, I recommend leaving these settings at the defaults.

However, if you plan on using Smooth Motion, I would recommend setting them to the maximum of 8.

The flush settings could potentially be used to get more performance out of a struggling system, but these days they are largely unnecessary and best left alone.

Exclusive Mode Settings

Exclusive Mode Settings tab in MadVR Settings

Show seek bar has no effect if you are using Media Center—it draws a seek bar which can be used in FSE mode without kicking you back to Windowed Mode—but Media Center disables this and uses its own UI anyway.

Delay switch to exclusive mode by 3 seconds. If your media player switches into fullscreen mode, and FSE is enabled, it will always switch instantly. This option is for when something such as Media Center's mouse-controlled UI breaks FSE mode and kicks it into Windowed Mode. If the option is enabled, it will wait 3 seconds returning to FSE mode, rather than switching instantly. This can be useful if you are going to make a couple of changes, such as switching subtitle track, and adjusting its size and position, without it going in/out of FSE mode each time you bring up the menus.

Present several frames in advance should always be enabled. Disabling this puts madVR into the legacy FSE mode, which has not been supported for years at this point. Similar to the Windowed Mode option, I would recommend leaving madVR presenting 4 frames in advance, as is the default, unless you are going to be using Smooth Motion, in which case you should set it to the maximum. You may need to increase the CPU/GPU queues accordingly to fill the buffer.

Smooth Motion

Smooth Motion Settings tab in MadVR Settings

Smooth Motion is a recently introduced frame blending system for madVR. What Smooth Motion is not, is a frame interpolation system—it will not introduce the “soap opera effect” like you see on 120Hz+ TVs, or reduce 24p judder.

Smooth Motion is designed to display content where the source framerate does not match up to any of the refresh rates that your display supports. For example, that would be 25/50fps content on a 60Hz-only display, or 24p content on a 60Hz-only display.

It does not replace ReClock or VideoClock, and if your display supports 1080p24, 1080p50, and 1080p60 then you should not need to use Smooth Motion at all.

Because Smooth Motion works by using frame blending you may see slight ghost images at the edge of moving objects—but this seems to be rare and dependent on the display you are using, and is definitely preferable to the usual judder from mismatched framerates/refresh rates.

There are some cases where, even if your display does support 1080p24/50/60, you will want to use Smooth Motion though. If you have a Plasma that displays 24p at 48Hz for example, you might want to display it at 60Hz using Smooth Motion instead to reduce flicker. Or if you have madVR's display mode switcher set up to only switch refresh rate when the player goes fullscreen, you may want to leave it enabled when you have a 24p video playing in a window while using the computer for something else at the same time with the display at 60Hz.

Updated 13/06/2013: As of madVR 0.86.3, Smooth Motion is now working as I would have hoped on my system, so when set to only when there would be motion judder without it…, it is no longer enabled when the display mode switcher is used in conjunction with VideoClock. So 23/24/25fps video played at 24Hz will not activate Smooth Motion, but 23/24/25fps video at 60Hz will. This means that videos displayed full-screen do not use Smooth Motion, but when I play videos in a window on the desktop at 60Hz, Smooth Motion is activated.

If your system can handle it, I now recommend enabling Smooth Motion, and leaving it at this setting. This also requires that you increase the Windowed/Full-screen Exclusive buffers to the largest that your system can handle.

Trade Quality for Performance

Trade Quality for performance tab in MadVR Settings

As the name suggests, these options exist to reduce image quality to improve performance. Many of these options will only have a very small impact on image quality. Generally, if you are having performance troubles, working your way down the list, enabling them one at a time until playback is smooth, is the best way to approach them.

User Interface

This section allows you to view and change the keyboard shortcuts for madVR.

madVR Keyboard Shortcut configuration

Note: The following work around is only required for MC versions up to MC24.0.53 The issue is permanently fixed in MC24.0.54.

Note that the madVR "Debug OSD" (madVR Statistics) is particularly useful in diagnosing video display issues. Unfortunately with the MC extended remote control Feature ("Tools > Options > General > Features > Remote Control" ticked, plus "Tools > Options > Remote Control > Devices & Options > Select Input Devices > Remote, Keyboard, gamepad, or other HID" selected), Ctrl+J will no longer work to display the Statistics as MC blocks madVR from receiving the keys.

There are two ways around this situation, to enable display of the debug OSD Statistics.

1. Turn off the "Remote, Keyboard, gamepad, or other HID" option, restart MC, and then Ctrl+J will work as normal. Note: Some istalltions will require this option in order to work correctly. If you only use an MCE Remote, you shouldn't need this option.

2. Use Ctrl+J with the madVR setting dialogue open.

  • Access the madVR configuration as described above. i.e. Start playing a video (I would then recommend pausing it) right-click anywhere on the screen, and go to; DirectShow Filters > madVR, as shown in the image below.
  • Uncheck the "use only if media player has keyboard focus" box in the madVR User Interface > Keyboard shortcuts dialogue.
  • Highlight any menu heading in the left side of the madVR settings. Do not highlight a sub-menu or configuration item.
  • Now press Ctrl+J. The madVR Debug OSD Statistics will display. Ctrl+R will also work to reset the Statistics while the madVR setting dialogue is open.
  • If desired, close the madVR settings. It will have to be opened again to use Ctrl+J to close the Debug OSD.


Note: This was tested using madVR with Automatic Full-Screen Exclusive Mode not selected.

Display madVR Debug OSD video Statistics using Ctrl+J