Direct3D output is blurring video

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
eltouco
Blank Cone
Blank Cone
Posts: 89
Joined: 04 Dec 2007 21:32
VLC version: 2.0.5
Operating System: Windows 7 x64
Location: France

Direct3D output is blurring video

Postby eltouco » 10 Jan 2008 23:25

Hi all,

I've noticed that when using Direct3D as video output in VLC preferences, the video is a bit blurry (the edges of the image are blur) even when the video is displayed at its native size.
When using DirectX as output, the display look fine (sharp edges)

is it a bug or a feature ? :)

since I've read that Direct3D will be the default mode with Vista, I'm wondering if this rendering is also the same with Vista (for information, I'm using Windows XP directX 9.0c with an ATI x850XT graphics cards)

Thanks for your contributions

Touco

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Direct3D output is blurring video

Postby Jean-Baptiste Kempf » 10 Jan 2008 23:28

It is a bug.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

eltouco
Blank Cone
Blank Cone
Posts: 89
Joined: 04 Dec 2007 21:32
VLC version: 2.0.5
Operating System: Windows 7 x64
Location: France

Re: Direct3D output is blurring video

Postby eltouco » 12 Jan 2008 15:08

It is a bug.
Hi thanks for your answer,

is the correction of this bug inthe scope of VLC next release ? ( 0.9 ?)

Touco

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Direct3D output is blurring video

Postby Jean-Baptiste Kempf » 12 Jan 2008 18:25

Not that I know... Help will be appreciated.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Direct3D output is blurring video

Postby VLC_help » 12 Jan 2008 19:44

Can you get screen capture that shows this issue?

eltouco
Blank Cone
Blank Cone
Posts: 89
Joined: 04 Dec 2007 21:32
VLC version: 2.0.5
Operating System: Windows 7 x64
Location: France

Re: Direct3D output is blurring video

Postby eltouco » 13 Jan 2008 14:33

Can you get screen capture that shows this issue?
Hi

sorry for the delay, but I had to find that will not cause problem of copyright and will not too moving scene (since VLC can not seek at the frame precision it is difficult to have the same ouput image with directx and direct3D)

Here you are, all the capture where made using ALT-Print, no resize where made with vlc

An image with directX ouput, all the edge of the letters are sharp
Image

the same image with direct3d ouput, the edge are blur
Image

another one with directx ouput, it is less difficult to see the difference, since the edge are not really sharp
Image

the same with direct3d
Image

anothe one, with directx ouput, the image details are sharp
Image

the same with direct3d ouput, it is then blurry
Image

also, here is an article I found about the Video Mixing Rendere (I guess that is the engine fore rendering video with Direct3D)
http://www.virtualdub.org/blog/pivot/entry.php?id=92, search for blur
here is an extract
...What can cause a blur is forcing full-scene antialiasing (FSAA) on in the driver. Supersampling causes multiple texture samples to be taken per pixel and blended together, which blurs the result. Even though multisampling writes the exact same color value into every subpixel, it too can blur the video because a blur post-pass is done over the result. If you have FSAA forced on, try turning it back to Application Controlled and see if that helps.
...



I can develop myself, and would like to help, but I know nothing about directx programming :(

Hope it will help

Touco

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Direct3D output is blurring video

Postby Jean-Baptiste Kempf » 13 Jan 2008 17:57

This is a very interesting post. damienf should look at it. What about opening a bug request on that one ?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

eltouco
Blank Cone
Blank Cone
Posts: 89
Joined: 04 Dec 2007 21:32
VLC version: 2.0.5
Operating System: Windows 7 x64
Location: France

Re: Direct3D output is blurring video

Postby eltouco » 13 Jan 2008 18:59

This is a very interesting post. damienf should look at it. What about opening a bug request on that one ?
I've just opened a ticket and assigned it to damienf

here is the ticket
ticket 1434

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Direct3D output is blurring video

Postby VLC_help » 15 Jan 2008 14:36

And you are sure you haven't enabled AA from your display adapters control panel?

eltouco
Blank Cone
Blank Cone
Posts: 89
Joined: 04 Dec 2007 21:32
VLC version: 2.0.5
Operating System: Windows 7 x64
Location: France

Re: Direct3D output is blurring video

Postby eltouco » 15 Jan 2008 21:17

And you are sure you haven't enabled AA from your display adapters control panel?
I have an ATI cards, (precisely ATI X850XT 256 MO) only the drivers are installed, not the Catalyst control panel that I have uninstalled, considering that it is not useful for me.

I could install it, see if the setting you mention existes and is somehow "by default", then disable it and make new tests.
I'll keep you update, but anyway, even if it is the case, to my point of view VLC should take over a default setting for the display it needs to render, therefore a correction would also be needed in that case.

Can someone else reproduced this bug ?

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Direct3D output is blurring video

Postby VLC_help » 16 Jan 2008 16:53

ATItool and other GPU overclocking software also have this possibility to change AA, AF etc.

Image
video with GDI output.

Image
video with D3D output.

Image
video with D3D output and 6x AA (using ATI x1100)

in my case it doesn't matter.

eltouco
Blank Cone
Blank Cone
Posts: 89
Joined: 04 Dec 2007 21:32
VLC version: 2.0.5
Operating System: Windows 7 x64
Location: France

Re: Direct3D output is blurring video

Postby eltouco » 16 Jan 2008 20:44

Hi,

Thanks for your contribution.

it may be a silly question, but to make sure, between each change in the setting (directx->direct3d) did you quit and relauch VLC ?

i will make new tests by changing setting in Catalyst control center (I have to install .NET before... :evil: ) but to my point of views, VLC should overcome this settings, moreover if there is no resize I don't understand why a kind of anti-aliasing filter is applied ??

to precise my configuration, I have windows XP service pack 2, directx 9.0c and an ATI card x850XT, latest drivers and no catalyst control center, what is your configuration ?

Touco

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Direct3D output is blurring video

Postby Jean-Baptiste Kempf » 16 Jan 2008 20:57

This is a good question... Can we disable AA from the application for all vendors ?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

eltouco
Blank Cone
Blank Cone
Posts: 89
Joined: 04 Dec 2007 21:32
VLC version: 2.0.5
Operating System: Windows 7 x64
Location: France

Re: Direct3D output is blurring video

Postby eltouco » 16 Jan 2008 21:24

This is a good question... Can we disable AA from the application for all vendors ?
I made a new test.
this time with Catalyst Control Center (the last one 8.1 that has just been updated today)

here are the setting I found under the control center

under 3D

Anti-aliasing, smoothvision HD:Anti-Aliasing : "use application setting" is set
Adaptive Anti-Aliasing : Enable Adaptive Anti-Aliasing is unset
Smoothvision HD : Anisotropic Filtering : : "use application setting" is set

So, every setting related to antialisaing are either unset or left to the application.

I still have the same problem with Direct3D
[edit] I made a new test, this time by setting anti aliasing to any value in contol center (x2 or x4 or x6), then the problem does not occur ! but when i set it to "application managed" the problem occurs again[/edit]

I had a look at direct3d.c in module/video_output, I made some search about the direct3d function used, I found nothing "obvious" that could explain the problem, but my knowledge of DirectX programming is close to zero, someone more experimented should take a look a it. the only thing I've noticed (and I don't think it has something to do with the problem, is that the vertex processing used is software and not hardware, there is no test to check the graphic card capabilities)

Touco

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Direct3D output is blurring video

Postby VLC_help » 17 Jan 2008 19:36

I tested again with my Vista computer and you are right. Direct3D output is mushy. This computer has Nvidia 7900 GT so I guessing the problem is in VLC and not in drivers because in this case AA settings didn't change output.

Image
Vista Direct3D

Image
Vista DirectX

EDIT:
I also tested with nightly builds. Same thing with them.
I also checked source http://www.koders.com/c/fid90D03349FF99 ... 27EF9.aspx from there. By comparing those screenshots it seems Direct3D output does some scaling and moving, because video ain't same position which would explain a lot. Also instead of IDirect3DDevice9_SetSamplerState(p_d3ddev, 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
you could use
IDirect3DDevice9_SetSamplerState(p_d3ddev, 0, D3DSAMP_MAGFILTER, D3DTEXF_ANISOTROPIC);
or
IDirect3DDevice9_SetSamplerState(p_d3ddev, 0, D3DSAMP_MAGFILTER, D3DTEXF_PYRAMIDALQUAD);
or
IDirect3DDevice9_SetSamplerState(p_d3ddev, 0, D3DSAMP_MAGFILTER, D3DTEXF_GAUSSIANQUAD);
when video hardware supports those. (maybe same for D3DSAMP_MINFILTER)

eltouco
Blank Cone
Blank Cone
Posts: 89
Joined: 04 Dec 2007 21:32
VLC version: 2.0.5
Operating System: Windows 7 x64
Location: France

Re: Direct3D output is blurring video

Postby eltouco » 19 Jan 2008 14:48

Hi,

thanks for testing this further and for having a look at the source code.
I'm glad to see that there is in fact a correction to make and it seems you found the solution.

But who is able to analyse the directX code and make the correction to it ? I've opened a ticket but it seems that no one is working on it.


Touco

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Direct3D output is blurring video

Postby VLC_help » 19 Jan 2008 18:43

My suggestions don't fix the issues (D3DSAMP_MAGFILTER). They only make scaled picture look better =) And it seems that funman has something to do with that file. I looked code little more. Suggestion for D3DCREATE_HARDWARE_VERTEXPROCESSING instead of D3DCREATE_SOFTWARE_VERTEXPROCESSING might reduce CPU load but again it has to be verified that GPU supports that.

If I understand code correctly only things that have an effect to output are
f_width = (float)(p_vout->output.i_width);
f_height = (float)(p_vout->output.i_height);
or at least I couldn't find projection matrix or anything like that from code (I am haven't really coded with D3D, only OpenGL but I guess principles are very similar).

With little trial and error I found the issue (or at least I think so). With Direct3D output pixels of bottom row and right column are removed and after that image is scaled to video resolution.

Issue might be off by one error in texture creation or something similar. It would be easy to find out what causes that error but i don't have time or compile environment for debugging.

Image
I made black image and added white lines which are those pixels that will vanish. Then I used Virtualdub to convert that image to video. Which you can download. With Direct3D output you can't see anything white.

eltouco
Blank Cone
Blank Cone
Posts: 89
Joined: 04 Dec 2007 21:32
VLC version: 2.0.5
Operating System: Windows 7 x64
Location: France

Re: Direct3D output is blurring video

Postby eltouco » 19 Jan 2008 23:18

I've dowloaded your video and tried it over different player.

with VLC (directx output) no white lines
with Media Player Classic, I see white lines on right and bottom
with Windows Media player I see white lines

It would be interessting that someone explains the point of using direct3D to output video.
by reading the code I see the use of vertex and texture, why is it useful for 2D images ? (I don't mean it is not useful, I'm just asking)

in VLC documentation, I coudn't find something about the difference between direct3D ouput and DirectX output, if the choice is proposed to the user, no info is given to make a decision to choose one or another.

Explanation are welcome ! :D

Touco

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Direct3D output is blurring video

Postby Jean-Baptiste Kempf » 20 Jan 2008 06:17

Vista and Aero are the explanation
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Direct3D output is blurring video

Postby VLC_help » 21 Jan 2008 17:32

With textures you can offload some work from CPU and let GPU do some stuff like scaling and colorspace conversions. Also with Direct3D enabling font support, scaling, transformations, flips, shader effects etc are much easier to do and much less prone to errors.

eltouco
Blank Cone
Blank Cone
Posts: 89
Joined: 04 Dec 2007 21:32
VLC version: 2.0.5
Operating System: Windows 7 x64
Location: France

Re: Direct3D output is blurring video

Postby eltouco » 21 Jan 2008 21:30

Vista and Aero are the explanation
Sorry, it may be a "newbie" question (I don't have Vista and i didn't find info about it), but you mean DirectX output is not compatible with Vista ?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Direct3D output is blurring video

Postby Jean-Baptiste Kempf » 21 Jan 2008 22:00

Vista and Aero are the explanation
Sorry, it may be a "newbie" question (I don't have Vista and i didn't find info about it), but you mean DirectX output is not compatible with Vista ?
You are right... DirectX is not compatible with Aero.

Overlay and hardware acceleration too are removed from Vista...

If you want to complain http://www.microsoft.com
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

eltouco
Blank Cone
Blank Cone
Posts: 89
Joined: 04 Dec 2007 21:32
VLC version: 2.0.5
Operating System: Windows 7 x64
Location: France

Re: Direct3D output is blurring video

Postby eltouco » 21 Jan 2008 22:09

Vista and Aero are the explanation
Sorry, it may be a "newbie" question (I don't have Vista and i didn't find info about it), but you mean DirectX output is not compatible with Vista ?
You are right... DirectX is not compatible with Aero.

Overlay and hardware acceleration too are removed from Vista...

If you want to complain http://www.microsoft.com
As long as I have an alternative with a direct3D output with sharp image that's fine to me :)

I hope the correction of this bug will be found, because if I move to Vista (maybe Vista 64 bits with VLC 64 bits ?) I don't want to change my habits to a new video player

Touco

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Direct3D output is blurring video

Postby VLC_help » 23 Mar 2008 23:27

Okay, I added small patch that makes this issue little better.
Image
Old
Image
New

eltouco
Blank Cone
Blank Cone
Posts: 89
Joined: 04 Dec 2007 21:32
VLC version: 2.0.5
Operating System: Windows 7 x64
Location: France

Re: Direct3D output is blurring video

Postby eltouco » 03 May 2008 01:00

Okay, I added small patch that makes this issue little better.
In which version this patch can be found ?

I read on the vug tracker that this issue is supposed to be solved in VLC 0.9

Thanks

Touco


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 60 guests