Friday, June 5, 2009

Fixing Poor Video Playback Quality and Jagged Edges in Windows 7 x86 and Windows 7 x64

Playing video on machines powered by Nvidia GPUs, Windows 7 x86/x64’s own Windows Media Player (WMP) video playback quality is just fine, but when it comes to any other player such as Media Player Classic - Home Cinema (MPC-HC) or VLC media player, jagged edges are annoyingly obvious, especially when the video is resized. Well, an MPEG-2 PAL video (DVD format) stored at 720x576 (4:3) is displayed at 768x576, that’s simply called resizing!

Sample video rendered using default renderer Sample video rendered using EVR

The sample video frame on the left demonstrates Windows 7’s poor video quality and the aliasing artifacts caused by the absence of a filter which should make jagged edges smooth. The aliasing artifact is apparent on the outer edge of Lili Haydn’s nose, and also on the ribbon of the horsehair of her fiddlestick. On the right, the filter in Enhanced Video Renderer (EVR) smoothed jagged edges, making video quality much more acceptable. One of the other things such filters do is to make colors more vivid, which could be clearly observed on the right side snapshot as it’s more colorful and vivid comparing to the one on the left. The frame snapshot’s saved PNG size is a good quality measure and detail comparison between the jagged video (151kB) and when it’s smoothed via EVR (652kB). (Credit: Lili Haydn’s violin solo with George Clinton & Parliament-Funkadelic live at the 38th Montreux Jazz Festival 2004)

In the video domain, aliasing artifacts can appear as wavy lines or bands, or moiré patterns, or popping, strobing, or as unwanted sparkling, emphasizing the poor video quality, caused by jagged edges.

Smoothing jagged edges is omitted when the video is played in Windows 7 using the default renderer in Media Player Classic - Home Cinema (MPC-HC) or VLC media player on Nvidia-powered systems.

To fix the problem, you need to install the latest WHQL driver located at nvidia.com/page/drivers.html, and then enable Enhanced Video Renderer (EVR) in your player’s options.

As an older alternative to EVR (Enhanced Video Renderer), you can also choose VMR9 (Video Mixing Renderer). The VMR was first made available for the Windows XP platforms only. Beginning with DirectX 9.0, a separate version of the VMR, called the VMR-9, is available for redistribution on all platforms supported by DirectX. The two VMR filters are very similar in their implementation and the interfaces that they expose. The primary difference is that the original VMR (now called the VMR-7) uses DirectDraw 7 internally to control the video hardware, while the new version of VMR (called the VMR-9) uses Direct3D 9.

To make use of the Media Player Classic - Home Cinema’s internal subtitle renderer, select either of the “EVR Custom Pres.” or “VMR9 (renderless)”, since both their alternatives—“EVR (Vista/.Net3)” and “VMR9 (windowed)”—fail to provide the pixel shaders to the soft subtitle filter. Please note the softsub renderer inside MPC-HC—Gabest’s DirectVobSub (VSFilter.dll)—is a horrendous CPU hog, so be alarmed to the excessive CPU usage. Another problem with the alternatives is “EVR (Vista/.Net3)” doesn’t provide the practical picture scaling (pan & scan) feature, locking the picture at its original scales.

[Updated February 8, 2010]

Because 3D surfaces are required for image scaling, image rotation, and pixel shaders, with the EVR Custom Presenter/VMR output filters chosen in Media Player Classic - Home Cinema v1.3.1249.0 on a non-gamer’s Windows 7—with no Direct3D engine installed—MPC nags about “No D3DX9 dll found. To enable stats, shaders and complex resizers, please make sure to install the latest DirectX End-User Runtime. Warning creating EVR Custom renderer.” To overcome this issue, download and install DirectX End-User Runtime using Microsoft’s newly-published intelligent DirectX End-User Runtime Web Installer.

رفع عیب پخش بی‌کیفیت ویدیو و لبه‌های دندانه‌دار و ناهموار در ویندوز ۷ ۳۲-بیت و ویندوز ۷ ۶۴-بیت

هنگام پخش ویدیو در رایانه‌های دارای پردازنده‌های گرافیکی ان‌ویدیا در ویندوز ۷ ۳۲بیتی و ۶۴بیتی در ویندوز مدیا پلیر هیچ مشکلی وجود ندارد. اما اگر از پخش‌کنندهٔ دیگری مانند مدیا پلیر کلسیک - هوم سینما (MPC-HC) یا وی‌ال‌سی مدیا پلیر استفاده کنید، متوجه لبه‌های دندانه‌دار آزاردهنده‌ای خواهید شد، علی‌الخصوص اگر ویدیو تغییر اندازه داده باشد. جالب است بدانید که یک ویدیوی پال ام‌پگ-۲ (قالب دی‌وی‌دی) که به اندازهٔ ‪۷۲۰×۵۷۶ (۴:۳)‬ ذخیره شده، در اندازهٔ ‪۷۶۸×۵۷۶‬ نمایش داده می‌شود؛ ما که به آن تغییر اندازه می‌گوییم!

نمونهٔ ویدیوی رندرشده توسط رندرکنندهٔ پیش‌فرض نمونهٔ ویدیوی رندرشده توسط ئی‌وی‌آر

ویدیوی نمونه در سمت راست، پخش بی‌کیفیت ویدیو و اثرات بدنمایی و لبه‌های دنده-دنده شده که بواسطهٔ نبود یک پالاینده برای هموار و صیقلی کردن لبه‌ها بوجود آمده را در ویندوز ۷ نمایش می‌دهد. اثرات تصنعی بدنمایی و لبه‌های ناهموار در لبهٔ بیرونی بینی لیلی هیدن و همچنین روی موی دُم اسب آرشهٔ ویولن او مشخص است. در تصویر سمت چپ، پالایندهٔ ئی‌وی‌آر لبه‌ها را صاف و هموار کرده‌است، که این مسئله ویدیو را به‌مراتب مقبول‌تر کرده‌است. یکی از وظایف دیگر این پالاینده‌ها، واضح‌تر کردن رنگ‌ها است، که با مقایسهٔ تصاویر متوجه رنگارنگ‌تر بودن تصویر سمت چپ نسبت به تصویر سمت راست خواهید شد. مقایسهٔ حجم تصاویر لحظه‌ای فریم‌ها که به قالب پی‌ان‌جی ذخیره شده اند، معیار جالبی برای درک تفاوت بسیار بالای ویدیوی ناهموار (۱۵۱ کیلوبایت) و ویدیوی هموار شده توسط ئی‌وی‌آر (۶۵۲ کیلوبایت) است. (تصاویر از: تک‌نوازی ویولن لیلی هیدن بهمراه جورج کلینتون و پارلیمنت-فانکادلیک در اجرای زندهٔ ۳۸اُمین فستیوال جز مونترو ۲۰۰۴)

در حوزهٔ تصاویر ویدیویی، اثرات تصنعی بدنمایی می‌توانند بصورت خطوط یا نوارهای مجعد، الگوهای موجدار، چشمک تصویر، جلوه‌‌های استروبوسکوپی، ‌یا بصورت جرقه یا برق ناخواسته وجود داشته باشند، که موجب تشدید بی‌کیفیتی پخش تصاویر ویدیویی می‌شوند.

صاف و هموار کردن تصاویر ویدیویی هنگام پخش ویدیو در مدیا پلیر کلسیک و وی‌ال‌سی مدیا پلیر با استفاده از رندرر پیش‌فرض اغلب در رایانه‌های مجهز به پردازنده‌های گرافیکی ان‌ویدیا در ویندوز ۷ نادیده گرفته می‌شود.

برای رفع این مشکل، نیاز دارید که آخرین افزاره‌ران ان‌ویدیای دارای مجوز دبلیواچ‌کیوال (آزمایشگاه‌های تعیین کیفیت سخت‌افزار ویندوز) قابل دسترس در nvidia.com/page/drivers.html را پایین‌گذاری و نصب کرده و سپس ‭Enhanced Video Renderer (EVR)‬ را در تنظیمات پخش‌کنندهٔ موسیقی خود فعال کنید.

بعنوان یک جایگزین قدیمی‌تر برای ئی‌وی‌آر (Enhanced Video Renderer)، شما همچنین می‌توانید از وی‌ام‌آر۹ (Video Mixing Renderer) استفاده کنید. وی‌ام‌آر نخستین بار در ویندوز اکس‌پی ارائه شد. پس از ارائهٔ دایرکت‌اکس ۹٫۰، نسخهٔ مجزایی از وی‌ام‌آر، که به آن وی‌ام‌آر-۹ گویند، برای توزیع مجدد به همهٔ سکوهای پشتیبانی کنندهٔ دایرکت‌اکس آماده شد. دو پالایندهٔ وی‌ام‌آر در روش پیاده‌سازی و میاناهای نمایانده‌شده بسیار شبیه‌اند. تفاوت عمده آنجاست که وی‌ام‌آر اصلی (که امروزه وی‌ام‌آر-۷ خوانده می‌شود) در درون برای فرماندهی سخت‌افزار از دایرکت‌دراو ۷ (رندرر دو بُعدی دایرکت‌اکس مایکروسافت) استفاده می‌کند، در حالی که نسخهٔ جدید (که وی‌ام‌آر-۹ خوانده می‌شود) از دایرکت‌تری‌دی (رندرر سه بُعدی دایرکت‌اکس مایکروسافت) استفاده می‌کند.

برای بهره‌گیری از رندرر داخلی زیرنویس مدیا پلیر کلسیک – هوم سینما، یکی از گزینه‌های ‪“EVR Custom Pres.”‬ یا ‪“VMR 9 (renderless)”‬ را انتخاب کنید، از آنجاییکه هر دو شق دیگر آنها—یعنی ‪“EVR (Vista/.Net3)”‬ و ‪“VMR9 (windowed)”‬—از ارائهٔ پیکسل شیدر‌ها به پالایهٔ نرم زیرنویس سر باز می‌زنند. توجه کنید که رندرر نرم‌زیرنویس در ام‌پی‌سی-اچ‌سی—دایرکت‌ووب‌ساب گبست (VSFilter.dll)—یک سی‌پی‌یو مصرف‌کن فجیع است، بنابراین برای مصرف افراطی پردازنده آماده باشید. یک مشکل دیگر با شق‌های دیگر این است که ‪“EVR (Vista/.Net3)”‬ امکان مقیاس کردن و تغییر نسبت اندازهٔ تصویر (پن اند اسکن) را نمی‌دهد و تصویر را در مقیاس اصلی قفل می‌کند.

[بروزرسانی ۸ فوریهٔ ۲۰۱۰]

از آنجا که سطوح سه بُعدی برای مقیاس کردن تصویر، گرداندن تصویر، و سایه‌زنی پیکسل‌ها لازم است، با انتخاب پالاینده‌های خروجی EVR Custom Presenter/VMR در مدیا پلیر کلسیک - هوم سینمای نسخهٔ ۱٫۳٫۱۲۴۹٫۰ روی ویندوز ۷ در رایانهٔ یک کاربر بازی‌نکن—بدون موتور نصب شدهٔ دایرکت‌تری‌دی—ام‌پی‌سی اینگونه نق می‌زند که ‪“No D3DX9 dll found. To enable stats, shaders and complex resizers, please make sure to install the latest DirectX End-User Runtime. Warning creating EVR Custom renderer.”‬ برای غلبه بر این مشکل، DirectX End-User Runtime را از طریق نصاب وب هوشمند آن که اخیراً از سوی مایکروسافت ارائه شده، پایین‌گذاری و نصب کنید.

14 comments:

  1. Using MPCHC on Windows Server 2008 (so probably on Windows Vista) I ended up with the following error:

    ----------------------------------------
    Error creating DX9 allocation presenter
    ----------------------------------------
    No D3DX9 dll found. To enable stats, shaders and complex resizers, please make sure to install the latest DirectX End-User Runtime.
    CreateDevice failed

    D3DERR_NOTAVAILABLE
    ----------------------------------------

    Like always, thank you for a useful detailed article. You're a genius. :-*

    --Andrea Mengele
    ReplyDelete
  2. thanks for the article, solved my problem
    ReplyDelete
  3. Actually VMR7 filters very well in Windows XP but in Vista or 7 it appears MS deleted the filtering functionality. Perhaps this was done to force developers to start using EVR as VMR9 has the same problem.
    ReplyDelete
  4. [Posted April 3, 2010 4:26 PM]

    مشکلمو حل کردی. از وقتی رو کامپیوتری که با خروجی دی وی آی به اچ دی ام آی تلوزیون پلاسمای پذیراییمون وصله ویندوز سون ریختیم، فقط موقع پخش ویدئو کلیپ به همسرم می گفتم تصویر بی رنگ و دون دونه، می گفت نه، چشمت مشکل داره! البته موقع پخش ماهواره و بازی های ویدئویی کامپیوتری مشکل نداشت بنظرم. این اختلاف تصاویر رو اکثر مردم حس هم نمی کنن، چه برسه بخوان مشکلشو حل کنن!

    خیلی خوشحالم مقاله ها تو داری به فارسی بر می گردونی. اینجوری برای ما هم قابل استفاده است.

    عاشق ادبیاتتم. همیشه برام سئوال بود نت اسکیپ چرا بین این همه آدم تو رو مدیر دیموز کرده بود... حالا می فهمم چرا.
    ReplyDelete
  5. [Posted April 3, 2010 5:41 PM]

    ممنون از لطف شما. قاعدتاً هم نباید با رندر سه‌بعدی و پخش بازی‌های رایانه‌ای و پخش دی‌وی‌بی‌-اس (ماهوارهٔ معمولی) و دی‌وی‌بی-اس۲ (ماهوارهٔ اچ‌دی) مشکلی داشته باشید؛ از آنجا که این ایراد تنها در پخش ویدیو در مدیا پلیر کلسیک و وی‌ال‌سی مدیا پلیر که از رندرر پیش‌فرض سیستم استفاده می‌کنند دیده می‌شود، علی‌الخصوص در هنگام ری‌سایز کردن فریم‌های تصویر.
    ReplyDelete
  6. Thank you very much for a good advice! You helped me to solve my problem!

    Alex
    ReplyDelete
  7. Any idea how to _disable_ this filtering (edge smoothing and color enhancement) in WMP 12 (Win7)?
    ReplyDelete
  8. Dear Komeil

    I have been reading your post regarding fixing poor video quality in windows 7.

    I wish to ask for your help.

    I have purchased a Dell laptop about three months ago. Model is: xps L501x, with 1GB Nvidia Geforce GT 420M, arrives with windows 7 home premium x 64.

    Me, too, am experiencing unsatisfied video quality on ALL player... exactly as you describe in your post: jagged edges, some flickering points here and there... whatever I tried (including codecs installation, updating all drivers of Nvidia and Intel graphics, changing resolution etc. didn't help.

    I called Dell India technical support and they tried to lead me through several troubleshooting processes that didn't "change the picture" ;-)
    Eventually they told me that since the videos are "watchable", I should settle with it !!! But I can not... it is too disturbing for me...

    Then I "bumped" into your post and felt some hope since it seems to offer a solution for this annoying problem.

    Yet, I still want to ask kindly for some clarification regarding this issue...
    Since I am not a big expert in computers, I didn't figure out which WHQL driver I should download and install... there are few of them... could you send me a link to the exact one I need ?
    Should I install it INSTEAD of the regular one ? this is the driver I was told (by Dell people) to install:

    http://www.nvidia.com/object/notebook-win7-winvista-266.58-whql-driver.html

    The other issue is : I could find where is the Enhanced Video Renderer (EVR) option in my video players options. I use vlc, bsplayer and windows media player.

    I would be so so grateful to you if you could help me in here since this issue has been bugging me for so long !!!

    I wish you all the best, brother...

    Thank you so much for sharing your knowledge and experience with all !!!

    Beautiful days to you

    Shira
    ReplyDelete
  9. Dear Shira,

    First of all, I'm happy you haven't gone for the 14-inch L401x, as its screen is one of the worst in the entire portable electronics' history.

    All the codecs you've installed worsen the experience. You should uninstall them all... and because codecs are filthy sitcky uninstallable creatures, I suggest restoring your Windows using Dell Recovery to its factory state. Forget playing media with Windows Media Player / Windows Media Center, remove them utilizing "Turn Windows features on or off \ Media Features," and stick to non-codec-based players such as Winamp for audio and MPC-HC for video. (Of "non-codec-based," I meant players packed with built-in codecs.)

    For the powerful Nvidia GeForce GT 420M packed in your laptop, the 266.58 driver you've mentioned is not the 64-bit one, and what you need is located here:

    http://www.nvidia.com/object/notebook-win7-winvista-64bit-266.58-whql-driver.html

    Uninstall the current driver and install the one above.

    Now, because EVR renders video based on Direct3D, you need to install the latest DirectX engine, located here: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=3b170b25-abab-4bc3-ae91-50ceb6d8fa8d

    Then, if you're chasing quality, you should only use Media Player Classic Home Cinema with DirectShow video output set to EVR Custom Presenter. MPC-HC is available as a 64-bit build, which makes it a top choice.

    Other players such as VLC media player, are slow and deliver poor quality. VLC is only good for when Media Player Classic Home Cinema doesn't support a few codecs, such as 3GP with AMR audio, and rare kinds of FLV.

    Regards,

    Komeil Bahmanpour
    ReplyDelete
  10. [Posted 3/15/2011 7:47 AM]
    Dear Komeil

    Again.... much thanks for your reply and detailed guidance...

    I did all according to your instructions... reinstalled windows, removed media player, installed the codecs you advised, and Mpc-Hc with the recommended configuration...

    Still, I am facing the same issue ! problem was not solved...

    After browsing the net, and reading few forums... I feel that the problem lies with Windows 7 itself... and when combined with a high quality video card, it simply doesn't give a picture as sharp as with other O.S...

    Unfortunately, Vista and xp can not be installed on this system...

    Anyway... If you still believe the problem can be solved in another way, please share with me...

    I attach a document specifies the computer components...

    I wish you all the best of what life is offering !

    And thank you again

    Shira
    ReplyDelete
  11. [Posted 3/15/2011 6:48 PM]
    Dear Shira,

    There must be a misunderstanding, as I've asked NOT to install any codecs, as codecs interfere admissible player operation.

    PowerDVD, Nero, and Adobe Premiere are among the worst codec-spreading programs, so avoid installing them.

    Also do NOT install any codec packs.

    A clean Windows 7 SP1 x64 contains exactly 103 codecs. (GSpot Codec Information lists codecs' count when opened.)

    After Windows restore and WMP removal, without any further codec installation, try MPC-HC.

    Used by one of our civil engineers, there's one of these incredible machines in the construction site I frequently visit. Maybe I can check that one...

    Hope this helps,
    Komeil Bahmanpour
    ReplyDelete
  12. [Posted 3/15/2011 7:09 PM]

    Dear Komeil

    Well... it was a mistake on my part. I did NOT install any codec pack... I meant to say: directx... and also removed the windows media player as you suggested... I followed precisely all your instructions ! (you were very clear about the codec issue...)

    Still... I faced the same issue...

    Thanks !

    Shira
    ReplyDelete
  13. [Posted 3/15/2011 7:22 PM]

    Dear Komeil

    My friend here corrects me... he says there is a clear improvement after following your instructions, and most videos are watchable... He says the quality depends on the file type... mp4 files look quite good ! most avi files are poor quality still...
    Also we have read that low resolution movies will never look sharp on high resolution screen - what is your opinion on that matter ? do you advice to change screen resolution ?

    Thank you !!!

    Shira
    ReplyDelete
  14. @Shira

    "The poor stay poor" Leonard Cohen - Everybody Knows

    You can't create what's not there, unless you're watching a Hollywood crime movie, where they exaggeratedly enlarge suspect's license plate's poor-quality snapshot, say 100X, and see what's there!

    I think you're OK. See if you can see aliasing artifacts. If they're not there, yours is just fine. What perturbed you in the first place is not there anymore, and what you see now is nothing but screen's high resolution combined with the new display technology.
    ReplyDelete







Copyright © 1999-2012 Komeil Bahmanpour. All rights reserved.


Reproduction is permitted provided that the source is acknowledged and a link is included to the relevant article.