Log in

View Full Version : Real-time AVISynth Filtering for DVDs?


Typhoon859
15th February 2009, 03:50
I currently have the following code in FFDShow which works for all my DivX, XVID, and h264 encoded videos.
Import("C:\Program Files (x86)\AviSynth 2.5\plugins\LimitedSharpen.avs")

ConvertToYV12()
ColorMatrix(mode="Rec.601->Rec.709")
crop(2,2,-2,-2,true)
UnDot().hqdn3D(0,1,1,4.5).LimitedSharpen(ss_x=1.0,ss_y=1.0,Smode=3,strength=32)
Lanczos4Resize(1280,720)

From what I understand, FFDShow doesn't support MPEG-2 support, so how do people get AVISynth to work with DVDs/DVD-rips?

J_Darnley
15th February 2009, 04:07
ffdshow has supported MPEG-2 for quite some time (all the time I have been using it). DVD playback using it used to be flakey but it is better now (using ffdshow-tryouts). If you don't want ffdshow decoding MPEG-2 then you could use it as a raw video filter to convert raw video into RGB and then use the Avisynth section in there.
And most DVD rips aren't MPEG-2, they are usually encoded into MPEG-4 or H.264.

Typhoon859
15th February 2009, 04:09
ffdshow has supported MPEG-2 for quite some time (all the time I have been using it). DVD playback using it used to be flakey but it is better now (using ffdshow-tryouts). If you don't want ffdshow decoding MPEG-2 then you could use it as a raw video filter to convert raw video into RGB and then use the Avisynth section in there.
And most DVD rips aren't MPEG-2, they are usually encoded into MPEG-4 or H.264.

I'm talking about VOB DVD-rips, not the encodes...

And uh, how do I get FFDShow to decode DVD-playback. Where's the option for it?

J_Darnley
15th February 2009, 04:13
Hidden with the rest of the codec options. Select MPEG-2 and then look at the bottom of the window for the checkbox.

Typhoon859
15th February 2009, 05:43
Hidden with the rest of the codec options. Select MPEG-2 and then look at the bottom of the window for the checkbox.

Oh! I found it. I'm surprised I missed it. Which decoder should I choose? Libavcodec or libmpeg2?

Typhoon859
15th February 2009, 06:27
Hmmm.. Well, I got it to work for DVD VOB rips but not when it's directly from the DVD. I chose the libavcodec since that's what I saw used for all the other ones. So, what do I do now?

Fizick
15th February 2009, 11:03
Typhoon859,
try get answer in ffdshow-related thread.
http://forum.doom9.org/showthread.php?t=120465

Typhoon859
15th February 2009, 11:29
Typhoon859,
try get answer in ffdshow-related thread.
http://forum.doom9.org/showthread.php?t=120465

Alright, thanks. This went more towards this direction than AVISynth. Didn't know where to go with this at first.

Leak
15th February 2009, 11:55
Hmmm.. Well, I got it to work for DVD VOB rips but not when it's directly from the DVD. I chose the libavcodec since that's what I saw used for all the other ones. So, what do I do now?
For AviSynth filtering you might be better off with libmpeg2 as it'll work better with static DVD menus, unless someone has ported my changes to libavcodec as well.

But still - I've always used ffdshow to play DVDs in MPC (or MPC-HC, lately) the last few years, so it should work for you as well. Which player are you using?

np: Tommy Graham - Sahajiya (A Monstrous Psychedelic Bubble Vol. 1 (Disc 2))

Typhoon859
15th February 2009, 12:00
For AviSynth filtering you might be better off with libmpeg2 as it'll work better with static DVD menus, unless someone has ported my changes to libavcodec as well.

But still - I've always used ffdshow to play DVDs in MPC (or MPC-HC, lately) the last few years, so it should work for you as well. Which player are you using?

np: Tommy Graham - Sahajiya (A Monstrous Psychedelic Bubble Vol. 1 (Disc 2))

Maybe if I change it to libmpeg2 it'll work for DVDs. I'm also using MPC. Thanks.

Adub
15th February 2009, 12:05
Be sure to disable the internal decoder in MPC as well, so that you are actually using ffdshow's implementation.

Typhoon859
15th February 2009, 12:47
Be sure to disable the internal decoder in MPC as well, so that you are actually using ffdshow's implementation.

What specifically do I have to disable? I've tried unchecking everything DVD and MPEG-2 related already and it's still not working.

Leak
15th February 2009, 12:54
What specifically do I have to disable? I've tried unchecking everything DVD and MPEG-2 related already and it's still not working.
Disabling the MPEG2 Video transform filter in MPC-HC's "Internal filters" section should do the trick...

np: Leila - Mollie (Blood, Looms & Blooms)

Typhoon859
15th February 2009, 12:57
Disabling the MPEG2 Video transform filter in MPC-HC's "Internal filters" section should do the trick...

np: Leila - Mollie (Blood, Looms & Blooms)

Yeah, I disabled that. It didn't work. Now, some Dscaler MPEG2 decoder is working instead of FFDShow.

Konrad Klar
15th February 2009, 14:30
Use tool like GSPot to lowering MERIT of Dscaler filter or to increasing MERIT of FFDShow.
If more than one of installed DS filters accepts given mediatype (e.g. MPEG2_VIDEO) as input, then usually DS filter with higher MERIT is used.

If you don't want to make global (for whole system) changes, use External Filters section in MCP's options. Add Dscaler filter to list and choose Block for it (or add FFDShow and choose Prefer, or change MERITs for both filters to desired values).
That settings are effective only within MPC. I've found it useful for porposes of testing DS filters.

Typhoon859
15th February 2009, 20:22
Use tool like GSPot to lowering MERIT of Dscaler filter or to increasing MERIT of FFDShow.
If more than one of installed DS filters accepts given mediatype (e.g. MPEG2_VIDEO) as input, then usually DS filter with higher MERIT is used.

If you don't want to make global (for whole system) changes, use External Filters section in MCP's options. Add Dscaler filter to list and choose Block for it (or add FFDShow and choose Prefer, or change MERITs for both filters to desired values).
That settings are effective only within MPC. I've found it useful for porposes of testing DS filters.

Lol it's being so stubborn. I actually had the FFDShow Video Decoder set to "Prefer". So far, I've had to add and disable the DScaler Mpeg2 Video Decoder, Cyberlink Video/SP Decoder (PDVD7), Microsoft MPEG-2 Video Decoder, and the MPC - MPEG-2 Video Decoder (Gabest). After I disabled all of those, it just didn't work then. FFDShow just isn't wanting to play the streams from the DVDs for some reason.

EDIT: Under Media Types in the FFDShow Video Decoder, I added every possible option for MPEG-2 streams and DVD Navigation and it still doesn't work at all with the others disabled.

Jeremy Duncan
16th February 2009, 00:31
See Link (http://forum.doom9.org/showthread.php?t=115727) for how.

Typhoon859
16th February 2009, 11:50
See Link (http://forum.doom9.org/showthread.php?t=115727) for how.

Alright. Yeah, thanks. That worked. I got it to work now. There is a problem I'm experienced though which I doubt can be fixed. In the menus, there's a star that appears based on what is selected. Most likely due to the resize, the star appears far more up and to the left than it should be. Is there any way to fix that?