Newbie guide for use of Mencoder for Win32 with support of Avisynth scripts.
NOTE: See the change log on the bottom of the post to know the news on it!
LAST EDIT: 15/04/2004
Mencoder is a new libavcodec based encoder that uses OS command line.
So get your dos-box or command prompt ready for some typing.
Also you may want to read some information on how mencoder works 1st.
Then please take a look at it's
documentation here.
And to it's
man_page here.
This is my first time creating a guide so please forgive me for some lack of information.
Post your sugestions so I can improve it further for others.
All the above recomended tools have been developed by others without my intervenience.
I take no credits for them.
The instructions here are based on mine and others experiences at the KVCD forum.
For now, and since I have some imprecise feedback from Window98 users, these instructions
are only prooven to work under Win2000 and WinXP.
If you're running Windows98 and would like to try it maybe you could help me and follow
the steps below and give me more feedback on your experiences.
Tools Downloads
First of all you have to grab the right tools.
Download
Donald Graft's DVD2AVI 1.77.3
Read more
about Donald Graft's DVD2AVI 1.77.3 and why I always recomend it.
Download
Avisynth v2.54 here.
Download
almost all Avisynth v2.5x filters here.
Optionally you can download
a package of Avisynth v2.5x filters here.
Download this cut-down version of FFvfw that only delivers
makeAVIS build 20031113 here.
Find latest
Avisynth Optimal script here.
Some of
these (and other) tools you may need in the process are probably here.
MEncoder Downloads
Download
latest CVS snapshot MEncoder builds here.
Download
MC_PAL.bat here
Download
MC_NTSC.bat here
Download
MC.ini here
Also consider downloading
Mencode-me a newbie oriented GUI - 0.23 by VMesquita here.
Also consider downloading
PackShot a Mencoder GUI incl. AC3 Audio Multichannel by Incredible here.
Tools Setup
First you have to install the already mentioned tools.
Please make sure you have Avisynth, DVD2AVI and FFvfw or FFdshow properly installed.
That is, choose a small path like "C:\VIDEO" and install your tools in that path.
Bottom line you will need to do "Next > Next > ... > Finish" on most of them.
I'm assuming you already used Avisynth with other encoders such as TMPGEnc and CCE
so I won't take much time explaining it.
I'm also assuming you already used DVD2AVI before, so same as Avisynth here.
If you would like more info on these tools read other guides
here
Now the file you downloaded "mencoder-XXXX.zip" will have to be unpacked with
winzip/winrar or something.
Copy the files to a folder named mplayer like "C:\VIDEO\MPLAYER".
Tools Usage
First you have to rip your movie, to a folder in a short path, with your favorite DVD ripper.
Use Smartripper or DVDDecrypt or your favorite.
Then you use DVD2AVI to create a D2V file (fake VOB) from your movie's ripped VOBs.
Now edit the Optimal MA script (or your favorite script) and load your movie in the
mpeg2source line, such as:
Mpeg2Source("d:\movie\mymovie.d2v")
Most important! Try to open your Avisynth script in Windows Media Player 6.4.
You have to be able to open it in WMP 6.4 otherwise the process will fail.
If it doesn't either you have a problem with your script or you didn't load the proper
plugins for Avisynth.
Now open makeAVIS that comes with FFvfw and FFdshow.
Click on the Avisynth script ... button and browse for your just made script.
Now click on the Fake AVI ... button and choose a path and a file name for your fake
AVI (e.g. c:\video\mplayer\video.avi).
Don't worry much about the space it will take on your disk since it's only a "proxy" to
your real VOB files.
Click on Store script in AVI radio button and hit the Create button.
Wait a few seconds while it works.
In the end a message in a small window should appear saying that the Fake AVI
creation succeeded.
You may now click the OK button to close the window and click the Close button to
exit makeAVIS.
MEncoder usage
There is no really yet defined way of using mencoder arguments.
We have knowledge of some GUIs to it that are being prepared right now, but since we're
not pretty sure of all mencoder's capabilities, those GUIs won't be finished so soon.
Anyway, we can always play with a few arguments really known so far.
The batch files you downloaded have minimum arguments on it.
On the other hand the MC.ini file you downloaded have all the arguments found to be
the most appropriate so far.
Use MC_PAL.bat for PAL sources or MC_NTSC.bat for NTSC sources.
You just double click it, a dos-box opens and you wait a couple of hours.
Framerate goes from 4fps on my PIII-550 to >20fps on later CPUs.
But before doing that, you have to open either MC_PAL.bat or MC_NTSC.bat in
windows notepad and change four variables I've added to it.
These are so that MEncoder knows what's the complete source path for your fake avi,
the filename of your fake avi, the complete destination path for your M2V file and the
filename of the M2V file.
So if your source is
Code:
d:\dvd\matrix\matrix_iii.avi
and you want to encode it to
Code:
d:\kdvd\matrix\matrix_iii.m2v
change the variables as this:
Code:
set in_path=d:\dvd\matrix
set in_avi=matrix_iii.avi
set out_path=d:\kdvd\matrix
set out_m2v=matrix_iii.m2v
Now you double click it, seat back and relax
A brief explanation of some arguments
There are some key arguments in the MC.ini file that you could change.
Here are some and their explanantion.
vcodec= either mpeg1video or mpeg2video (for KVCD or SKVCD/KDVD)
vrc_minrate= the minimum bitrate you whish to have in your final movie
vrc_maxrate= the maximum bitrate you whish to have in your final movie
vbitrate= the average bitrate you whish to have in your final movie
vrc_buf_size= the vbv buffer size (VCD=327, SVCD=917, DVD=1835).
Please note that KDVD uses 1835 and that KVCD depends on wether it will be muxed
later as VCD or SVCD)
keyint= the GOP size (15 or 18 for PAL/NTSC KDVD or 24 for KVCD)
aspect= 4/3 or 16/9 (this needs to be according the avisynth script too!)
Hope I helped you entering mencoder usage.
I'll try to update this guide as regularly as possible, if needed.
Cheers
Rui Correia - 28/02/2004
Change Log
15/05/2004
- Minor updating to the download links.
- Now I point to the Latest CVS snapshot o MEncoder here in the forum.
- Also I pointed out both Mencode-Me and PackShot GUIs as these will now make this guide completely useless
12/04/2004
- Readded some explaining on how to edit the batch files.
I had this in the guide previously but erased it by mistake
- Small change in the batch files.
Now these have variables so you can specify path and filename
for both source and destination.
It's just easier this way for rookies in command line
10/04/2004
- Removed old obsolete compilation builds by bilu and VMesquita.
- Added new compilation build by VMesquita from 09/04/2004.
- Removed codecs.conf file from downloads since with VMequita's
new build it's not needed anymore.
- Updated the batch/ini files to latest bilu's recomendations.
- Major changes to the guide reflecting the above issues.
- Phew! That's about it...
10/03/2004
- Added a link to an unofficial compilation of mencoder by bilu.
It now supports "-of rawvideo" so we don't need bbdmux anymore
.
I still need to update the scripts, though
...
03/03/2004
- Updated the mc.bat and mc_ntsc.bat: had path problems
- Thus updated the downloadable files too
- Added optional download of mc.bat and mc_ntsc.bat from my new free webspace
.
02/03/2004
- Added a link to an unofficial compilation of mencoder by VMesquita.
- Added instructions for interlaced or NTSC Telecined encodes with mencoder internal
arguments by bilu.
29/02/2004
- Updated the mc.bat batch file. It had problems like encoding without outputting a
video file anywhere at all
.
28/02/2004
- Lot's of re-post due to text alignment in the guide
- Original post with the guide won Sticky status given by Admin