• Donate
    TheWindowsForum.com needs donations to stay online!
    Love TheWindowsForum.com? Then help keep it alive by sending a donation!

Advanced Video Playback - A White Paper

WELCOME TO THEWINDOWSFORUM COMMUNITY!

Our community has more than 63,000 registered members, and we'd love to have you as a member. Join us and take part in our unbiased discussions among people of all different backgrounds about Windows OS, Software, Hardware and more.

Seraph

VIP
Sep 1, 2012
2
0
NOTE: GUIDE IS PENDING A SMALL REWORK DUE TO RECENT UPDATE ADDING SUPPORT FOR MATROSKA ORDERED CHAPTERS WITH LINKED FILE SEGMENTS / VIRTUAL TIMELINE TO LAV SPLITTER, THUS MAKING IT PREFERABLE TO HAALI MEDIA SPLITTER, WHICH IS NOW NO LONGER RECOMMENDED.
I WILL PROBABLY ALSO ADD A SECTION COVERING THE USE OF RECLOCK.


Preamble:

This guide is aimed at users who want the absolute best performance and quality out of their video player. While the benefits can be significant, they will be difficult to detect when playing back highly compressed and low quality media such as is found commonly now on some sites. The capabilities of the software listed below far exceed the requirements of such media. If you are simply searching for a 'one-click' solution which will handle all your media, it is suggested that you simply use VLC Player instead.

With the prevalence of demanding features in video, such as 10bit colourspace encoding, (the Hi10P H.264 profile,) and complex subtitles, (Advanced SubStation Alpha, .ass) becoming more and more common, the ability of large pre-configured libraries and codec packs such as FFmpeg, libav, CCCP and K-Lite, to play back media with both high performance, and high quality is fast diminishing.
As such, the demand for specialised software to handle each stage of the media output chain has dramatically increased. There are a number of guides floating around on the internet which attempt to provide some insight into this topic, but are all in my opinion, lacking in one way or another.

In accordance with the above, the following list of software was compiled to illustrate what programs will presently give the best performance and quality on Windows. Please note that with HEVC MP, the successor to H.264/MPEG-4 AVC HP, now approved by the ITU-T, and set in motion, this guide will likely become fast outdated as software moves on to embrace the new standard.

Media Player: Media Player Classic - Home Cinema
Media Splitter: Haali Matroska Splitter
Video Decoder: LAV Video Decoder
Audio Decoder: LAV Audio Decoder
Video Renderer: madVR
Subtitle Renderer: xy-VSFilter

Instructions for installing and configuring this software will follow this brief overview of the selection process for each piece of software.

Details:

Media Player:
Basically with the media player all we want is a shell to hold all the other pieces of software, called DirectShow filters, and use them. To this end, there are three popular options: Media Player Classic - Home Cinema, (MPC-HC); PotPlayer; and K-Multimedia Player, (KMPlayer).
All three of these media players do what is needed, but my preference lies with MPC-HC. MPC-HC has a far simpler and more intuitive interface than either KMPlayer or PotPlayer, which both have unnecessarily complicated settings menus, and multiple options which conflict with each other. They both also come with undesirable default audio processing settings.
If you are a fan of K-Pop, however, KMPlayer might be of some interest, as it comes with a number of K-Pop oriented Web 2.0 features.

Media Splitter (demuxer):
The job of the media splitter is to take the media file, and split it into it's respective data streams, (video, audio, subtitle,) and pass them to their respective decoders.
Haali Splitter has little competition here, apart from the inferior Gabest Splitter, although LAV Splitter is gaining popularity. At this stage, Haali is recommended over LAV, as it can properly handle ordered Matroska chapters with linked file segments, which LAV cannot. Some users have also reported bugs with runtime reporting when using LAV.

Video Decoder:
The video decoder processes the video data stream passed to it by the splitter, and passes the raw YUV video data on to the renderer to be displayed.
Until recently, the two popular decoders were libavcodec, (from the FFmpeg/libav libraries,) for general use, and CoreAVC which gave better performance on obsolete hardware.
LAV Video performs better than CoreAVC on old hardware, as well as being considerably less buggy. It also maintains the wide range of support for filetypes found in libavcodec. LAV has options for hardware acceleration, but note that desktop GPU's cannot currently decode 10bit data, so if you have any 10bit video content, using hardware acceleration will result in messed-up output.

Audio Decoder:
The audio decoder does exactly what the video decoder does, except with the audio stream.
Like it's video counterpart, LAV Audio has wide-ranging filetype support, as well as excellent performance. One major strength is it's ability to correctly process FLAC encoded audio streams without destroying the channel mapping.
Note that LAV Audio does not support DTS, refer to the note regarding playback of DTS audio in the postscript.

Video Renderer:
The video renderer takes the raw video data from the decoder and renders it with your GPU on your monitor.
There are two popular options here: Madshi's Video Renderer, (madVR); and Enhanced Video Renderer Custom Presenter, (EVR CP).
MadVR basically provides higher video quality than any other renderer, but it comes at the cost of high resource usage. It can be configured to trade quality for performance, but if your hardware still cannot hack it, it is suggested that you use EVR CP instead.
If you are interested, video renderer comparison examples can be found on the doom9 forums.

Subtitle Renderer:
This takes the subtitle data from the splitter (demuxer) and renders it on-screen.
There are three popular sub renderers currently: xy-VSFilter, (a fork of the original VobSub VSFilter); libass, (from the FFmpeg/libav libraries); and MPC-HC's internal sub renderer, (ISR).
xy-VSFilter handles complex subtitle typesetting better than either ISR or libass, which both fail to properly render some of the more complicated subs. It also never drops subtitles or flickers, which ISR occasionally does. Some users may prefer to use ISR for low resolution video, or when runtime upscaling video, as xy-VSFilter renders subs at video resolution, while ISR can be forced to render subs at desktop resolution, thus providing sharper rendering. This effect can be duplicated with xy-VSFilter, however, by selecting an up-scaling algorithm in madVR which results in a high level of sharpness.


A note about VLC, GomPlayer, mplayer and any other FFmpeg or libav based players:
These players are popular due to having support for a wide range of files, without requiring any external software. This is because they are based on either the libraries from the FFmpeg project, or it's very similar fork, the libav project. However, they lack the wide range of configuration options, and support for external filters present in MPC-HC, KMPlayer or PotPlayer. The FFmpeg/libav filters used internally by these programs also tend to be subpar to the standalone variants listed above. That is not to say that these media players are bad, but they are designed for users who want a 'one-click' solution to play back all their media, without some of the more advanced capabilities made available by the software which has been discussed above.



The following is a walkthrough covering the installation and configuration of the aforementioned software.


Preparation:

Uninstall all video players, codec packs, and directshow filters installed. Surprisingly, this isn't actually just the usual statement made to keep everyone on the same level in case of trouble-shooting later on. K-Lite Codec Pack, for example, actually includes pre-installed versions of some of the software included in this guide, and could potentially cause conflict or issues when you attempt to use a later version directly.

Note that when I specify 32bit versions of software, I mean it. This combination will not work using 64bit software, as this is an avenue which is disappointingly not pursued by most software developers. I would assume that most users are running a 64bit version of Windows, but I assure you that the 32bit software will work fine regardless.


Download the following:

1) MPC-HC -
Code:
http://mpc-hc.org/downloads
-Get the 32bit (x86) installer


2) madVR -
Code:
http://madshi.net/madVR.zip


3) LAV Filters -
Code:
http://code.google.com/p/lavfilters/downloads/list
-Get the the 32bit .zip archive


4) Haali Matroska Splitter -
Code:
http://haali.su/mkv/MatroskaSplitter.exe


5) xy-VSFilter -
Code:
https://code.google.com/p/xy-vsfilter/wiki/Downloads
-Get the .zip archive



Installation:


*MPC-HC

-Use the installer, make sure to check "clean installation".


*Haali Media Splitter

ibbASx3PJDybvI.png


-Disable Windows Media Player association, but enable everything else.


*madVR

ilO2MhBJznRTV.png


-Extract the archive to a sensible location, such as program files, and run the install.bat as administrator.


*LAV Filters

iFapsFjGEBfc6.png

i3FI7ZhuWR4bE.png


-Extract archive to a sensible location and run install_audio.bat and install_video.bat as administrator. Ignore the install_splitter.bat file.


*xy-VSFilter

iolrjTg1k7iwi.png


-Extract the archive to a sensible location and open a command prompt as administrator.
-Navigate the command prompt to the extracted directory, e.g. "cd C:\Program Files (x86)\xy-VSFilter"
-Register the .dll with command prompt "regsvr32.exe VSFilter.dll"



Configuration:


*MPC-HC


il8j2KRQWnggn.png


-Open the options menu and navigate to the Playback submenu.
-Uncheck "Auto load subtitiles".


ib0TT5yBE9bsuw.png


-Navigate to the Output submenu
-Select madVR in the "DirectShow Video" drop down menu.


iZCVF0Z08PSBZ.png


-Navigate to the Internal Filters submenu
-Disable everything. This can be done quickly by right click->Disable all filters. The same goes for the Transform Filters pane.


ib2dyGro6I5Pib.png


-Navigate to the External Filters submenu.
-Add in this order: Haali Media Splitter
LAV Audio Decoder
LAV Video Decoder
DirectVobSub (auto-loading version)
madVR
-Set all of the above to "prefer".

-Note that DirectVobSub (auto-loading version) is the name used in MPC-HC to refer to xy-VSFilter.


i8igfMh7nnJRF.png


-Playback some video to verify that the filters are installed correctly and in use. Note that 8bit video will ouput "NV12, 8bit" instead.



*madVR

-To open the configuration menu for madVR, begin playback of some media, and open the madVR configuration dialogue from your system tray.


ibwEhbdI2ebymT.png


-Navigate to the properties submenu for your primary monitor
-Ensure that RGB output is set to 0-255 PC Levels - obviously if you use a TV as your display, set to TV levels instead.
-If you use a standard TN panel, set the bitdepth to 7bit. If you use an IPS, set to 8bit.


i0DvO9oFO7NZt.png


-Navigate to the Color & Gamma submenu
-check "enable gamma processing"
-select a "pure power curve" and set anywhere between 2.20 and 2.40. 2.20 for well lit environments, and 2.40 for dim to no light.


ibuTDrouITDNBO.png


-Navigate to the decoding submenu
-uncheck everything


ibu4r1xlpNiYXI.png


-Navigate to the deinterlacing submenu
-select "automatically activate deinterlacing when needed"
-select "if in doubt, activate deinterlacing"
-If you watch more anime than live-action, disable "only look at pixels in frame center"



NOTE: The following 3 sections can provide drastically different results depending on each user's setup, what they watch, and their personal preference.


iboRs04TDVmf8Q.png


-Navigate to the chroma upscaling submenu
-select a 4tap jinc, and activate the anti-ringing filter



NOTE: Users of DXVA will want to use that isntead of jinc/lanczos for the following 2 sections.


iKB61KOVhGtux.png


-Navigate to the image upscaling submenu
-Again, select a 4tap jinc with the anti-ringing filter. Do not select "scale in linear light".


id0hYH6hKeyZf.png


-Navigate to image downscaling submenu
-Select an 8tap Lanczos, and activate the anti-ringing filter.


iLAq7JGyQn60w.png


-Navigate to the general settings submenu
-dsiable automatic fullscreen exclusive mode


iK3OVs5PNOvPH.png


-Navigate to windowed mode settings
-set backbuffer count to 8, and set flushing settings as in image.


iFjXAjF1nC1nv.png


-Navigate to trade quality for performace
-Make sure everything is disabled. (If you have old hardware and struggle with performance, you may wish to enable some of these. Alternately, try EVR CP isntead of madVR.)




Congratulations, you have everything successfully installed and configured. To be be sure, close MPC-HC and re-open it before beginning playback.
I don't plan on providing any sort of comprehensive support for this, if you run into issues, it's 100% user-error, and you will be better off either using VLC, (or another ffmpeg/libav based player,) or K-Lite Codec Pack, (which includes MPC-HC.)

And once again, madVR is very resource heavy. If you struggle to manage smooth playback with it, try EVR CP instead, or buy some newer hardware.
I also forgot to add that if you plan on playing back media with DTS audio, you will need to either enable the internal mpc-hc source and transform filters for DTS, or install AC3Filter, which is the best external decoder for DTS. (Obviously treat it in the same way as all the other external filters, and in it's configuration, make sure it is only decoding DTS, so that LAV Audio continues to handle all other formats.)

Also, for anyone interested in actually learning about video playback, rather than just blindly following instructions, I highly recommend checking out the doom9 forums, it's probably the single largest repository of ripping, encoding, and playback information on the internet.
Some of the developers of software used in this tutorial also post there, such as Nevcairel, (LAV filters); Haali, (Haali splitter/renderer); and Madshi, (madVR, madFLAC). The MPC-HC project also started there.

Lastly, this guide is not intended to serve as a be-all, end-all of video playback. There are many exceptions to what has been posted above, and many things left unexplained, or explained only very briefly. It also doesn't cover the more pedantic audio streaming options, for example, and simply uses the default directsound audio output.
I could write several hundred words comparing the merits of, say, xy-VSFilter, ISR, and libass, but there isn't really any need to delve into such detail here. The information is (somewhat) readily accessible (read: doom9) and I really do strongly encourage those interested in the actual workings of this software to take out the time to do some reading there. Doing so has certainly been a very rewarding and useful experience for me, and this is a topic that I think far too few people take a genuine interest in.

At any rate, I hope this proves of some use.
 
Back