Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 26th April 2004, 22:07   #1  |  Link
t_2
Registered User
 
Join Date: Apr 2003
Location: USA
Posts: 91
New MPEG2 Source Filter = m2v.vfp

Recently ran across a new way to open MPEG2 video in AviSynth.I stumbled across it on a Japaneese webpage, but later found a thread from a year ago here at Doom9 where senior member "JuanC" explains the process. Here is the thread for those like me who didn't know about this method:

http://forum.doom9.org/showthread.ph...987#post303987

Here is JuanC's script from the thread:

"LoadVFAPIPlugin("x:\video\m2v_vfp\m2v.vfp", "M2VVFP")
M2VVFP("F:\My shared folder\Coldplay - The Scientist.MPEG")
FlipVertical()
Reverse()"

Well, my first problem was opening the zip file containing "m2v.vfp" which had an "lzh" extension. (The link for the download can be found in the thread above. This is for version 0.6.44, but the version I had already downloaded and the only version I have tested is version 0.6.47)I found what appears to be a freeware zip program called "UltimateZip" at , you guessed it, www.ultimatezip.com which did the trick. (I have found another link for the plugin which is contained in a regular zip format at: "http://videocdr.wz.cz/downloads/example.php") Then I followed JuanC's instructions and presto, there was my video. I didn't neeed the "Reverse" command, but the video was upside down until I used "FlipVertical".

Discussion: According to JuanC this method doesn't mess up the frame count as some other source filters do. Scrolling back and forth seemed to work very well. Of course being a vfp plugin it gives you your video in RGB24, but that's fine with me because I like using filters imported from VirtualDub, like, Smart Deinterlace, Subtitler, and Hue/Saturation/intensity so YV12 color space isn't as important for me.

I didn't need to do anything else in order to open the video, but there were some executables in the zip package and I found the following thread on some other Forum explaining what can be done with them. My appologies to the author & forum as I forgot to write down this data.

Here is a quote from that thread:

"OK...The other way is to install a Certain Mpeg2 decoder so Tmpgenc can read the Vob files directly but it still will not be able to read the audio in the Vob files so you will have to use the audio file that was extracted useing DVD2AVI, and there are a few things you are going to have to do so this will work Properly....First Download this Mpeg2 Decoder
http://media.fastclick.net/w/get.med...vfp-0.6.44.lzh .....Extract the Files to a folder then put it somewere, you can even put it in the Tmpgenc install directory..Inside that folder will be a few files of intrest..First you will have to Copy and Paste the "m2v.vfp" file into the Tmpgenc install directory...Now we have to configure the Decoder, you do this by running the "m2vconf.exe" file, and a settings screen will appear, Under "aspect ratio" choose "Use",
and Under "Field order" choose "Keep oroginal Frame" and under "IDCT Algorythm" choose "Floating Point referance" , and Under "SIMD" choose all of them if you use an Intel CPU and just "SSE and MMX" if you have an Athlon...Under "Gop List" leave the boxes empty ,and under "Consecutive Numbered Files" choose "Concatenate Automatic" and with the rest leave them as they are....Now the Plugin should be installed but you have another Problem and this is that your Movie is in a Bunch of seperate Vob files and you want to encode them to one big Mpeg1/VCD file so we have to get Tmpgenc to Load all of your Vob files at once and in the correct order, To do this you will have to Re-Name your Vob files in a numerical sequence, so you Name the First Vob file something like "Movie-001.vob" and the second one "Movie-002.vob" and the Third one "Movie-003.vob" Ect with all of the Vob files, after doing this Run Tmpgenc and go to "Option" to "Enviromental Settings" and under the "General Setting" choose "Open Sequence Files as Movie"...You might also look in the "Vfapi Plugins" and see if the "Mpeg2 Video Plugin" is listed and then raise it"s Priority...Now all you have to do is Load the First Vob file "Movie-001.vob" and the rest will load in the correct order then load the Wav audio file that you got from DVD2AVI in as the audio source and then encode to VCD...Well I hope I explained it well enough and I hope everything works out good....Let me know how it turns out...Cheers

PS: the Mpeg decoder also comes with a simple Mpeg editor that you might find works better in some cases that the Tmpgenc editor....Cheers"

I Would be interested in any feedback from others who have used this method to import MPEG2 video into Avisynth. I wonder why it isn't more widely used?? Any ideas anybody?

Last edited by t_2; 26th April 2004 at 22:11.
t_2 is offline   Reply With Quote
Old 26th April 2004, 22:16   #2  |  Link
Dreassica
Registered User
 
Join Date: May 2002
Posts: 384
It's not widely used since it uses VFapi and that needs RGB, which off course means colorspaceconversions to get it into avs.
Vfapi is actually quite old.
Dreassica is offline   Reply With Quote
Old 27th April 2004, 03:56   #3  |  Link
cipher
Guest
 
Posts: n/a
m2v.vfp(m2v = MPEG-2 VIDEO VFAPI Plug-In) can also work as an AviUtl input, therefore, we could further manage to let it work in avisynth, and instead of RGB, now it can output in YUY2. we need to

1st. Simply change its extention from "vfp" to "aui".
2nd. use an AviUtl plugin: "LoadAviUtlInputPlugin".

then write a script that looks like this:

LoadPlugin("Warpsharp.dll")
LoadAviUtlInputPlugin("m2v.aui","MPEG2VIDEO")
#-------------------------------------------------
MPEG2VIDEO("VTS_01_1.vob")

, where "warpsharp.dll" is used to load m2v.aui(the "LoadAviUtlInputPlugin" function)
Warpsharp can be found on this page and its homepage is here(It's in Japanese so I cant read it, but presumably it has some info about version updates and introductions to function usage.)

An advantage of m2v is that it wouldnt produce chromaupsampling errors when dealing with interlaced materials. And it might sometimes produce slightly higher quality than mpeg2dec3.dll. This is controversial and I really dont wanna start a fight on this. Just to provide another possible option on decoding mpeg2 here.

Disadvantages might be slight loss of quality and slow down of processing speed, due to colorspace convertion(yv12-->yuy2).

Last edited by cipher; 27th April 2004 at 07:08.
  Reply With Quote
Old 27th April 2004, 08:15   #4  |  Link
zettai
Fascinated Lurker
 
zettai's Avatar
 
Join Date: Feb 2002
Location: Durham, UK
Posts: 243
Quote:
Originally posted by cipher
An advantage of m2v is that it wouldnt produce chromaupsampling errors when dealing with interlaced materials. And it might sometimes produce slightly higher quality than mpeg2dec3.dll. This is controversial and I really dont wanna start a fight on this.
What you say about chroma handling is true but it can be achieved just as easily by using the old mpeg2dec.dll
zettai is offline   Reply With Quote
Old 27th April 2004, 15:40   #5  |  Link
cipher
Guest
 
Posts: n/a
yeah, because old mpeg2dec3 outputs in yuy2. Actually Nic's mpeg2dec3 doesnt upsample chroma wrong, it's just that any output in yv12 has to be converted into yuy2 then yuv 4:4:4 then RGB in order to display. However, the upsampling from yv12 to yuy2 isnt done by mpeg2dec3, but it's done by our systems' yv12 decoder which usually can't use flags in mpeg2 stream to upsample interlaced or progressive frames differently, thus chroma upsampling errors. So long as a decoder outputs interlaced frames in yv12, we have a big chance to see incorrectly upsampled chroma.
By the same token, i don't think pure progressive materials(film or computer graphics) output in yv12 would have problems in latter chroma upsampling.

Even so, since few people compress interlaced frames directly but usually do IVTC first, errors could be minimized. And yv12 is so fast that we couldnt resist, could we?
  Reply With Quote
Old 27th April 2004, 16:34   #6  |  Link
Kika
Registered User
 
Join Date: Jul 2002
Location: Germany
Posts: 819
Quote:
Under "aspect ratio" choose "Use",
If you are doing so, the filter will do an Resizing of the Video in some cases like anamorphic Videos or at Half-D1-, 3/4-D1-Videos (and so on) like a Softwareplayer do. In most cases, this isn't what i want - and this option lowers the speed of the filter.
Kika is offline   Reply With Quote
Old 27th April 2004, 17:12   #7  |  Link
niiyan
Registered User
 
Join Date: Sep 2002
Posts: 88
Quote:
Originally posted by cipher
1st. Simply change its extention from "vfp" to "aui".
No need to change its extention from "vfp" to "aui" ,when you use LoadAviUtlInputPlugin.

Quote:
Warpsharp can be found on this page and its homepage is here(It's in Japanese so I cant read it, but presumably it has some info about version updates and introductions to function usage.)
This is not a homepage of warpsharp package.
niiyan is offline   Reply With Quote
Old 27th April 2004, 19:39   #8  |  Link
cipher
Guest
 
Posts: n/a
Quote:
Originally posted by niiyan
No need to change its extention from "vfp" to "aui" ,when you use LoadAviUtlInputPlugin.
Oh thank you for pointing it out. So just leave it as vfp and load it like

LoadAviUtlInputPlugin("m2v.vfp","MPEG2VIDEO")

right? kewl

Quote:
Originally posted by niiyan
This is not a homepage of warpsharp package.
Oh really? i always took that page for granted. Again thx for correcting me, and also could you tell us where the homepage of warpsharp is? coz I didnt see it being updated on the page i posted since last Novermber. I really like warpsharp and wanna catchup with the latest version of it.

Thank you.
  Reply With Quote
Old 28th April 2004, 03:59   #9  |  Link
JuanC
Registered User
 
Join Date: May 2002
Posts: 220
Quote:
Originally posted by cipher
..., and also could you tell us where the homepage of warpsharp is? ...
Here is where I always found the latest version. Last one is from november 2003: http://www.geocities.co.jp/SiliconValley-PaloAlto/2382/

Helpful threads here at the forum:
http://forum.doom9.org/showthread.php?s=&threadid=57614
http://forum.doom9.org/showthread.php?s=&threadid=34076

This is a very interesting one:
http://forum.doom9.org/showthread.php?s=&threadid=55605

Last edited by JuanC; 29th April 2004 at 02:33.
JuanC is offline   Reply With Quote
Old 28th April 2004, 09:04   #10  |  Link
mf
·
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Re: New MPEG2 Source Filter = m2v.vfp

Quote:
Originally posted by t_2
Well, my first problem was opening the zip file containing "m2v.vfp" which had an "lzh" extension.
You will encounter many LZH files when you deal with Japanese homepages and P2P. I have no idea why they use it and the rest of the world doesn't. I vaguely recall it being a zip-alternative from the DOS age (like ARJ for those who remember), but I could be wrong.
mf is offline   Reply With Quote
Old 28th April 2004, 20:33   #11  |  Link
niiyan
Registered User
 
Join Date: Sep 2002
Posts: 88
Quote:
Originally posted by cipher
LoadAviUtlInputPlugin("m2v.vfp","MPEG2VIDEO")
right?
Yes. When you use m2v.vfp as Input-Plugin in AviUtl, you must rename it to m2v.aui. But you don't have to do that when you use LoadAviUtlInputPlugin in AviSynth. If you try both m2v.vfp and m2v.aui, you will understand.

Quote:
Oh really? i always took that page for granted. Again thx for correcting me, and also could you tell us where the homepage of warpsharp is?
Perhaps Geocities' site is, as JuanC wrote.
niiyan is offline   Reply With Quote
Old 29th April 2004, 02:58   #12  |  Link
JuanC
Registered User
 
Join Date: May 2002
Posts: 220
@niiyan:

Is there any chance you could help us (non japanese spoken people) by publishing at your english page an english version of your warpsharp page?

That would be really great!
JuanC is offline   Reply With Quote
Old 30th April 2004, 15:27   #13  |  Link
niiyan
Registered User
 
Join Date: Sep 2002
Posts: 88
@JuanC:
I updated my English page. I translated only a part of my page(about functions included in warpsharp.dll) into English.

It would be better than machine translation. I hope it could help you and your friends.
niiyan is offline   Reply With Quote
Old 30th April 2004, 20:24   #14  |  Link
t_2
Registered User
 
Join Date: Apr 2003
Location: USA
Posts: 91
@niiyan

Thanks for the new English documentation at your website. I only wish I could speak Japaneese as well as you write English.

Question 1: I have tried the 3 methods that m2v.vfp and warpsharp.dll provide, but I have run into the same problem that others have mentioned here at Doom9. I can’t open the current version (184K) of warpsharp.dll in Avisynth using LoadPlugin. I found a link here at the forum to an earlier(?) version of warpsharp (127K) and it works great. Have you experienced any of these problems with the latest versions? I am running Windows98SE on a Celeron.

Question 2: Why do you have to use FlipVertical in the first two methods below, whereas with warpsharp you don't?


To Sum up, here are the 3 "new" ways to open MPEG2 video in Avisynth using m2v.vfp and warpsharp.dll.

1. Put m2v.vfp and the video you want to open (here video.m2v) in a folder with the following avs script. Then open the avs script in VirtualDub(Mod)

LoadVFAPIPlugin("m2v.vfp","M2VVFP")
M2VVFP("video.m2v")
FlipVertical

2. Change m2v.vfp to m2v.aui and put it into the folder where aviutl.exe is. Then open video.m2v in AviUtl and save using the „save project” command under the file menu, save your project as video.aup. Then put video.aup, AviUtl.vfp (which comes with AviUtl) and the following avs script into the same folder and open in VirtualDubMod.

LoadVFAPIPlugin("AviUtl.vfp","AviUtlSource")
AviUtlSource("video.aup")
FlipVertical

3.This is the best method because it allows you to open in YUY2 color space and you don't have to use FlipVertical in your script.

Put warpsharp.dll (the 127K version) and m2v.vfp into a folder with the following avs script and open the script in VirtualDub(Mod). Once the video is open look under file/information and you will see that the video is in 4:2:2 format as opposed to the 2 methods above which open in RGB24

LoadPlugin("warpsharp.dll")
LoadAviUtlInputPlugin("m2v.vfp","MPEG2VIDEO")
MPEG2VIDEO("video.m2v")
t_2 is offline   Reply With Quote
Old 30th April 2004, 21:52   #15  |  Link
niiyan
Registered User
 
Join Date: Sep 2002
Posts: 88
@t_2:

A1. See here(Q3.5 in AviSynth.org's FAQ). If you have already installed required dlls, I don't know why. But I recommend you use the latest version, because the bug of Q 1.25 has been fixed.

A2. According to the document of FlipVertical:
Quote:
some video codecs which output everything upside down.
I guess that it is caused by VFAPI or LoadVFAPIPlugin.

On the other hand, method#3 doesn't use VFAPI(decoded as YUY2 format). So, you don't need FlipVertical.
niiyan is offline   Reply With Quote
Old 30th April 2004, 23:47   #16  |  Link
t_2
Registered User
 
Join Date: Apr 2003
Location: USA
Posts: 91
@niiyan


OK, if you were refering to the need to put msvcp71.dll and msvcr71.dll in Windows\system, I've just done that but the current version of warpsharp still won't load for me, so I guess I am forced to use the 127K version and load it manually.

Thanks again.
t_2 is offline   Reply With Quote
Old 1st May 2004, 03:46   #17  |  Link
JuanC
Registered User
 
Join Date: May 2002
Posts: 220
Quote:
Originally posted by niiyan
@JuanC: ... It would be better than machine translation. I hope it could help you and your friends.
Thanks! it is very helpful. I'm gonna try a couple of things. Thanks!
JuanC is offline   Reply With Quote
Old 1st May 2004, 23:57   #18  |  Link
Kika
Registered User
 
Join Date: Jul 2002
Location: Germany
Posts: 819
If you want very good results by using m2v as MPEG-Decoder in AVISynth or directkly in TMPGEnc, you have to configure it first by using M2vconf. That's the correct settings:

Aspect Ratio: Ignore
Field Order: Keep Original Frame
iDCT Algorithm: Floating Point
SIMD: If possible, use all
GOP List: All off
YUV Range: ITU-R BT.601 Range
Default Matrix Coefficient: Auto
YUY2 Matrix: Keep Original YUV Data

Take care of the YUV Range! That's very important.

BTW: If m2v used as Decoder in TMPGEnc directly, the Frame is not flipped, i'm curiouse why the frame is flipped in AVISynth.
A second thing: Compare the Results from MPEG2Dec and m2v, looks like MPEG2Dec is still dropping the First Frame in some cases.
I have done some Encodings using exactly the same settings in TMPGEnc (CQ-Mode). The Version with m2v needs a Bit lower Bitrates...
Kika is offline   Reply With Quote
Old 30th May 2004, 15:21   #19  |  Link
niiyan
Registered User
 
Join Date: Sep 2002
Posts: 88
I updated my English page.
Introduction of warpsharp package was added.
http://niiyan.s8.xrea.com/avisynth/index_en.html
niiyan is offline   Reply With Quote
Old 30th May 2004, 21:52   #20  |  Link
t_2
Registered User
 
Join Date: Apr 2003
Location: USA
Posts: 91
Thanks for the update!!
t_2 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:28.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.