Log in

View Full Version : Need to create batch script - Avisynth / FLV


Pages : [1] 2

Liquidfusion
19th June 2007, 07:20
Hi. I need to create a batch script to convert multiple .avi files to .flv video files using ON2 std software. Can someone help me understand how to do this? (This saves me from buying the full version of the software.)

First script example = AviSource("c:\folder\myclip.avi")
AviSource / Script Examples (http://avisynth.org/mediawiki/First_script)

Would I just have multiple lines for the different avi files and save as Batch.avs?
AviSource("c:\folder\myclip1.avi")
AviSource("c:\folder\myclip2.avi")
AviSource("c:\folder\myclip3.avi")
AviSource("c:\folder\myclip4.avi")

Thanks!!! / Brewer

///////////////////////////

My giveback to you / My experience with Avisynth / FLV:

I figured a way to import VOB directly into ON2(std) to make .FLV video. This shows Avisynth can work w/ON2 to make FLV videos.

VOB to FLV Shortcut:

1. Copy Video_TS file to harddrive.

2. Use DGIndex / Avisynth to create a .d2v video file and at the same time extract 48Hz wav audio from the VOB.

3. Save the script below as: Myvideo.avs
LoadPlugin("........\Dgmpgdec148\DGDecode.dll")
video=MPEG2Source("............ \...d2v")
audio=WAVSource( "............ \file name 2_0ch 192Kbps 48KHz.wav")
AudioDub(video,audio)

4. Start up Flix. Open "All Files" / Load "Myvideo.avs" into Flix On2 Flv as your input file

5. Set Flix/On2 for FLV encoding / Run Flix!!!!!!!!!!! Bottom Line .:. FLV that looks great / 1 step from VOB!!!

chros
19th June 2007, 08:20
If you want to combine several files:

a=AviSource("c:\folder\myclip1.avi")
b=AviSource("c:\folder\myclip2.avi")
c=AviSource("c:\folder\myclip3.avi")
d=AviSource("c:\folder\myclip4.avi")

a+b+c+d


See the avisynth documentation, there's several joining function.

Edit: OK, I see that is not your goal :)
So, if Flix has command line parameters, then you must create a *.bat file, and 1 avs file for each avi file:
and avs file, eg. 1stavi.avs:
AviSource("c:\folder\myclip2.avi")
then, the bat file:
flix -option1 -option2 1stavi.avs
flix -option1 -option2 2ndavi.avs
Then just run the bat file ...

smok3
19th June 2007, 08:39
check:
http://sh0dan.blogspot.com/2006/09/command-line-flash-8-flv-encoding.html
(you dont need flix)

p.s. i have mirrored all the things that are needed, let me know if you have trouble googling stuff.

Liquidfusion
19th June 2007, 15:59
Great Help!! Thanks.

Can I use this? http://www.on2.com/technology/vp7/vp7-download/

ffmpeg win32 binary including VP6 FLV mux patch
Won't unzip...

Liquidfusion
20th June 2007, 07:25
Installed AviSynth
Installed VP6.4.2

Created folder C:\Test_FLV\
Unpacked ffmpeg-VP6-FLV (folder)
Unpacked VP6-FLV-toolpack (folder)
Made short example.avi
Added example.avi to ffmpeg-VP6-FLV (folder)
CMD PMT / CMD Line
C:\Test_FLV\VP6-FLV-toolpack\example.bat

No FLV............

Tried unpacking into one folder C:\Test_FLV\
ffmpeg-VP6-FLV (folder)
VP6-FLV-toolpack (folder)
Added example.avi to C:\Test_FLV\
CMD PMT / CMD Line
C:\Test_FLV\example.bat

No FLV............

smok3
20th June 2007, 07:31
Liquidfusion, follow the instructions by the letter until you got your 1st result, than you can change/customize (you need to do a codec config file, you need to write avisynth script, ect...)

Liquidfusion
20th June 2007, 07:49
follow the instructions by the letter until you got your 1st result

sorry / very confused about unpacking into a directory.... Do you mean folder? very basic stuff. Does this mean unpacking ffmpeg-VP6-FLV and VP6-FLV-toolpack both into one folder, then adding example.avi?

Running example.bat - how do you so this?

I really look forward to getting this right. Thanks.

1) AviSynth 2.58 (alfa)
2) VP6.4.2
3) ffmpeg-VP6-FLV - this was off your mirror
4) VP6-FLV-toolpack

I have Flix Std installed. Is this getting in the way?

smok3
20th June 2007, 07:58
you can unpack *.exe files to the same folder, however it is easirer to unpack them to some system 'path' like c:\windows\system32

Liquidfusion
20th June 2007, 08:16
AviSynth 2.58 - ran setup by clicking *.exe
VP6.4.2 - I unpacked the rar and ran setup


What about these?
ffmpeg-VP6-FLV
VP6-FLV-toolpack
Your instructions say to put these into a directory

Unpack ffmpeg and the toolpack from above in the same directory.
Put an AVI file called "example.avi" (that is readable by AviSynth) into the directory with ffmpeg.
Run "example.bat".

I'm lost as to what you mean here. What do you mean by directory? Have to ask to get it right. Thanks.

Do you mean unpack ffmpeg-VP6-FLV / VP6-FLV-toolpack to c:\windows\system32?
How do you run example.bat?

Other question: how do I get this to convert multiple .avi files to flv files?

smok3
20th June 2007, 11:21
i dont have any instructions..., you need to follow what shodan wrote in the blog.

Other question: how do I get this to convert multiple .avi files to flv files?

you need to write a proper batch file for this.

ficofico
20th June 2007, 15:53
I've modified the script for vp7 encoding from dv interlaced file. All works very well, because in avs file I use "avisource". When I try to use directshowsource for opening mp4 file( for another project), avs2avi crash after few second. Is there another input plugins that is able to open mp4 h264 properly? When I try to open with virtualdub, all work good, but for avs2avi no. Maybe with another specific input plugins also avs2avi can work with mp4 file.

smok3
20th June 2007, 17:06
ficofico, maybe http://forum.doom9.org/showthread.php?t=127037

Liquidfusion
20th June 2007, 17:14
I asked what is meant by unpacking into a directory. In order to follow instructions one has to understand what they are. I tried unpacking the files on your mirror - that worked. The file "ffmpeg win32 binary including VP6 FLV mux patch" did not unpack from the blog as it is part of a multiple set. So I used your files. That said, I need to know what to do with the unpacked files: ffmpeg-VP6-FLV and VP6-FLV-toolpack.


Your answer: i dont have any instructions..., you need to follow what shodan wrote in the blog.

From the Blog / Short how-to:Install AviSynth.
Install VP6.2 codec.
Unpack ffmpeg and the toolpack from above in the same directory.
Put an AVI file called "example.avi" (that is readable by AviSynth) into the directory with ffmpeg.
Run "example.bat".
Wait.
You should (with a bit of luck) have an "example.flv" by the time the bat file finishes.

Upack into what directory? I might not have your knowledge. I don't understand the highlighted terms. That's no reason for you not to show me the way.

you need to write a proper batch file for this.Right. Fly light-speed as well why don't you add.

Liquidfusion
20th June 2007, 17:25
Reason I'm posting here is because I don't know how to do these things and need to learn. I'm a musician learning this. It's like me telling you to play a hendrix solo and you asking me what the chords are underneath. I'd say the answer: learn doublestops - the art of playing 2 notes together that when put through a wah / fuzz - sound like a chord. Then I'd tell you to get your blues scales down tight. Finally listen to the man play. You'd now have a road map to follow. To get it right. I just showed you the way. Taking acid is optional. Not to be thrown in the face.

Liquidfusion
20th June 2007, 18:29
It's a great feeling when we can work things out right. "We can work it out" / Beatles

It's like playing guitar to people and seeing their energy rise to meet the sky. Being in sync w/ the universe.

smok3
20th June 2007, 20:24
actually, somebody wrote some batches allready:
http://tigerix.ti.funpic.de/blogspot.com/flv-vp62-encoder.html

Upack into what directory?

for testing purposes any folder will do just fine, like d:\myflvtests

Liquidfusion
21st June 2007, 07:05
Deleted: VP6.4.2
installed: vp6_vfw_codec.exe
tested scripts. upgraded to VP6.4.2
Did this just in case the codec was damaged

Created C:\myflvtests
Copied: ffmpeg-VP6-FLV
Copied: VP6-FLV-toolpack

Created short example.avi
Added it to the "ffmpeg-VP6-FLV" folder


edited example.bat
rem to configure use this:
avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -s vp62.conf -e -w
rem to encode, use this:
rem avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -l vp62.conf -w
ffmpeg.exe -ab 128 -ac 2 -ar 44100 -y -i "temp.avi" -vcodec copy -i "example.avs"
"example.flv"
del "temp.avi"
@echo Finished!

Note when I changed "ffmpeg" to "ffmpeg.exe," the script started working. Changed it back to "ffmpeg." Read notes. Tried small changes to see what happens. Can't find any example.flv

Using Video Compressor VP62 Heightened Sharpeness / Just saw this: "WARNING - 1st pass file can't be read" ?????????????????????

AVS2AVI v1.39 (c) 2002-2004:
Christophe Paris, David Leatherdale, int21h, Mo
http://www.avs2avi.org/

Source:
* Filename: "C:\myflvtests\VP6-FLV-toolpack\e
* FourCC: None (RGB32)
* Frames: 240
* Resolution: 544x80
* Frame rate: 24.000 FPS
Compressor:
* Name: VP62« Heightened Sharpness Profile
* FourCC: VP62
Destination:
* Filename: "C:\myflvtests\VP6-FLV-toolpack\t
* Pass 1/2: Frame 2/240, 0 B, 0.00 FPS, ETA


/////////////////////////////

Running Script (when it works)
What happens - I get a small box
Video Compression
Compressor
I select VP62 / Heightened Sharpness Profile
Compression quality 100%
Click OK
Script action repeats as above.
Runs.
No flv!!!!!!!!

/////////////////////////////

This example.bat has no script action -

rem to configure use this:
rem avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -s vp62.conf -e -w
rem to encode, use this:
avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -l vp62.conf -w
ffmpeg.exe -ab 128 -ac 2 -ar 44100 -y -i "temp.avi" -vcodec copy -i "example.avs"
"example.flv"
del "temp.avi"
@echo Finished!

Liquidfusion
21st June 2007, 07:30
Using Video Compressor VP61 Advanced Profile I get 2 passes - but no saved FLV file.....

rem to configure use this:
avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -s vp62.conf -e -w
rem to encode, use this:
avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -l vp62.conf -w
ffmpeg -ab 128 -ac 2 -ar 44100 -y -i "temp.avi" -vcodec copy -i "example.avs"
"example.flv"
del "temp.avi"
@echo Finished!

Liquidfusion
21st June 2007, 07:49
Tried changing avisource to:

Directshowsource("example.avi")
converttoyv12()
#Insert more filters here
ssrc(44100)
convertaudioto16bit()
flipvertical()

Actually took time for each pass (longer than when it was avisource)
VP61 - 1st Pass / best quality

No FLV................

gzarkadas
21st June 2007, 08:07
...
ffmpeg -ab 128 -ac 2 -ar 44100 -y -i "temp.avi" -vcodec copy -i "example.avs"
"example.flv"
...

Check that you didn't accidentaly entered a line break in the above ; it should be in one line only in order to work:

ffmpeg -ab 128 -ac 2 -ar 44100 -y -i "temp.avi" -vcodec copy -i "example.avs" "example.flv"

Disable automatic wrapping of lines in your text editor if it is activated.

Liquidfusion
21st June 2007, 08:14
Disable automatic wrapping of lines in your text editor if it is activated.Thanks gzarkadas

rem to configure use this:
rem avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -s vp62.conf -e -w

rem to encode, use this:
avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -l vp62.conf -w

ffmpeg -ab 128 -ac 2 -ar 44100 -y -i "temp.avi" -vcodec copy -i "example.avs" "example.flv"

del "temp.avi"

@echo Finished!

////////////////////////////

No FLV

But - this script runs w/o asking for video compression automatically..... most likely as it should. I now see the difference between configure and encode!!! I am such a newbie!!!!!!

Where is the example.flv ????? Searched PC - nothing.

Liquidfusion
21st June 2007, 08:28
C:\myflvtests\VP6-FLV-toolpack>rem to configure use this:
C:\myflvtests\VP6-FLV-toolpack>rem avs2avi.exe "example.avs" "temp.avi" -P 2 -p
0 -s vp62.conf -e -w
C:\myflvtests\VP6-FLV-toolpack>rem to encode, use this:
C:\myflvtests\VP6-FLV-toolpack>avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -l
vp62.conf -w

AVS2AVI v1.39 (c) 2002-2004:
Christophe Paris, David Leatherdale, int21h, Moitah
http://www.avs2avi.org/

Source:
* Filename: "C:\myflvtests\VP6-FLV-toolpack\example.avs"
* FourCC: YV12
* Frames: 5009
* Resolution: 720x480
* Frame rate: 29.970 FPS
Compressor:
* No Recompression
Destination:
* Filename: "C:\myflvtests\VP6-FLV-toolpack\temp.avi"
* Pass 1/2: Frame 1521/5009, 751.96 MB, 22.17 FPS, ETA 00:02:37


Copied this in processing - Why is filename destination temp.avi instead of example.flv?

smok3
21st June 2007, 08:44
you can test your avs script by droping it into some player or/and virtualdub, if it doesnt work, encoding wont work either (always test avs scripts...).

temp.avi is a temporary encode which will later get muxed into flv and deleted at the end.

gzarkadas
21st June 2007, 08:45
Open a command prompt and CD to your folder, then type "example > error_log.txt" to run the batch from the command line and store all output to the screen in an error log. Post the error_log.txt contents to see what's happening (I am interested in ffmpeg's messages).
Edit:

Deleted some rendundant (after the in-parallel smok3's post) stuff.

Liquidfusion
21st June 2007, 09:09
start / run / C:\myflvtests\VP6-FLV-toolpack\example > error_log.txt

C:\myflvtests\VP6-FLV-toolpack>rem to configure use this:

C:\myflvtests\VP6-FLV-toolpack>rem avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -s vp62.conf -e -w

C:\myflvtests\VP6-FLV-toolpack>rem to encode, use this:

C:\myflvtests\VP6-FLV-toolpack>avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -l vp62.conf -w

C:\myflvtests\VP6-FLV-toolpack>ffmpeg -y -i "temp.avi" -vcodec copy -i "example.avs" "example.flv" -ab 128 -ac 2 -ar 44100

C:\myflvtests\VP6-FLV-toolpack>del "temp.avi"
Finished!

Note: I tried changing position of audio to see if FLV would work.

///////////////////////////////


start / run / C:\myflvtests\VP6-FLV-toolpack\example > error_log.txt

Normal example.bat

C:\myflvtests\VP6-FLV-toolpack>rem to configure use this:

C:\myflvtests\VP6-FLV-toolpack>rem avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -s vp62.conf -e -w

C:\myflvtests\VP6-FLV-toolpack>rem to encode, use this:

C:\myflvtests\VP6-FLV-toolpack>avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -l vp62.conf -w

C:\myflvtests\VP6-FLV-toolpack>ffmpeg -ab 128 -ac 2 -ar 44100 -y -i "temp.avi" -vcodec copy -i "example.avs" "example.flv"

C:\myflvtests\VP6-FLV-toolpack>del "temp.avi"
Finished!

Liquidfusion
21st June 2007, 09:18
Thanks smok3 you can test your avs script by droping it into some player or/and virtualdub, if it doesnt work, encoding wont work either (always test avs scripts...). Weird!!!!!! Upside down video!!! I remember that's as it should be from reading the blog....If I get this in virtualdubmod, then the script is working. Good test.


temp.avi is a temporary encode which will later get muxed into flv and deleted at the end.
Not happening. No muxing into FLV....

smok3
21st June 2007, 09:24
then type "example > error_log.txt

probably should be
example.bat 2> error_log.txt
?

gzarkadas
21st June 2007, 09:28
@LiquidFusion,

Apparently you do not have ffmpeg installed (I tried to download the zip from shodan's blog and it always gave me an invalid file format; such errors cannot be ignored).

So, you have to start from the beggining, with a simpler process, which is the following (I verified it works):


Download the package at the link below, pointed out by smok3:
actually, somebody wrote some batches allready:
http://tigerix.ti.funpic.de/blogspot.com/flv-vp62-encoder.html
Unzip the package to a folder of your choice (say c:\myflvs), preserving content's folder structure.
Copy the original in shodan's toolpack "example.avs" file inside this folder (c:\myflvs)
Copy there also your "example.avi", with that name
Copy the following text in a .cmd (or .bat) file, say "convert.cmd" inside this folder also (c:\myflvs)

@echo off
if exist vp62.conf goto doencode
tools\avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -s vp62.conf -e -w
:doencode
tools\avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -l vp62.conf -w
tools\ffmpeg -ab 128 -ac 2 -ar 44100 -y -i "temp.avi" -vcodec copy -i "example.avs" "example.flv"
del "temp.avi"

Run the .cmd or .bat file and choose "VP62 Heightened Sharpness" as the codec at the dialog box that appears (this will happen only at the first, afterwards the config file will be used)

The .flv should be output in the same folder (c:\myflvs).

gzarkadas
21st June 2007, 09:32
probably should be
example.bat 2> error_log.txt
?

I guess so; anyway I figured out what's happening. Thanks for the link to tigerix :).

Liquidfusion
21st June 2007, 09:56
Did 1/2/3/4/5

Copied script to txt file - named it: convert.cmd

6. ran codec setup:
C:\myflvs\Tigerix_FLV_VP62_Encoder\scripts\codec_setup.bat
VP62 Heightened Sharpness

The .flv should be output in the same folder (c:\myflvs).No FLV

Liquidfusion
21st June 2007, 09:59
C:\myflvtests\VP6-FLV-toolpack\example.bat 2> error_log.txt

'ffmpeg' is not recognized as an internal or external command,
operable program or batch file.

Liquidfusion
21st June 2007, 10:01
C:\myflvs\convert.cmd 2> error_log.txt

The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
Could Not Find C:\myflvs\temp.avi


convert.cmd

@echo off
if exist vp62.conf goto doencode
tools\avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -s vp62.conf -e -w
:doencode
tools\avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -l vp62.conf -w
tools\ffmpeg -ab 128 -ac 2 -ar 44100 -y -i "temp.avi" -vcodec copy -i "example.avs" "example.flv"
del "temp.avi"

Liquidfusion
21st June 2007, 10:03
renamed convert.cmd to example.bat
C:\myflvs\example.bat 2> error_log.txt

The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
Could Not Find C:\myflvs\temp.avi

Liquidfusion
21st June 2007, 10:20
Tried unpacking file
C:\Tigerix_FLV_VP62_Encoder

Downloaded
K-Lite-Codec-Pack) -> http://www.freecodecs.com/K_Lite_Codec_Pack_download.htm


Error log

FFmpeg version SVN-r6373, Copyright (c) 2000-2004 Fabrice Bellard
FLV VP6 mux version. Patch by Benjamin Larsson, compile by Klaus Post
configuration: --enable-memalign-hack --enable-avisynth --enable-swscaler --enable-mp3lame --enable-gpl
libavutil version: 49.0.1
libavcodec version: 51.16.0
libavformat version: 50.5.0
built on Sep 29 2006 19:38:14, gcc: 3.4.5 (mingw special)
temp.avi: I/O error occured
Usually that means that input file is truncated and/or corrupted.
Could Not Find C:\Tigerix_FLV_VP62_Encoder\temp.avi


changed example.avs to point to a 5 min avi

avisource("Video_1__Kitchen_Als_BklynNY_06162007.avi")
converttoyv12()
#Insert more filters here
ssrc(44100)
convertaudioto16bit()
flipvertical()


Error log

FFmpeg version SVN-r6373, Copyright (c) 2000-2004 Fabrice Bellard
FLV VP6 mux version. Patch by Benjamin Larsson, compile by Klaus Post
configuration: --enable-memalign-hack --enable-avisynth --enable-swscaler --enable-mp3lame --enable-gpl
libavutil version: 49.0.1
libavcodec version: 51.16.0
libavformat version: 50.5.0
built on Sep 29 2006 19:38:14, gcc: 3.4.5 (mingw special)
temp.avi: I/O error occured
Usually that means that input file is truncated and/or corrupted.
Could Not Find C:\Tigerix_FLV_VP62_Encoder\temp.avi

gzarkadas
21st June 2007, 11:08
@Liquidgusion,

You don't take the time to read the instructions carefully, and you inject your own steps in the process. And this is the source of all of your troubles; no-one can help you at that.

1. No codec-pack install is necessary, I simply unzipped contents and run the batch file which i gave you with an example avi; i got the flv immediately, at the first try and working.

2. All your new processing should be done in the new folder that was created by dowloading tigerix scripts and tools; please delete the previous folder to not confuse you.

3. Don't modify the .avs script; it is not the source of your trouble.

Do a clean start from the beginning, with no additional steps and modifications. Keep it simple :).

Liquidfusion
21st June 2007, 17:25
You don't take the time to read the instructions carefully
Hi. I did exactly what you said - and it did not work. I then read the READ ME in the Tigerix_FLV_VP62_Encoder folder - he says to dowload the Klite codec pack. Since nothing was working I tried that.

Did 1/2/3/4/5
Copied script to txt file - named it: convert.cmd
6. ran codec setup:
C:\myflvs\Tigerix_FLV_VP62_Encoder\scripts\codec_setup.bat
VP62 Heightened Sharpness
The .flv should be output in the same folder (c:\myflvs).
No FLV

simply unzipped contents and run the batch file which i gave you with an example avi; i got the flv immediately, at the first try and working.This did not work. I did not modify the avs file when I put it first into the Tigrix folder. I'll erase all and redo the steps you listed again.

Liquidfusion
21st June 2007, 17:42
C:\myflvs folder
Tigerix_FLV_VP62_Encoder folder extracted by winzip directly to the C:\myflvs folder
added convert.cmd
added unmodded example.avs from VP6-FLV-toolpack
added short example.avi

Run the .cmd or .bat file and choose "VP62 Heightened Sharpness" as the codec at the dialog box that appears (this will happen only at the first, afterwards the config file will be used) Running the convert.cmd that I made - it just flashed by.............. (Just to check: ran setup file C:\myflvs\Tigerix_FLV_VP62_Encoder\scripts\codec_setup.bat - to see if that worked. It did. Not sure if this what you were referring to.)

.avs script

avisource("example.avi")
converttoyv12()
#Insert more filters here
ssrc(44100)
convertaudioto16bit()
flipvertical()

convert.cmd - made with code copied from your post:

@echo off
if exist vp62.conf goto doencode
tools\avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -s vp62.conf -e -w
:doencode
tools\avs2avi.exe "example.avs" "temp.avi" -P 2 -p 0 -l vp62.conf -w
tools\ffmpeg -ab 128 -ac 2 -ar 44100 -y -i "temp.avi" -vcodec copy -i "example.avs" "example.flv"
del "temp.avi"

From your instructions, I copied only example.avs from VP6-FLV-toolpack.
Checking Tigerix_FLV_VP62_Encoder, I don't see vp62.conf file in C:\myflvs\Tigerix_FLV_VP62_Encoder\config

C:\myflvs\convert.cmd 2>error_log.txt
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
Could Not Find C:\myflvs\temp.avi

Running convert.cmd did not make an FLV.

gzarkadas
21st June 2007, 22:33
The attached file shows my (working) folder structure. From your last post, the folder where you should put convert.cmd and all example.* files is C:\myflvs\Tigerix_FLV_VP62_Encoder and not C:\myflvs (this is not your fault, there is an inherent vagueness in what unzipping to a folder means). This time it should work.

Liquidfusion
22nd June 2007, 06:55
YEAH!!!!!!!!
made an FLV!!!!!!!!!!
thanks to both of you!!!!!!!!!!!!!
Smok3
gzarkadas

Question:

1. video is sharp. Can I lessen this effect?
2. Tigrix said we can batch convert...........
3. Is this way as good as the blog way? Pobbibly this is better.....

YEAH!!!!!!!!!!!!!!!!!!!!!!!!!!!
I love this place. We can solve the world.
Brewer NYC / NY

What happens with AVSLib?????

Liquidfusion
22nd June 2007, 07:02
Making multiple flv files from avis........

convert.cmd

@echo off
if exist vp62.conf goto doencode
tools\avs2avi.exe "example1.avs" "temp.avi" -P 2 -p 0 -s vp62.conf -e -w
:doencode
tools\avs2avi.exe "example1.avs" "temp.avi" -P 2 -p 0 -l vp62.conf -w
tools\ffmpeg -ab 128 -ac 2 -ar 44100 -y -i "temp.avi" -vcodec copy -i "example1.avs" "example1.flv"
del "temp.avi"
@echo off
if exist vp62.conf goto doencode
tools\avs2avi.exe "example2.avs" "temp.avi" -P 2 -p 0 -s vp62.conf -e -w
:doencode
tools\avs2avi.exe "example2.avs" "temp.avi" -P 2 -p 0 -l vp62.conf -w
tools\ffmpeg -ab 128 -ac 2 -ar 44100 -y -i "temp.avi" -vcodec copy -i "example2.avs" "example2.flv"
del "temp.avi"
@echo off
if exist vp62.conf goto doencode
tools\avs2avi.exe "example3.avs" "temp.avi" -P 2 -p 0 -s vp62.conf -e -w
:doencode
tools\avs2avi.exe "example3.avs" "temp.avi" -P 2 -p 0 -l vp62.conf -w
tools\ffmpeg -ab 128 -ac 2 -ar 44100 -y -i "temp.avi" -vcodec copy -i "example3.avs" "example3.flv"
del "temp.avi"


example1.avs
avisource("example1.avi")
converttoyv12()
#Insert more filters here
ssrc(44100)
convertaudioto16bit()
flipvertical()

example2.avs
avisource("example2.avi")
converttoyv12()
#Insert more filters here
ssrc(44100)
convertaudioto16bit()
flipvertical()

example3.avs
avisource("example31.avi")
converttoyv12()
#Insert more filters here
ssrc(44100)
convertaudioto16bit()
flipvertical()

What options can we play with?

gzarkadas
22nd June 2007, 09:08
For batch-converting multiple files it is better to use a more sophisticated script (see code below). Name it convertall.cmd to have both single and multiple versions and place it in the same folder as convert.cmd.

@echo off
if exist vp62.conf goto doencode
tools\avs2avi.exe "config\default.avs" -P 2 -p 1 -s vp62.conf -e -w
:doencode

for %%f in (*.avi) do (
echo AviSource^("%%f"^) > %%~pnf.avs
echo converttoyv12 >> %%~pnf.avs
echo ssrc^(44100^) >> %%~pnf.avs
echo convertaudioto16bit >> %%~pnf.avs
echo flipvertical >> %%~pnf.avs
tools\avs2avi.exe "%%~pnf.avs" "temp.avi" -P 2 -p 1 -l config\vp62.conf
tools\ffmpeg -ab 128 -ac 2 -ar 44100 -y -i "temp.avi" -vcodec copy -i "%%~pnf.avs" "%%~pnf.flv"
del "temp.avi"
)

With this script you only have to copy the .avi files inside the folder where the .cmd is (c:\myflvs\Tigerix_FLV_VP62_Encoder in your case). The .avs will be automatically created.

You must also copy the initial example.avs in the config subfolder and rename it to default.avs.

Now the vp62.conf file will be created inside the config subfolder; thus single file and batch file conversions will have different config files.

About adjusting conversion settings:

Avs2avi is set (by the -P 2 switch) to do a 2-pass encoding. This is why 2 dialog boxes appear in the initial config step.

At the 1st dialog box press, after selecting the VP62 coded, the "change settings" button (the wording may appear differently to your system) and select the desired parameters. Remember to set the drop-down-list to 2 Pass - First Pass.

At the 2nd dialog box keep the same parameters and change the drop-down-list to 2 Pass - Second Pass (either Good Quality or Best Quality).

Experiment, until you find the right settings for your videos.

Tip:
You may want also to try, after getting the hand on this, the tigerix's convert.bat (inside the scripts subfolder) which is more sophisticated and allows conversion of .wmv files also :cool: .

Liquidfusion
22nd June 2007, 17:31
ran new setup to make mulitple avi / flv

1 pass / best quality works

Audio sounds a little choppy...... 128kbps/44kHz
I wonder if reducing screen size to 320X240 will help here.........

Liquidfusion
22nd June 2007, 18:54
Noticed: with original example.avi to example.flv

Vp62.conf - delete this to reset compressor

2 pass best quality - doesn't work
1 pass best quality - works

Audio is choppy.
screen is too big.
320X240 would be better.

smok3
22nd June 2007, 18:58
320X240 would be better.
modify example.avs, add scaling, check http://avisynth.org on how.

p.s. i will do a batch to be used with total commander in this days.

Liquidfusion
22nd June 2007, 19:15
thanks smok3

http://avisynth.org/mediawiki/Script_examples

Example 2: Resizing
AVISource("somevideo.avi")
# resize the dimensions of the video frame to 320x240
LanczosResize(320, 240)

smok3
22nd June 2007, 19:24
yes, full script would be something like:
avisource("example.avi")
converttoyv12()

#Insert more filters here
LanczosResize(320, 240)

ssrc(44100)
convertaudioto16bit()
flipvertical()

Liquidfusion
22nd June 2007, 19:32
Ok / Must remember to have example.avi in folder!!!!!! - when running convert.cmd
Smaller size seems to help with sound.

running convert.cmd - example.avi
Script is flying by. Not painful frame by frame. Is there a way to go 2 pass / best quality?

with convertall.cmd -
script is going slow / frame by frame
I have example.avi / Test1.avi / Test2.avi / Test3.avi /


About adjusting conversion settings:
Avs2avi is set (by the -P 2 switch) to do a 2-pass encoding. This is why 2 dialog boxes appear in the initial config step.

At the 1st dialog box press, after selecting the VP62 coded, the "change settings" button (the wording may appear differently to your system) and select the desired parameters. Remember to set the drop-down-list to 2 Pass - First Pass.

At the 2nd dialog box keep the same parameters and change the drop-down-list to 2 Pass - Second Pass (either Good Quality or Best Quality).

Experiment, until you find the right settings for your videos.

Tip: You may want also to try, after getting the hand on this, the tigerix's convert.bat (inside the scripts subfolder) which is more sophisticated and allows conversion of .wmv files also .

Thanks gzarkadas!!!!!
will play with this later...........

so far making example.flv / Test1.avs
...... all seems as it should.................

My pc 1gHz cpu / 512 rambus ram XP PRo sp2
Dell XPS B1000r / only CPU / memory are original

Liquidfusion
22nd June 2007, 20:39
@echo off
if exist vp62.conf goto doencode
tools\avs2avi.exe "config\default.avs" -P 2 -p 1 -s vp62.conf -e -w
:doencode

for %%f in (*.avi) do (
echo AviSource^("%%f"^) > %%~pnf.avs
echo converttoyv12 >> %%~pnf.avs
echo ssrc^(44100^) >> %%~pnf.avs
echo convertaudioto16bit >> %%~pnf.avs
echo flipvertical >> %%~pnf.avs
tools\avs2avi.exe "%%~pnf.avs" "temp.avi" -P 2 -p 1 -l config\vp62.conf
tools\ffmpeg -ab 128 -ac 2 -ar 44100 -y -i "temp.avi" -vcodec copy -i "%%~pnf.avs" "%%~pnf.flv"
del "temp.avi"
)

When coding multiple .avi files -
How do I change size to 320X240 ???
Thanks

default.avs:

avisource("example.avi")
converttoyv12()
#Insert more filters here
LanczosResize(320, 240)
ssrc(44100)
convertaudioto16bit()
flipvertical()

Still makes large size flvs........

smok3
22nd June 2007, 22:07
here is my try at making a batch script (to be used from total commander):
http://somestuff.org/bat/flvENC_distro_smok3_2007/
there is even a readme :)

edit: things i should also write in readme:
- naming scheme should be smart enough so that if you have a multicore machine, you should be able to run N incarnations of the script (on different input files that are in different folders of course - only problem are codec stats files...).
- script does some user-stupidity checking, but ... there could be holes
- idea is based on avisynth templates, where string 'film.avi' gets replaced on run time
- ect..

todo:
- in next version if there will be a need, make things happen in subfolders so that multiple incarnations could happen on the same set of files (to solve the codec stats files)
- what is the easy way to get flv resolution in pixels back into the script as variables, so i could do some renaming? (final flv name can be for example myfile_512_288.flv)

gzarkadas
22nd June 2007, 23:38
When coding multiple .avi files -
How do I change size to 320X240 ???

Add the line in blue inside the script (or just copy it all):

@echo off
if exist vp62.conf goto doencode
tools\avs2avi.exe "config\default.avs" -P 2 -p 1 -s vp62.conf -e -w
:doencode

for %%f in (*.avi) do (
echo AviSource^("%%f"^) > %%~pnf.avs
echo converttoyv12 >> %%~pnf.avs
echo LanczosResize^(320, 240^) >> %%~pnf.avs
echo ssrc^(44100^) >> %%~pnf.avs
echo convertaudioto16bit >> %%~pnf.avs
echo flipvertical >> %%~pnf.avs
tools\avs2avi.exe "%%~pnf.avs" "temp.avi" -P 2 -p 1 -l config\vp62.conf
tools\ffmpeg -ab 128 -ac 2 -ar 44100 -y -i "temp.avi" -vcodec copy -i "%%~pnf.avs" "%%~pnf.flv"
del "temp.avi"
)


@smok3,

Your scripts are smoking :cool: !