Quantcast Success with VCD to KVCD! - digitalFAQ.com Forums [Archives]
Go Back    digitalFAQ.com Forums [Archives] > Video Production Forums > Video Encoding and Conversion

Reply
 
LinkBack Thread Tools
  #1  
10-19-2003, 09:38 PM
J-Wo J-Wo is offline
Free Member
 
Join Date: Nov 2002
Location: Toronto, Canada
Posts: 454
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
10-20-2003, 05:11 PM
Edlund Edlund is offline
Free Member
 
Join Date: Jul 2003
Location: Pazardjik, Bulgaria
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks man, I'll try this tomorrow.
Reply With Quote
  #3  
10-20-2003, 05:53 PM
Zyphon Zyphon is offline
Free Member
 
Join Date: Oct 2003
Location: London, England (UK)
Posts: 1,035
Thanks: 0
Thanked 0 Times in 0 Posts
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.
__________________
Regards.

Michael.
Reply With Quote
  #4  
10-20-2003, 05:54 PM
Zyphon Zyphon is offline
Free Member
 
Join Date: Oct 2003
Location: London, England (UK)
Posts: 1,035
Thanks: 0
Thanked 0 Times in 0 Posts
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
__________________
Regards.

Michael.
Reply With Quote
  #5  
10-20-2003, 05:57 PM
rendalunit rendalunit is offline
Free Member
 
Join Date: Apr 2002
Location: san jose, Ca
Posts: 1,148
Thanks: 0
Thanked 0 Times in 0 Posts
I was just complaining about this dll a little while ago
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.
Reply With Quote
  #6  
10-20-2003, 06:04 PM
J-Wo J-Wo is offline
Free Member
 
Join Date: Nov 2002
Location: Toronto, Canada
Posts: 454
Thanks: 0
Thanked 0 Times in 0 Posts
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!
Reply With Quote
  #7  
10-20-2003, 06:16 PM
rendalunit rendalunit is offline
Free Member
 
Join Date: Apr 2002
Location: san jose, Ca
Posts: 1,148
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote
  #8  
10-20-2003, 06:30 PM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #9  
10-20-2003, 06:32 PM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
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)
Reply With Quote
  #10  
10-20-2003, 06:35 PM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #11  
10-20-2003, 06:38 PM
J-Wo J-Wo is offline
Free Member
 
Join Date: Nov 2002
Location: Toronto, Canada
Posts: 454
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #12  
10-20-2003, 06:39 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Jorel,

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

-kwag
Reply With Quote
  #13  
10-20-2003, 06:39 PM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
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)
Reply With Quote
  #14  
10-20-2003, 06:44 PM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
Hi Jorel,

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

-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!
Reply With Quote
  #15  
10-20-2003, 06:45 PM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
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:
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
KVCD: Having much success! Mr. Pink Video Encoding and Conversion 0 12-05-2004 02:02 PM
KVCD: Thank you - success! zerotype Video Encoding and Conversion 3 11-17-2004 12:08 AM
Success! Thank you KVCD! gijluiaard Video Encoding and Conversion 4 09-04-2004 06:16 AM
KVCD: Success! telemike Video Encoding and Conversion 0 02-26-2003 06:57 AM
Kvcd: Success! Paul0889 Video Encoding and Conversion 2 12-11-2002 05:48 PM




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