HD Video Decoding on GPUs with VLC 1.1.0
by Ganesh T S on June 25, 2010 4:35 AM EST- Posted in
- Home Theater
- HTPC
The first version of this article has elicited passionate responses from many readers. Some people have come out in support of VLC, while others are proponents of MPC-HC or Windows Media Player, with a preference for some codec packs. This is the sort of comparison I really didn't want to make in the article. However, I do feel it is now pertinent to add a few notes.
VLC's Target Audience
VLC is targeted at the lowest common denominator of computer users. We are talking about users for whom the average Anandtech reader actually sets up a newly purchased PC or does tech support for. This is not to say that VLC doesn't have its utility for power users. There is no 'one-size-fits-all' media player. VLC used to be one, but with the advent of HD media, it ceased to be. MPC-HC is trying to be one, but it is not so convincing in its current state.
VLC is Bloatware
A reader in a private communication accuses VLC of being bloatware, and praises MPC-HC for being light and fast. VLC used to be light and fast in its early days too. As more and more functionality is added, and people request more and more features, there is no guarantee that MPC-HC will continue to remain so. Software application development goes through these stages, and past a particular point, it becomes bloatware (Adobe Acrobat Reader is a case in point). At some point or the other, the developers realize this, and rewrite parts of the application / implement acceleration of some sort. I hope (and believe) VLC's development is at that stage now. It is probably too late for VLC to shift to the approach used by MPC-HC / mplayer-VDPAU of having separate development for Windows and Linux platforms. This could have resulted in more efficient code.
One also has to remember that VLC has support for more file formats and containers than any other player considered standalone. It is a framework, with support for scripting in order to further functionality (using Lua). Consider a RMVB file with RMVB video and Cook audio. VLC has had the capability to play such a file since the last 5 or 10 releases. I just tried opening one in MPC-HC, and ended up with a 'cannot render pins in graph because some codec or filter not installed'. On the same system, at the same time, VLC plays back the file without issues. If a tech noob sees this, would you fault him for preferring VLC to MPC-HC? Despite being a power user, I believe in installing as few programs / codec packs as possible in order to get the file to playback, and VLC fits this criterion. Yes, we all know RMVB is on the way out, but that is no excuse not to support it.
VLC's DXVA Implementation
The VLC developers are more interested in the framework and multi-platform support with a unified code base, rather than just the media player capability. I do have my reservations about their approach, in case they want to compete with MPC-HC's capabilities. I see comments on the article comparing DXVA acceleration on MPC-HC with that of VLC right now, and declarations that MPC-HC is light years ahead. Of course, and that is the reason why MPC-HC is not shown in the graphs. Let us give some chance to VLC to improve their DXVA implementation. MPC-HC has been implementing DXVA since March 2007. It has taken them 3 years to come where it is now. VLC has just started out on this. It is not fair to put them down for this reason.
That said, I am not sure the VLC developers reached out to the GPU vendors enough. A quick search on various AV forums / Google reveals technical contacts for Nvidia and Intel. ATI is a different story, but we do see some marketing managers on Twitter (like CatalystMaker). I am sure all three would have been more than willing to help out a project like VLC. The GPU acceleration could have been in RC versions till all the kinks were ironed out. To the defence of the developers, they do mark the feature as 'experimental'.
Wait! MPC-HC is more popular than VLC!
A reader in a private communication took issue with my statement that VLC is much more popular than MPC-HC. While it might be difficult to quantify this statement, the reader went on to suggest that this was completely false. I was curious and wanted to dig up some numbers. For statistical purposes, as of 25th June, 2010, SourceForge reports less than 10 million downloads of MPC-HC (all standalone filters / 32 and 64 bit versions put together) since v1.0.4 (last 4 years). On the other hand, VLC on the Windows platform seems to have had more than 150 million downloads (and this doesn't include the latest release) since v1.0.0 (last 1 year). Given these statistics, VLC seems to be more popular, though I do agree that MPC-HC has some advanced technical merits.
The reader also happened to mention that, according to MPC-HC's project manager, Microsoft told him MPC-HC is the second most used video player on Windows after WMP (can't beat the bundled apps). I have been keeping track of MPC-HC development on Doom9 on and off, and vaguely remembered something like this being discussed over there. I managed to dig up three posts, one on why MPC-HC's executable name was changed from mplayerc.exe to mpc-hc.exe, and the other two detailing some communication from Microsoft regarding the high volume of MPC-HC crash reports.
Apparently, mplayerc.exe crashed so often on Windows systems a year or two back, that Microsoft got flooded with error reports from customers noting MPC-HC as the culprit. I am unable to find a statement from tetsuo55 (MPC-HC project manager's username on Doom9) on the net backing up what the reader sent in, but if it is true, I think it is easy to see why Microsoft may have reported that MPC-HC is the second most popular media player (I don't think they have any way to track which media player is being used on their OS, other than by using the error reports, right?)
I am not suggesting that MPC-HC is unstable (after all, these error reports were from the original Media Player Classic, and the issues have been fixed for quite some time now) or denying that MPC-HC is currently the best option to play HD videos on Windows, but when one considers the whole ecosystem (SD as well as HD video, and all codecs and file formats), I would think VLC has a much larger installed base. This is also supported by the download statistics at the beginning of this section.
VLC - One of the Best Open Source Softwares?
One reader in a private communication took offence when I termed VLC as one of the best open source softwares of all time, citing that MPC-HC annihilated it on Windows and Mplayer / VDPAU did the same on Linux. He also cited frequent commits and community activity in the MPC-HC repository as indications that MPC-HC deserved recognition as a better open source software than VLC. While his statements on performance may be true, we believe one should not take away credit from VLC, considering where and how it started, and where it is now. MPC-HC is indeed a great program with a very active development community. So, the commits and updates to the program are frequent. However, one also has to note that the project is quite new compared to VLC, which is much more stable and already has had a lot of development behind it.
The problem with VLC is that its initial development was done in the days when GPU acceleration of video decode was unheard of, and HD videos were non-existent. It is now trying to cover lost ground, and this must definitely be appreciated and supported. It has started taking steps on the way to becoming the Swiss army knife of the media player world once again. I would also offer the opinion that VLC developers should take some leaves out of the MPC-HC books in order to implement DXVA better. After all, one of the biggest advantages of being open source is co-operation. There is always space for two players in this field.
Note on Codec Packs
Codec packs are usually a mess to maintain. Even tech savvy users find it very easy to shoot themselves in the foot. What works on one system might conflict with another system (unless it is a clean and fresh OS installation). So, it is probably not something one should consider for the type of users mentioned in the first section on this page.
Just for disclosure purposes, I repeat one of my comments here: On my HTPC, MKV / M2TS files default to MPC-HC, while all other formats open in VLC. No codec packs are installed. I love MPC-HC for providing me with the best interface and experience while watching high definition stuff, but that doesn't mean I consider VLC any less worthy for what it does.
74 Comments
View All Comments
MGSsancho - Friday, June 25, 2010 - link
What software did you use to test DXVA compatibility? Also if possible where can we get a hold of it? :)Per Hansson - Friday, June 25, 2010 - link
It is "DXVA Checker"You can doiwnload it here;
http://bluesky23.hp.infoseek.co.jp/en/index.html
barniebg - Friday, June 25, 2010 - link
Come on, the most important benefit of using a GPU to decode video is the fact that you can apply hardware deinterlacing. VLC deinterlacing is nowhere near even remotely comparable to any GPU.MGSsancho - Friday, June 25, 2010 - link
I am disappointed as well but applaud VLC for being another competitor in this very important arena.CSMR - Friday, June 25, 2010 - link
Deinterlacing is a legacy concept relating to content produced with CRTs in mind. It is not important in the modern world. If you have content that is interlaced, your encoding software should deal with it, or else download a better version.probedb - Friday, June 25, 2010 - link
What about those of us that don't want to reencode video? Or that play DVDs back from the drive.De-interlacing is still very much required.
mckirkus - Friday, June 25, 2010 - link
DVD content is stored as progressive (480p) On an old CRT/Tube TV, the DVD player interlaces the content (480i) so it is compatible with the TV.I can't think of any digital content that is stored in interlaced format these days.
mckirkus - Friday, June 25, 2010 - link
(ok, no edit button, non HD tv is interlaced, as is 1080i broadcast ATSC). I should have said DVDs and Blu-Ray are not interlaced.flanger216 - Sunday, June 27, 2010 - link
Swing and a miss, #2. Try again, please.TONS of DVDs are interlaced, both from PAL and NTSC regions. Plenty of content --- HDV and tape sources, for starters --- has never been anything other than interlaced, right from camera acquisition, and is directly encoded from the interlaced source to an interlaced DVD... for obvious reasons.
Many film-based DVDs released prior to 2000 or so are also interlaced, because they were encoded from old cable, laserdisc and VHS masters. Also, heaps of low-budget and foreign (especially Asian) DVDs are made from interlaced masters, due to old or subpar equipment, or simply because interlaced workflows are often cheaper.
And NO, your "encoding software" should NOT "deal with it." Deinterlacing prior to encoding gives you the following options: you can deinterlace to half-resolution and encode w/ a good bitrate but with poor quality, or you can deinterlace to full-resolution, but that'll require a doubled frame-rate and, obviously, doubled file-sizes. Interlaced sources should always be encoded to interlaced targets and deinterlaced during playback, preferably by a high-quality temporal/spatial filter @ a doubled frame-rate. Realistically speaking, you're only going to get that from a GPU (or a smokingly fast CPU running one of the newer software deinterlacers).
WHY do people write things that are flatly untrue?
electroju - Monday, June 28, 2010 - link
I agree, but all DVD movies that I have are interlace. Yes, even the latest movie from 2007 is interlace. I am sure that Blu-ray and HD-DVD are interlaced as well. Like you said, these interlace content have to be set at double the frame rate and be de-interlaced to view correctly on a progressive screen. Though a 3:2 pull-up also have to be used to keep within 24 frame rate of the movie, but this adds distortion.Not all codecs are compatible with interlace content, so the video have to be deinterlace. This means double frame rate and adding 3:2 pull-up if it needs it.
There are dozens of deinterlace algorithms. Not one will suit every content. The only programs that I know that include most of the deinterlacing algorithms is dscaler and tvtime.
None of the GPU that I know of actually increases the frame rate, so you are back where you started. In order to do it right, it is do the post-processing task with the CPU. Though there is a compromise between loading the CPU to 100% and not using the GPU or using the GPU and have fraction of the CPU being utilized.