View Full Version : Avisynth statement to read MPEG2 .mpg (from TV capture)
JeremyTan
12th March 2002, 22:49
I just got a Hauppauge WinTV PVR, and had tried tv capturing. the only good datarates with decent quality are above 8mbps which are in mpeg2 file format.
I'll like to use Avisynth to frameserve to vdub to make into .avi, what is the statement to do this?
I've tried directshowsource() but there's a need to put the frame rate AND there's no audio(?)
Thanks if you could help... better yet if you know of a way to hack the drivers to allow high datarate for mpeg1 output. thanks!
Jem
jugm
12th March 2002, 23:20
I believe mpeg2dec.dll plugin can be used there. After loading it with LoadPlugin just use mpeg2source("my.mpeg") line. You can get this dll from doom9 site.
JeremyTan
12th March 2002, 23:44
thks for the tip to this function, i can't recall the name.. I've just tried it, the MPEG2Source() function said "couldn't open file" ... :(
omol
12th March 2002, 23:53
Originally posted by JeremyTan
thks for the tip to this function, i can't recall the name.. I've just tried it, the MPEG2Source() function said "couldn't open file" ... :(
mpeg2dec.dll can't open mpeg2 file directly. You have to first use DVD2AVI to make project file (".d2v") for the mpeg2 video then use mpeg2source(your_d2v_file) in avisynth to operate on the mpeg2 file. Another alternative is to use this MPEG-2 VIDEO VFAPI Plug-In (http://e3lt11.ocv.ne.jp/mpeg2/) (page in Japanese), and use LoadVFAPlugin in avisynth to read the mpeg2 file directly.
regards,
omol
JeremyTan
13th March 2002, 01:10
thks. i'll give that jap mpeg2 thingy a try.. coz dvd2avi dun work. it sorta hang when i was testing.. strangely
Pko
13th March 2002, 13:27
Originally posted by omol
Another alternative is to use this MPEG-2 VIDEO VFAPI Plug-In (http://e3lt11.ocv.ne.jp/mpeg2/) (page in Japanese), and use LoadVFAPlugin in avisynth to read the mpeg2 file directly.
Hey, this program seems to be very interesting!
Unfortunately, almost all is in japanese... Can you give a little more information about it?
JeremyTan
13th March 2002, 13:45
i tried this, but it says unable to open the mpeg file.. duh
omol
13th March 2002, 22:38
Originally posted by JeremyTan
i tried this, but it says unable to open the mpeg file.. duh
Then is your mpeg2 file intact? Standard compliant mpeg2 stream? Could TMPGenc open it with the MPEG-2 Video VFAPIPlugin installed?
regards,
omol
omol
13th March 2002, 22:53
Originally posted by Pko
Hey, this program seems to be very interesting!
Unfortunately, almost all is in japanese... Can you give a little more information about it?
I don't speak japanese, other than understand a couple of Kanji characters (same as in Chinese but means differently). Basically, ignore what's there in that page, just download the archive in lzh format. Extract the archive. I recommand extract all the archive contents to where TMPGenc is. Ignore the readme file. Also, ignore the "mme.exe" unless you know japanese or you are curious to know what it is. This one seems to let you save a segment of the mpeg2 stream to a new file.
The most important are the "m2v.vfp", the VFAPI plugin, and the "m2vconf.exe", the gui configuration program for the MPEG-2 VFAPI Plugin and the interface is in English. Just launch the m2vconf.exe and you will fully understand what's the heck about.
Qualitywise, I can't tell it's superiour or inferior to DVD2AVI. Speedwise is about the same as using the DVD2AVI VFAPI plugin, BUT you don't have to generate the d2v project file before accessing the mpeg2 stream! So, if you solely use VFAPI, this one is highly recommanded. And the author updates the package very frequently. Reminds me of the intense period of DVD2AVI 0.xx -> 1.76...:)
regards,
omol
JeremyTan
14th March 2002, 05:03
Nope. can't read. i did not meddle with the .mpg file. it is produced by the tv capture card. tmpgenc and stuff just can't read even with the vfp installed. i think those were meant to read .vob instead of .mpg? haha...
omol
14th March 2002, 06:09
Originally posted by JeremyTan
Nope. can't read. i did not meddle with the .mpg file. it is produced by the tv capture card. tmpgenc and stuff just can't read even with the vfp installed. i think those were meant to read .vob instead of .mpg? haha...
Could you open the captured mpeg2 file with other editing tools like Ulead's MediaStudio 6.0? This tool is mentioned on WinTV PVR product page as compatible.
regards,
omol
JeremyTan
14th March 2002, 12:03
i believe maybe it can. but that's not the point. i want to ultimately make tv rips (at as hight quality as possible) and encode to divx .avi clips.
or does anyone know what capture s/w can take this wintv-pvr and using s/w encoding (and indeo5.11's codec perhaps) make realtime encoding to .avi?
omol
14th March 2002, 18:13
Originally posted by JeremyTan
i believe maybe it can. but that's not the point. i want to ultimately make tv rips (at as hight quality as possible) and encode to divx .avi clips.
or does anyone know what capture s/w can take this wintv-pvr and using s/w encoding (and indeo5.11's codec perhaps) make realtime encoding to .avi?
Oh, I did not make it clear, my fault. What I was trying to say is to open the mpeg2 file in question with the "official" app to see if the file is intact, otherwise, I'm afraid it's corupted.
For realtime capture, on lossless side, you could not go wrong with huffyuv (http://www.math.berkeley.edu/~benrg/huffyuv.html), on lossy side, mjpeg, divx5 (quantiser @2) or xvid (also quantiser @2) are also good choices.
Hope this help.
regards,
omol
JeremyTan
15th March 2002, 08:11
hihi. thanks for replying so often. :)
I asked this same Q in alot of irc channels i'm in. and finally someone advised me something. and it finally worked. in short
- open .mpg in dvd2avi, check settings (won't mention here, i think default will do)
- save .d2v project (will output .mpa audio file)
- use .d2v in avisynth script
----- filename.avs -----
LoadPlugin("c:\win\system\mpeg2dec.dll")
MPEG2Source("f:\filename.d2v")
------------------------
this .avs can be opened in almost any encoder/processor s/w (vdub/tmpgenc/etc)
for me i convert the .mpa to .wav then use it to encode .mp3 which is later streamed/interleaved with the encoded video.
the above were written to help any who may meet with such problems like mine. thks for all the help everyone who participated in this thread. :)
Jem
I was recommended to try using azid for the mp3 encoding (VBR?). hmm. i'll try to look this up in the forum if it is spoken of. bye!
omol
15th March 2002, 08:47
Originally posted by JeremyTan
I was recommended to try using azid for the mp3 encoding (VBR?). hmm. i'll try to look this up in the forum if it is spoken of. bye!
Couple of doom9 guides related to audio is here (http://doom9.org/ogg-hac3.htm), here (http://doom9.org/ac3tomp3.htm) and here (http://doom9.org/pcm_and_mpeg2_audio.htm).
BTW, if you are going to share your transcoded avi(s) with others using Mac, VBR audio should be avoided.
Hope this help.
regards,
omol
boogeeman
11th June 2002, 15:15
Originally posted by omol
mpeg2dec.dll can't open mpeg2 file directly. You have to first use DVD2AVI to make project file (".d2v") for the mpeg2 video then use mpeg2source(your_d2v_file) in avisynth to operate on the mpeg2 file. Another alternative is to use this MPEG-2 VIDEO VFAPI Plug-In (http://e3lt11.ocv.ne.jp/mpeg2/) (page in Japanese), and use LoadVFAPlugin in avisynth to read the mpeg2 file directly.
regards,
omol
I get script error: there is no function named "LoadVFAPlugin". Are there any instructions on how to use this in english please?
Wilbert
11th June 2002, 16:28
That's because the function is called "LoadVFAPIplugin". Use something like:
LoadVFAPIplugin("c:\name_plugin","VOBsource")
VOBsource("d:\filename.vob")
I can't open lzh-files on this computer, so I can't help you further.
I have ATI ALL-IN-WONDER and capture to mpeg2 using dvd profile: bitrate 8 mbit. 720x576, audio stereo 224 kbits mp2. I have no problem with this.
Next I use DVD2AVi to creat d2v projest and extract audio from this file. Then I open d2v in GordianKnot to create avs file. Of corse I do cropping, change resolution and apply filters.
Next I can open avs file in Virtualdub to compress to divx or in TPMGEnc to compress to vcd or svcd.
This is very simple and I don't have any problms.
boogeeman
11th June 2002, 18:42
Originally posted by Wilbert
That's because the function is called "LoadVFAPIplugin". Use something like:
LoadVFAPIplugin("c:\name_plugin","VOBsource")
VOBsource("d:\filename.vob")
I can't open lzh-files on this computer, so I can't help you further.
Thanks. It works now. Another tool to stick in my belt. My test script looks something like this if anyone is interested:
LoadVFAPIplugin("m2v.vfp","AVISource")
AVISource("Kelly Osbourne - Papa Don't Preach (MTV 2002 Movie Awards) (Mach3-HQ).m2v")
This assumes that m2v.vfp is in the same dir. This was for a test of course. And I will make a more formal installation.
boogeeman
12th June 2002, 03:04
The video came out upside down. I wish I could read Japanese. Well it's headed in the right firection anyways. I may try applying a translator to that webpage. I'll let you guys know... I'm out for the rest of this evening.
boogeeman
12th June 2002, 03:28
I just realized it takes 2 hours to encode a 4 minute 5 pass mpeg2 this way. Aborting...
Going back to mpeg2dec.dll
Wilbert
12th June 2002, 09:27
The video came out upside down.
Change it into:
LoadVFAPIplugin("m2v.vfp","VOBSource")
VOBSource("Kelly Osbourne - Papa Don't Preach (MTV 2002 Movie Awards) (Mach3-HQ).m2v")
FlipVertical()
# the function AVISource already exists in AviSynth, so better give it another name
I was under the impression that it only read vob-files. But I guess that plugin can read any mpeg2-file ???
fantomlord
12th June 2002, 12:57
isn't there a "flipvertical" command?
that should remedy the upside down issue;)
gunnimabi
22nd June 2002, 11:48
:eek: DVDCutter is also a very good program, you can give it a try, but it seems that the registered version has fuller functions. You can visit www.jummpa.com
dividee
22nd June 2002, 14:18
gunnimabi, stop spamming the board. 12 posts in a row, you well deserved a strike
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.