PDA

View Full Version : ffdshow as post-process for RealVideo


karl_lillevold
2nd February 2005, 01:13
Background

I spent some time fine-tuning DVD quality playback via my HTPC on the Samsung DLP HDTV, based mostly on advice from the HTPC board on AVSForum.
http://www.avsforum.com/avs-vb/forumdisplay.php?forumid=26

I learned that the most frequently used improvement is to use ffdshow post-processing capabilities, tagged on as a back-end to MPEG-2 decoding, specifically targeted towards improving DVD quality on large resolution displays, oftentimes digitally connected (DVI).

The consensus is one can get HTPC DVD quality to be the same or better than the most high end DVD players with built-in upscaling to HD resolutions, and DVI connectors.

There is a long thread with recommended settings here:
http://www.avsforum.com/avs-vb/showthread.php?threadid=447500

It's a very long thread, but the commonalities are as follows:

- levels adjustment, oftentimes very minor
but needed for color space conversion, unless decoder
outputs YV12/I420.
- resize to a larger size than the display, most use
2X upsampling via Lanczos4 with slight Luma sharpen
- Blur & Denoise: varies depending on taste
Popular are "Gradual Denoise" and Denoise3D.
- Some extra sharpening via unsharpmask, or asharp.
- output YV12.

Rendering: VMR9 or Overlay Mixer.

Practical results:

The initial impression was astounding, with a relatively simply setup:
Display: Samsung DLP
Size of image: 46"
Viewing distance: 7-9'
Connection type: DVI
Video card: MSI Radeon 9550SE
CPU: P4 3.06 GHz @ 3.25Ghz
Memory: 512 MB

OS: Windows XP SP2
Driver: Catalyst 4.12
Output resolution: 1280 x 720
Video player: ZoomPlayer Pro 4.10b2
Video Decoder: Sonic or nVidia
Video Renderer: Overlay Mixer
Ffdshow version: 20050122 (resolved video freeze problem)

1. Levels 1-254
2. Denoise3D 0.5 0.5 5.0 (fast)
3. Lanczos4 2X resize Luma Sharpen 1.0
4. Output YV12. Overlay mixer.

I had to move Denoise ahead of resize, or I would run out of CPU cycles. Even then I am now at 75% CPU load on a 3.25 GHz P4, just to play back a DVD :) Denoise is a matter of taste. Some DVDs are really noisy. with the nice effect of Lanczos upsample, I think I prefer slight denoising ahead of it. The video is amazingly sharp and clear. Very close to what is presented as "HD Movies" on the HD channels.

Reclock

Now with the video quality much improved, one remaining problem was rather noticable jitter. Frames were not rendered accurately, and slow pans and even motion quite unbearable. This turned out to be pretty fixable with the latest version of Reclock, a replacement "audio" renderer that passes through the audio, but replaces the default clock in Directshow. I have tried this before without much luck, but now it installed and worked flawlessly. Very impressive. http://reclock.free.fr/

RealVideo

Now, finally to the matter at hand: All this can be applied to any video codec, but there have been problems in the past with RealVideo. ffdshow when used as a post-process has been known to freeze. I get green video only with the latest official RM splitter and ffdshow post-processing. Anamorphic videos are not handled correctly etc.

In order to resolve these problems you need
1) latest ffdshow:
http://www.iti.uni-stuttgart.de/~bergmats/video_mirror/videotools/ffdshow-20050122.exe
Same build may be available from other sources.

2) a fixed realmediasplitter (http://www.lillevold.com/files/RealMediaSplitter_20050201.zip). This also resolves a problem that occurs in ZoomPlayer when the old realmediasplitter left the aspect ratio as 0:0 ("invalid floating point operation (http://forum.inmatrix.com/index.php?showtopic=2127)"), and subsequent lockups.

So, in order to get ffdshow post-processing to work for RealVideo, just install the above mentioned version, in the Codecs configuration dialog set its "Raw video" support to "All supported" or at least "I420/IYUV", and enable any post-processing you like. I prefer the Resize settings mentioned above, and nothing else, for RealVideo. Levels to convert color space is not needed since realmediasplitter outputs I420/YV12 already. It is also useful to enable hotkeys in ffshow so you can easily enable or disable your filters.

For MPC you may have to adjust the AR in ffdshow Resize settings. ZoomPlayer handles this automatically.

Here is a nice guide for ffdshow post-processing for DVD playback (http://htpcnews.com/main.php?id=ffdshowdvd_1) which includes some screenshots of what can be achieved. The same differences can be seen for high bitrate RealVideo. RV screen shots available via PM or e-mail.

Oh, and of course reclock can be used for RealVideo as well. You may have to use PowerStrip to change your monitor refresh rate to match your content: 60/90 for 29.97 (NTSC), 72 for 23.976 fps, and 75 for 25 fps (PAL).

Caveats

Naturally, if your monitor / TV resolution is much below 1280 x 720 / 1280 x 1024, you may ignore all the ffdshow suggestions, but reclock is still useful.

Also, none of this works in RealPlayer. You need realmediasplitter + a DirectShow player.

If you use MPC, remember to disable its internal RealMedia Splitter / RealVideo Decoder.

Suggestions

Let me know if this is useful for anyone, or if you would like to share your favorite ffdshow settings with the rest of us.

ExtraEye
6th February 2005, 14:41
question:
why resize?
what good does it do?
i don't know much but i have a 2.4 GH pc with 256 ram so i use in postprocessing the SPP deblocking cause i heard it's the best postprocessor and limit it to half quality and use the automatic quality control.
i use levels 16-206

that's it
i would realy like to know why u use resize and how should i use it because when i tried your settings my moniyor displayed videos less good... and i also had to disable the post processing in order for it to work smoothly:(
i too use zoom player but didn't know ffdshow could play .real files.
so thx for explaining about it.
.real amvs now look better for me:)
p.s
i mainly watch anime and anime music videos on my pc

Sirber
6th February 2005, 22:48
Goal: DVD to HDTV-like picture

Not very good for anime content, but if you have the CPU, using lancoz4 resize to your screen rez, you get a more details then letting your videocard manage it, but it's a 60% more CPU uses for decoding :)

ExtraEye
7th February 2005, 14:27
what do you think is the best setup for me?(in quality)
i have:

Display: MAG innovision 19'
Video card: Gforce 4 MX 440 (yes i know it sucks)
CPU: P4 2.4
Memory: 256 RDRam

OS: Windows XP
Video Codec: FFdshow
Video Renderer: Overlay Mixer
Ffdshow version: 1 February

Sirber
7th February 2005, 15:12
For what uses? DVD playback, anime playback, rip playback?

ExtraEye
7th February 2005, 20:16
anime playback

karl_lillevold
7th February 2005, 20:31
I would try just the lanczos resize 2X, if you have enough CPU to do this. Perhaps Denoise3D (0.5 0.5 5.0), too, if your video is low-medium bitrate. Other than that, I think you will see the most improvement on natural (non-animated) video.

Sirber
7th February 2005, 20:40
Use lanczos only, for rmvb and avi files.

@Karl

Why only 2x?

karl_lillevold
7th February 2005, 21:03
Originally posted by Sirber
Why only 2x?
If you have fast enough CPU, you can try higher :) 2.5X, 3X... This will usually lead to video size higher than your screen resolution, which is fine. Video card will scale down, but the result is still better than using ffdshow to scale to your exact screen resolution.

Sirber
7th February 2005, 21:06
Yep. At 1280x960, it's around 75% CPU, while at 20% letting the card doing it.

ExtraEye
7th February 2005, 21:28
how do i set it to 2x?
in the ffdshow "settings" tab you can select lanczos but there's nothing about 2x...
also what is this lanczos4 thing? plz explain

besides
i wanted to add use the SPP deblocking and levels...

Sirber
7th February 2005, 22:09
I use avisynth for that:

http://www.avisynth.org/Resize

About SPP, you might not be able to use it, since resize uses lots of CPU.

karl_lillevold
7th February 2005, 22:29
My recommended settings:
First Check Resize & Aspect itself to enable Resize.
In ffdshow "Resize & Aspect" menu:
Check "Multiply by" and enter 2.0 in the box
in the sub-menu "Settings" (for Resize & Aspect),
choose "Method" Lanczos in the pulldown,
change Parameter to 4.00 (slider) and
change Luma Sharpen to 1.00 (slider)

Sirber
8th February 2005, 01:20
is ffdshow faster than using avisynth?

karl_lillevold
8th February 2005, 02:00
i don't know, but certainly a lot more convenient in this context. and it's really nice to enable or disable filters on the fly with keyboard shortcuts, as well as tweak the parameters while the video is playing. How would you use Avisynth to resize? Create scripts for every video you want to play back, or as a plugin in ffdshow?

Sirber
8th February 2005, 02:29
Avisynh in ffdshow :rolleyes:, with a nice checkbox :D

ExtraEye
8th February 2005, 14:18
actually it reduces quality...
more noise than the original
and small interlacing problems....

Sirber
8th February 2005, 15:07
Noise is in the source, and better preserved. About interlacing, it's in your source too (and better preserved :D).

ExtraEye
8th February 2005, 17:10
ummm
no it's not
maybe i didn't name the artifacts of the resize right but the source definatley looks better.
for now im back to postprocessing only, without any resizing
it saddens me cause i really hoped i could tweak the display
thx anyway

Sirber
8th February 2005, 17:21
It's all taste-relative, there are no perfect solutions :)

ExtraEye
8th February 2005, 19:53
im telling you it created problems
artifacts and so on...
i know there is always difference in taste but on this case there definatly isn't anything like that

karl_lillevold
8th February 2005, 19:54
Then it does not sound like you should use it. Thanks for testing. In my case I can not watch videos without ffdshow :)

Sirber
8th February 2005, 21:50
Originally posted by ExtraEye
im telling you it created problems
artifacts and so on...
i know there is always difference in taste but on this case there definatly isn't anything like that I know, and I said it's taste related. :p You do what you want.