digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   Mencoder scripting with AVSEdit and Guide for Multiple Files (http://www.digitalfaq.com/archives/encode/9703-mencoder-scripting-avsedit.html)

Prodater64 05-17-2004 07:42 PM

Mencoder scripting with AVSEdit and Guide for Multiple Files
 
Mencoder scripting with AVSEdit and Guide for Multiple Files Encoding with a batch file.


----------------------http://www.digitalfaq.com/archives/error.gif


Hi:

Sometimes is very useful to encode with mencoder.exe using a batch file. Or by questions of test, or by mutiples codifications, is very useful to use these kind of files. For this reason I did a config file for AVSEdit that will permit work with mencoder.exe in a easier way.

Tools Downloads
You need these tools for a whole encoding process. For mencoder scripting with AVSEdit only need the 4 first tools. (AVSEdit needs MS .NET Framework)

Download AVSEdit 1.0.
Download AVSEdit config file.
Download MS .NET Framework 1.1
Download Latest CVS Snapshot Mencoder Builds.

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.
Download an optional package of Avisynth v2.5x filters.
Download makeAVIS build 20031113 here.
Download latest Kwag's MA script.
Download latest Dialhot's V series scripts.
Download some of these (and other) tools you may need in the process.
Download Mplex W32 Command Line Version (extract it from DVDAuthor package).
Download MencodeMe - GUI for Mencoder.exe
Download Besweet.

Specific installation

1 - Download AVSEdit 1.0.
2 - Download AVSEdit config file.
3 - Install AVSEdit.
4 - Unzip it in "C:\Documents and Settings\[user name]\Application Data\".
If you have already AVSEdit with custom profiles, backup your "AVSEdit Settings.bin" file previously.
5 - Make a direct access to the usual batch file (encode.bat) with the following command line:
Quote:

"C:\Path to AVSEdit\AVSEdit.exe" path to encode.bat

for example

"C:\Program Files\AVSEdit\AVSEdit.exe" C:\001_MencodeMe\encode.bat
You can name this direct access "AVSEdit encode.bat". When you run it, AVSEdit will open, with encode.bat for to be edited.
6 - Make a direct access to the usual temp.conf file with the following command line:
Quote:

"C:\Path to AVSEdit\AVSEdit.exe" path to temp.conf

for example

"C:\Program Files\AVSEdit\AVSEdit.exe" C:\001_MencodeMe\temp.conf
You can name this direct access "AVSEdit temp.conf". When you run it, AVSEdit will open, with temp.conf for to be edited.
7 - All other software for video encoding, audio encoding and multiplexing should also to be installed.

General Instructions

1 - You need to add so many video encoding command lines as videos you want to encode.
2 - If you want to encode including audio, you need and can, append at end of encode.bat, a besweet command line for each audio file to encode.
3 - If you want to multiplex mp2 audio, you need and can, append at end of encode.bat, a mplex command line.
4 - If you want to use avysynth script, you must to write a script for each file to encode.
5 - For a single edition and encoding this is enough, make your settings and encode.


Special Instructions

1 - You need one BIG VOB (or several) source like was explained here. or a Fake VOB if you want to use avisynth scripts, like was explained here, in Tools Usage, or an avi file.
2 - Obtain audio files. (ac3 or wav)
3 - If you want to use avisynth make so many avs scripts as movies you are encoding.
4 - Run MakeAvis.exe and obtain so many Fakes.avi as movies you are encoding. Give it its own name.
5 - Run MencodeMe and load your BIG VOB, or your Fake VOB or your Fake AVI. Make your settings and click on encode, once encode begin, click on stop.
6 - Run direct access
Quote:

"C:\Path to AVSEdit\AVSEdit.exe" path to encode.bat
encode.bat will open in AVSEdit. You will see something like the following for a 2 pass encode:
Quote:

Mencoder.exe -include temp.conf -lavcopts vbitrate=2000:vpass=%%PASS%% "C:\001_MencodeMe\Samples\Movie01.avi" -o "C:\001_MencodeMe\Samples\Movie01.mpv"
You should copy the whole entry and paste it, and change in the following way:
Quote:

Mencoder.exe -include Movie01.conf -lavcopts vbitrate=2000:vpass=1 "C:\001_MencodeMe\Samples\Movie01.avi" -o "C:\001_MencodeMe\Samples\Movie01.mpv"
Mencoder.exe -include Movie01.conf -lavcopts vbitrate=2000:vpass=2 "C:\001_MencodeMe\Samples\Movie01.avi" -o "C:\001_MencodeMe\Samples\Movie01.mpv"
You should have so many lines as ("movie to encode"*2) for 2 pass encodings. Save your file as Finalencode.bat.

For example if you have 3 movies to encode:
Quote:

Originally Posted by Finalencode.bat
Mencoder.exe -include Movie01.conf -lavcopts vbitrate=2000:vpass=1 "C:\001_MencodeMe\Samples\Movie01.avi" -o "C:\001_MencodeMe\Samples\Movie01.mpv"
Mencoder.exe -include Movie01.conf -lavcopts vbitrate=2000:vpass=2 "C:\001_MencodeMe\Samples\Movie01.avi" -o "C:\001_MencodeMe\Samples\Movie01.mpv"
Mencoder.exe -include Movie02.conf -lavcopts vbitrate=2000:vpass=1 "C:\001_MencodeMe\Samples\Movie02.avi" -o "C:\001_MencodeMe\Samples\Movie02.mpv"
Mencoder.exe -include Movie02.conf -lavcopts vbitrate=2000:vpass=2 "C:\001_MencodeMe\Samples\Movie02.avi" -o "C:\001_MencodeMe\Samples\Movie02.mpv"
Mencoder.exe -include Movie03.conf -lavcopts vbitrate=2000:vpass=1 "C:\001_MencodeMe\Samples\Movie03.avi" -o "C:\001_MencodeMe\Samples\Movie03.mpv"
Mencoder.exe -include Movie03.conf -lavcopts vbitrate=2000:vpass=2 "C:\001_MencodeMe\Samples\Movie03.avi" -o "C:\001_MencodeMe\Samples\Movie03.mpv"

7 - Run direct access
Quote:

"C:\Path to AVSEdit\AVSEdit.exe" path to temp.conf
temp.conf will open in AVSEdit. You will see something like
Quote:

Originally Posted by temp.conf
of=rawvideo=1
ovc=lavc=1
nosound=1
sws=2
lavcopts=vcodec=mpeg2video:vrc_eq=tex:vmax_b_frame s=2:
vrc_maxrate=2500:aspect=1.3333:keyint=24:vrc_buf_s ize=917:preme=2:precmp=2:vstrict=-1:autoaspect=1:
scplx_mask=0.3:vqblur=0:mbqmin=1:vqmin=1:mbqmin=1: lmin=1:
intra_matrix=8,9,12,22,26,27,29,34,9,10,14,26,27,2 9,34,37,12,14,18,27,
29,34,37,38,22,26,27,31,36,37,38,40,26,27,29,36,39 ,38,40,48,27,29,34,
37,38,40,48,58,29,34,37,38,40,48,58,69,34,37,38,40 ,48,58,69,79
:inter_matrix=16,18,20,22,24,26,28,30,18,20,22,24, 26,28,30,32,20,22,24,
26,28,30,32,34,22,24,26,30,32,32,34,36,24,26,28,32 ,34,34,36,38,26,28,
30,32,34,36,38,40,28,30,32,34,36,38,42,42,30,32,34 ,36,38,40,42,44

here you can use my AVSEdit profiles, edit as you want, and when finish,
SAVE FILE AS Movie01.conf or Movie02.conf or Movie03.conf (the name of your first, second, third, etc. movie, with .conf extension) same name that you give it in point 6.
8 - Go to point 5 and repeat from there until you have a Finalencode.bat file like the showed in point 6. Now you have the whole video encoding files ready. You can encode it or go on at the next step.
9 - Now you need make the batch file audio encode section.
Run Besweet, set your source, set your destiny type as mp2 (112 or 128), set your target, make all others settings, click in "Copy Command to Clipboard button" and paste it to the end of Finalencode.bat. Do it with all your source files and you will have this (same previous example with 3 movies encoding):
Quote:

Originally Posted by Finalencode.bat
Mencoder.exe -include Movie01.conf -lavcopts vbitrate=2000:vpass=1 "C:\001_MencodeMe\Samples\Movie01.avi" -o "C:\001_MencodeMe\Samples\Movie01.mpv"
Mencoder.exe -include Movie01.conf -lavcopts vbitrate=2000:vpass=2 "C:\001_MencodeMe\Samples\Movie01.avi" -o "C:\001_MencodeMe\Samples\Movie01.mpv"
Mencoder.exe -include Movie02.conf -lavcopts vbitrate=2000:vpass=1 "C:\001_MencodeMe\Samples\Movie02.avi" -o "C:\001_MencodeMe\Samples\Movie02.mpv"
Mencoder.exe -include Movie02.conf -lavcopts vbitrate=2000:vpass=2 "C:\001_MencodeMe\Samples\Movie02.avi" -o "C:\001_MencodeMe\Samples\Movie02.mpv"
Mencoder.exe -include Movie03.conf -lavcopts vbitrate=2000:vpass=1 "C:\001_MencodeMe\Samples\Movie03.avi" -o "C:\001_MencodeMe\Samples\Movie03.mpv"
Mencoder.exe -include Movie03.conf -lavcopts vbitrate=2000:vpass=2 "C:\001_MencodeMe\Samples\Movie03.avi" -o "C:\001_MencodeMe\Samples\Movie03.mpv"
"d:\BeSweet.exe" -core( -input "c:\001_MencodeMe\samples\Movie01.wav" -output "c:\001_MencodeMe\samples\Movie01.mp2" -be ) -ssrc(--rate 44100 ) -mp2enc( -s 48 -m d -b 128 -e ) -profile( ~~~~~ Default Profile ~~~~~ )
"d:\BeSweet.exe" -core( -input "c:\001_MencodeMe\samples\Movie02.wav" -output "c:\001_MencodeMe\samples\Movie02.mp2" -be ) -ssrc(--rate 44100 ) -mp2enc( -s 48 -m d -b 128 -e ) -profile( ~~~~~ Default Profile ~~~~~ )
"d:\BeSweet.exe" -core( -input "c:\001_MencodeMe\samples\Movie03.wav" -output "c:\001_MencodeMe\samples\Movie03.mp2" -be ) -ssrc(--rate 44100 ) -mp2enc( -s 48 -m d -b 128 -e ) -profile( ~~~~~ Default Profile ~~~~~ )

You can run it and encode or go on at the next step.
10 - Finaly, you only need to write the last mplex lines.
Quote:

Originally Posted by MPLEX KVCD BATCH LINE
C:\001_MencodeMe\mplex.exe -f 2 -V -o C:\001_MencodeMe\Samples\KVCD.mpg C:\001_MencodeMe\Samples\KVCD.mpv C:\001_MencodeMe\Samples\KVCD.mp2

Quote:

Originally Posted by MPLEX SKVCD BATCH LINE
C:\001_MencodeMe\mplex.exe -f 5 -V -o C:\001_MencodeMe\Samples\KSVCD.mpg C:\001_MencodeMe\Samples\KSVCD.mp2 C:\001_MencodeMe\Samples\KSVCD.mpv

Quote:

Originally Posted by MPLEX KDVD BATCH LINE
C:\001_MencodeMe\mplex.exe -f 9 -V -o C:\001_MencodeMe\Samples\KDVD.mpg C:\001_MencodeMe\Samples\KDVD.mpv C:\001_MencodeMe\Samples\KDVD.mp2

And you Finalencode.bat will be for 3 movies, SKVCD, 2 Pass encoding:
Quote:

Originally Posted by Finalencode.bat - SKVCD - 3 movies - 2 Pass encoding
Mencoder.exe -include Movie01.conf -lavcopts vbitrate=2000:vpass=1 "C:\001_MencodeMe\Samples\Movie01.avi" -o "C:\001_MencodeMe\Samples\Movie01.mpv"
Mencoder.exe -include Movie01.conf -lavcopts vbitrate=2000:vpass=2 "C:\001_MencodeMe\Samples\Movie01.avi" -o "C:\001_MencodeMe\Samples\Movie01.mpv"
Mencoder.exe -include Movie02.conf -lavcopts vbitrate=2000:vpass=1 "C:\001_MencodeMe\Samples\Movie02.avi" -o "C:\001_MencodeMe\Samples\Movie02.mpv"
Mencoder.exe -include Movie02.conf -lavcopts vbitrate=2000:vpass=2 "C:\001_MencodeMe\Samples\Movie02.avi" -o "C:\001_MencodeMe\Samples\Movie02.mpv"
Mencoder.exe -include Movie03.conf -lavcopts vbitrate=2000:vpass=1 "C:\001_MencodeMe\Samples\Movie03.avi" -o "C:\001_MencodeMe\Samples\Movie03.mpv"
Mencoder.exe -include Movie03.conf -lavcopts vbitrate=2000:vpass=2 "C:\001_MencodeMe\Samples\Movie03.avi" -o "C:\001_MencodeMe\Samples\Movie03.mpv"
"d:\BeSweet.exe" -core( -input "c:\001_MencodeMe\samples\Movie01.wav" -output "c:\001_MencodeMe\samples\Movie01.mp2" -be ) -ssrc(--rate 44100 ) -mp2enc( -s 48 -m d -b 128 -e ) -profile( ~~~~~ Default Profile ~~~~~ )
"d:\BeSweet.exe" -core( -input "c:\001_MencodeMe\samples\Movie02.wav" -output "c:\001_MencodeMe\samples\Movie02.mp2" -be ) -ssrc(--rate 44100 ) -mp2enc( -s 48 -m d -b 128 -e ) -profile( ~~~~~ Default Profile ~~~~~ )
"d:\BeSweet.exe" -core( -input "c:\001_MencodeMe\samples\Movie03.wav" -output "c:\001_MencodeMe\samples\Movie03.mp2" -be ) -ssrc(--rate 44100 ) -mp2enc( -s 48 -m d -b 128 -e ) -profile( ~~~~~ Default Profile ~~~~~ )
C:\001_MencodeMe\mplex.exe -f 5 -V -o C:\001_MencodeMe\Samples\Movie01.mpg C:\001_MencodeMe\Samples\Movie01.mp2 C:\001_MencodeMe\Samples\Movie01.mpv
C:\001_MencodeMe\mplex.exe -f 5 -V -o C:\001_MencodeMe\Samples\Movie02.mpg C:\001_MencodeMe\Samples\Movie02.mp2 C:\001_MencodeMe\Samples\Movie02.mpv
C:\001_MencodeMe\mplex.exe -f 5 -V -o C:\001_MencodeMe\Samples\Movie03.mpg C:\001_MencodeMe\Samples\Movie03.mp2 C:\001_MencodeMe\Samples\Movie03.mpv

And your Finalencode.bat will be for 3 movies, SKVCD, 1 Pass encoding:
Quote:

Originally Posted by Finalencode.bat - SKVCD - 3 movies - 2 Pass encoding
Mencoder.exe -include Movie01.conf -lavcopts vbitrate=2000:"C:\001_MencodeMe\Samples\Movie01.av i" -o "C:\001_MencodeMe\Samples\Movie01.mpv"
Mencoder.exe -include Movie02.conf -lavcopts vbitrate=2000:"C:\001_MencodeMe\Samples\Movie02.av i" -o "C:\001_MencodeMe\Samples\Movie02.mpv"
Mencoder.exe -include Movie03.conf -lavcopts vbitrate=2000:"C:\001_MencodeMe\Samples\Movie03.av i" -o "C:\001_MencodeMe\Samples\Movie03.mpv"
"d:\BeSweet.exe" -core( -input "c:\001_MencodeMe\samples\Movie01.wav" -output "c:\001_MencodeMe\samples\Movie01.mp2" -be ) -ssrc(--rate 44100 ) -mp2enc( -s 48 -m d -b 128 -e ) -profile( ~~~~~ Default Profile ~~~~~ )
"d:\BeSweet.exe" -core( -input "c:\001_MencodeMe\samples\Movie02.wav" -output "c:\001_MencodeMe\samples\Movie02.mp2" -be ) -ssrc(--rate 44100 ) -mp2enc( -s 48 -m d -b 128 -e ) -profile( ~~~~~ Default Profile ~~~~~ )
"d:\BeSweet.exe" -core( -input "c:\001_MencodeMe\samples\Movie03.wav" -output "c:\001_MencodeMe\samples\Movie03.mp2" -be ) -ssrc(--rate 44100 ) -mp2enc( -s 48 -m d -b 128 -e ) -profile( ~~~~~ Default Profile ~~~~~ )
C:\001_MencodeMe\mplex.exe -f 5 -V -o C:\001_MencodeMe\Samples\Movie01.mpg C:\001_MencodeMe\Samples\Movie01.mp2 C:\001_MencodeMe\Samples\Movie01.mpv
C:\001_MencodeMe\mplex.exe -f 5 -V -o C:\001_MencodeMe\Samples\Movie02.mpg C:\001_MencodeMe\Samples\Movie02.mp2 C:\001_MencodeMe\Samples\Movie02.mpv
C:\001_MencodeMe\mplex.exe -f 5 -V -o C:\001_MencodeMe\Samples\Movie03.mpg C:\001_MencodeMe\Samples\Movie03.mp2 C:\001_MencodeMe\Samples\Movie03.mpv

11 - If your target is KDVD you need to see the convenience or not of multiplexing.
12 - AVSEdit usage: Run direct access
Quote:

"C:\Path to AVSEdit\AVSEdit.exe" path to encode.bat

or

"C:\Path to AVSEdit\AVSEdit.exe" path to temp.conf
and select profiles tab. Drag the left edge to the left to expand the profiles area.
Now you can see this window:

------------------------------------http://www.digitalfaq.com/archives/error.gif

If you select an entry and press Load, all text in the scripting area will be replaced with the specific line script.
If you select an entry and press Paste, the text in the scripting area won't be replaced with the specific line script, but this one will be pasted in actual cursor position.
Save will copy the total scripting area to the script list with the name writed in the upper text box. If this is a previous entry, the text in the scripting area will replace the text saved in the scripting line.
Save set, same as previous, but it will save only highlighted text.
Delete, press it if you want delete an entry.
When you need to save a file, select file, save as, and in the drop down box select "all files", then you can save your script with the right extension (.bat or .conf)
All "scripting line" has a "scipting line comment" that explain filter's function.
It is mandatory that you know basics of mencoder.exe, like separators, filters orders, etc.. If not you batch file maybe won't work at all.

jorel 05-17-2004 07:46 PM

wellllll...before i read all i know that this guide deserve a sticky!
congrats Pro ! :wink: very cool.

STICKY!

@ all:
in the last days the developers of the forum are "driving me crazy" :lol:
before i test some new guide or new prog they build another one and i am lost cos don't know what gift i will open first! 8)

kwag 05-17-2004 07:52 PM

My head hurts 8O
Too much input :o
Thanks Prodater. Great guide :cool: :D

-kwag

Prodater64 05-17-2004 08:02 PM

Quote:

Originally Posted by kwag
My head hurts 8O
Too much input :o
Thanks Prodater. Great guide :cool: :D

-kwag

Well, just relax, it could was be a ten movies script sample. Better don't think about that and take an AAS (Anti AVSEdit Storm).
:lol:

Zyphon 05-18-2004 05:49 AM

Thanks Prodater64 for yet another excellent guide, I do love your guide as they include the Graphics to clearly show what settings need doing.

Great work. :)

yaz 05-19-2004 09:19 AM

nice work but remember to mention that for using avsedit u need to install .net framework 1.1 (nother 25Mb to download) ... hmmm ... wher from u got this 1.0b version ? afaik, the very last version is 1.0a5 (maybe this beta does not require that monster to be installed anymore :-))
the bests
y

incredible 05-19-2004 10:04 AM

OT, according .net framework .. so not according to your guide Prodater ;-) :

Thats also why I do love that PureBasic as it outputs minimal sized executables and no extra to be downloaded .Net stuff has to be on the users pc to let those apps at least work.

OT off.

8)

Prodater64 05-19-2004 02:54 PM

Quote:

Originally Posted by incredible
OT, according .net framework .. so not according to your guide Prodater ;-) :

Thats also why I do love that PureBasic as it outputs minimal sized executables and no extra to be downloaded .Net stuff has to be on the users pc to let those apps at least work.

OT off.

8)

In that case, maybe you can do a mencoder scripting software (I don't know to program).
Meanwhile, for me, AVSEdit is fine, my smaller HD has 40GB, not problem with 20 neither 100MB.
In any case, it is helpfull anyway for people not so expert, that wish go deeply in knowledge of mencoder.exe.
BTW: What does it mean "OT"? :oops:


@yaz: Thank you for your hint.

@Jorel: Thank you so much for that link.

incredible 05-19-2004 04:53 PM

Quote:

Originally Posted by Prodater64
BTW: What does it mean "OT"? :oops:

Off Topic :wink:

oxycotton420 06-12-2004 06:12 PM

hello again predator trying out this guide hehe since i got nothing else to do, anyways i was reading through it and then started working through it.


5 - Make a direct access to the usual batch file (encode.bat) with the following command line:
Quote:
"C:\Path to AVSEdit\AVSEdit.exe" path to encode.bat

for example

"C:\Program Files\AVSEdit\AVSEdit.exe" C:\001_MencodeMe\encode.bat

You can name this direct access "AVSEdit encode.bat". When you run it, AVSEdit will open, with encode.bat for to be edited.
6 - Make a direct access to the usual temp.conf file with the following command line:
Quote:
"C:\Path to AVSEdit\AVSEdit.exe" path to temp.conf

for example

"C:\Program Files\AVSEdit\AVSEdit.exe" C:\001_MencodeMe\temp.conf


this is what i don't get...so i open the encode.bat file and just paste where the directory is? and then open the temp.conf and paste the directory there ?

oxycotton420 06-12-2004 06:18 PM

Quote:

hello again predator trying out this guide hehe since i got nothing else to do, anyways i was reading through it and then started working through it.


5 - Make a direct access to the usual batch file (encode.bat) with the following command line:
Quote:
"C:\Path to AVSEdit\AVSEdit.exe" path to encode.bat

for example

"C:\Program Files\AVSEdit\AVSEdit.exe" C:\001_MencodeMe\encode.bat

You can name this direct access "AVSEdit encode.bat". When you run it, AVSEdit will open, with encode.bat for to be edited.
6 - Make a direct access to the usual temp.conf file with the following command line:
Quote:
"C:\Path to AVSEdit\AVSEdit.exe" path to temp.conf

for example

"C:\Program Files\AVSEdit\AVSEdit.exe" C:\001_MencodeMe\temp.conf

this is what i don't get...so i open the encode.bat file and just paste where the directory is? and then open the temp.conf and paste the directory there ?
LOl never mind as soon as i posted this questions i re read what i wrote and said wait a minute i know what to do hehe :)


All times are GMT -5. The time now is 08:56 AM  —  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.