digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   Success with VCD to KVCD! (http://www.digitalfaq.com/archives/encode/6200-success-vcd-kvcd.html)

J-Wo 10-19-2003 09:38 PM

Success with VCD to KVCD!
 
After many many months of trail and error converting VCD mpeg-1 files to KVCD, I have finally figured out how to do it. As discussed in previous threads, while AviSynth 2.52 purports to handle .mpg files via DirectShowSource(), it simply doesn't work. Neither does loading the .mpg into DVD2AVI (although some have reported this method works sometimes).

What I discovered was a plugin called MpegDecoder.dll created by Nic, the same guy who made MPEG2Dec3. Here's the syntax I used:
Code:

Loadplugin ("c:\avisynth\plugins\mpegdecoder.dll") # this line not needed if using AviSynth 2.52 as it automatically loads plugins
Mpegsource ("c:\movies\movie file.mpg", -2)

I have absolutely no idea what the -2 means, all I know is without it Tmpgenc would only encode the first half of the movie. I simply stumbled upon this syntax usage on another site so tried to use it and it worked for me. This plugin creates a dummy .d2v file which I suppose Tmpgenc sees as well, but you can't load the resulting .d2v file with Mpeg2Source().

Anyway this has solved a lot of headaches for me and I hope others can find this helpful too. A couple additional comments:

- this plugin doesn't seem to like long file names, so rename your .mpg to something short if you get an error
- I found using GripCrop worked best in my scripts. If I used the LanczosResize() command to crop manually, my scripts wouldn't load. So let GripCrop do the work for you.

Oh and the plugin can be found here: http://nic.dnsalias.com/mpegdecoder.htm

Edlund 10-20-2003 05:11 PM

Thanks man, I'll try this tomorrow.

Zyphon 10-20-2003 05:53 PM

Thanx 4 the info J-Wo i have loads of VCD's that i would love to put on a single CD.

Btw the link to the plugin doesnt work for me :( any mirrors?

Thanks.

Zyphon 10-20-2003 05:54 PM

Did a Google search and found the link below was that the same site J-Wo?

This link works for me.
http://nic.dnsalias.com/MPEGDecoder.html

rendalunit 10-20-2003 05:57 PM

I was just complaining about this dll a little while ago :lol:
http://www.kvcd.net/forum/viewtopic.php?t=4001

The only thing working for me now is DirectShowSource. Did you try increasing the priority in tmpgenc's environmental settings? If mpegdecoder is working for you that's cool though.

J-Wo 10-20-2003 06:04 PM

Sorry about the wrong link guys, Zyphon found the right one.

Quote:

Originally Posted by rendalunit
The only thing working for me now is DirectShowSource. Did you try increasing the priority in tmpgenc's environmental settings? If mpegdecoder is working for you that's cool though.

Hmmm well good to know DirectShowSource is working for you, I was never able to. I always had DirectShow priority right underneath AVS files, but never at the top, so maybe that was my problem.

I never saw your original thread but I too encounted wrong frame count problems. In my case, it would only see half the total number of frames and thus encoding would end only halfway through the movie. I solved this by adding a -2 to the MpegSource() line. But I have no idea what this does! I can't seem to find any documentation in this dll, which is just mindboggling!

rendalunit 10-20-2003 06:16 PM

There's documentation in the zip file

here it is:

Code:

MPEGDecoder.dll YV12 Version for AviSynth 2.5 Only!
(Version 2.03 Alpha)
By Nic
Introduction

This DLL lets you load VOB/MPEG-2 ES,PS,TS/MPEG-1 files to be loaded directly into Avisynth.

A Sample AVISynth Script looks like this:

LoadPlugin("MPEGDecoder.dll")
MPEGSource("d:\kiss\kiss.vob")

This avs file can now be loaded into VDub/etc.

The Way it works
Unlike the previous version, this MPEGDecoder.dll is primarily based on the DVD2AVI d2v file format.
However, if no D2V file is supplied, it creates one itself

Main Parameters
The parameters for 'MPEGSource' are as follows:
For normal use:

MPEGSource("e:\rip\spiderman.d2v")
Which will load a d2v as normal

or:

MPEGSource("e:\rip\VTs_01_1.vob+e:\rip\VTs_01_2.vob+e:\rip\VTs_01_3.vob)
Here the first thing that MPEGDecoder.dll will do is to check for a e:\rip\VTs_01_1.d2v file.
if a file with that name exists it will load that and assume that the d2v is for the three files.

if e:\rip\VTs_01_1.d2v does not exist, it will be created and then loaded automatically.

For D2V files created automatically by MPEGDecoder.dll it does not know if force film should be turned on.
If it should then put "ff" as the third parameter
i.e.
MPEGSource("e:\rip\big.vob", 0, "ff")
Detailed Parameter Description
Usage:
MPEGSource(file names, number of frames, commands)

file names
This can be a sequence of MPEG files combined with a '+' or a d2v file.

number of frames
This should always be 0 as a default. But can be used to force the decoder to return a certain number of frames. MPEGSource can not correctly create d2v files for MPEG-1 yet, so use this to input the correct number of frames.
A value of -2 can also be written here. This means no d2v can be used and therefore only files can be inputed in the first parameter. From the files specified Directshow is asked to get the correct number of frames.

commands
The only two commands at present are "ff" which forces film. (as described above) and "nod2v".
"nod2v" is similar to the -2 command in that you can only specify files and nod2v is used or created. But it allows you to specify a number of frames in the "number of frames" parameter.
Misc/Notes
# Pro's/Con's


BUG: The MPEG2 Repeat Field flag is not taken into consideration. So when decoding NTSC films its like Force Film is already turned on.

PRO: Its fast, faster decoding than normal MPEG2DEC.DLL(MPEG2Source). This speeds up encoding :)

# Info


Read this document carefully!
Transport streams can be used the same as Program Streams, the MPEGDecoder should detect that they are transport streams and determine the PIDs automatically.

# Bugs


When creating d2v files for MPEG-1 files the, number of frames determined is wrong. either use -2, or enter the correct number of frames. (if you want to find to find the correct number of frames exactly, load the mpeg-1 into VirtualDub and it will tell you the number of frames through File->File Information)

When seeking, sometimes the video looks corrupt, ignore this as it will not look corrupt when encoding

Credits
The MPEG2 decoding library is based on libmpeg2.sf.net (Michel Lespinasse , Aaron Holtzman )

ColorSpace code comes from the XviD MPEG-4 project (www.xvid.org) (Michael Militzer, Peter Ross, edgomez, skal)

Ive pinched the way this doc looks from Decomb 3.8's documentation (by Donald Graft - http://shelob.mordor.net/dgraft/ )
Changelog as of 2.0 alpha
2.03 alpha
Added automatic Transport Stream support
-2 dshow framecount guess support and frame count overiding

2.02 alpha
Fixed frame counting bug (did not take into consideration trf 0)

2.01 alpha
Fixed a bug in ForceFilm mode

2.0 alpha
Due to lack of time, Im releasing a test version. As I dont have time to test myself :(


All code is GPL!

email: nic@nic.dnsalias.com

btw- I have DirectShowSource priority at the top. Also from the readme:
Code:

When seeking, sometimes the video looks corrupt, ignore this as it will not look corrupt when encoding
I saw this corruption in my final encoded video :!: :roll:

Dialhot 10-20-2003 06:30 PM

I'm sorry to tell that as rendalunit, NOTHING that is indicated in the documentation never worked for me. That include the usage of this "-2".

It worths the try, but it seems there is no miracle to expect. :-(

jorel 10-20-2003 06:32 PM

bp posted about MPEGDecoder,more than a year ago:

http://www.kvcd.net/forum/viewtopic....ht=mpegdecoder

Posted: Sun Aug 25, 2002 12:50 am :!:
(from black prince post)

Dialhot 10-20-2003 06:35 PM

Quote:

Originally Posted by jorel
bp posted about MPEGDecoder,more than a year ago:

You can check all the threads related to MPEG-1 import in avisynth : nothing works, and everyone is looking for a solution.

Last time I managed to do that with DVD2AVI, but that was the first time it worked. I never know why this time and not the others.

J-Wo 10-20-2003 06:38 PM

dialhot: well mpegdecoder worked with me, but only when adding the -2 argument. I'd suggest starting off with a clean script too with no filters, it took me a bit to figure out that not include GripCrop was also causing errors.

kwag 10-20-2003 06:39 PM

Hi Jorel,

We should name you "The Curator of all links" :idea:
Because you, more than anyone else in this forum, knows all the links and history to software, posts and references :D
You keep track of things better than anyone :cool:

-kwag

jorel 10-20-2003 06:39 PM

Quote:

Originally Posted by Dialhot
Quote:

Originally Posted by jorel
bp posted about MPEGDecoder,more than a year ago:

You can check all the threads related to MPEG-1 import in avisynth : nothing works, and everyone is looking for a solution.

Last time I managed to do that with DVD2AVI, but that was the first time it worked. I never know why this time and not the others.

really true Phil,
see the Kwag's tests and observations in the link too!
"Couple of problems found after testing:"(Kwag)
:wink:

jorel 10-20-2003 06:44 PM

Quote:

Originally Posted by kwag
Hi Jorel,

We should name you "The Curator of all links" :idea:
Because you, more than anyone else in this forum, knows all the links and history to software, posts and references :D
You keep track of things better than anyone :cool:

-kwag

oh thanks....this is my simple part:
"the memory"
you all do the hard part:
"the developing,great results and help."
i can't stop to read all posts in the forum.....they have great value!
:wink:

Dialhot 10-20-2003 06:45 PM

Quote:

Originally Posted by J-Wo
dialhot: well mpegdecoder worked with me, but only when adding the -2 argument.

I know, that's why I tell "it worths the try".

Quote:

I'd suggest starting off with a clean script too with no filters, it took me a bit to figure out that not include GripCrop was also causing errors.
In my tests I only had one line : the mpeg1 source load :-)

Note: I didn't do only one test at one time. I tried, and tried again with several clips during 2 months :banghead:


All times are GMT -5. The time now is 11:22 PM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.