Log in

View Full Version : HCbatch question


esso
30th July 2005, 02:29
would someone be able to give me a small tutorial on how to do batch encoding with HCbatch?
i've tried a bunch of ways including using a start /wait command to no avail. and i have no knowledge of .bat files. i tried to make one using the cli and when i save it its not in the folder i save it to.
if anyone can help that would be great, if not i'll be content doing them one at a time :)

Pookie
30th July 2005, 05:02
For every file you want to encode, you'll want to create an .ini file to call from HCBatch.

Let's say you've been recording "Lost" episodes. You have a directory structure such as:

D:\lost\1\
D:\lost\2\
D:\lost\3\
D:\lost\4\

A different folder for each episode. To make your work easier, start a file naming convention for your .AVS, .INI, and .M2V files. If I wanted to encode the video in D:\lost\1\ , I'd create the following files in that specific folder:

lost1.avs -> whatever avisynth stuff you decide to put there
lost1.ini -> what hcbatch will read for encoding

here's my example lost1.ini file
*INFILE D:\lost\1\lost1.avs
*OUTFILE D:\lost\1\lost1.m2v
*LOGFILE D:\lost\1\lost1.log
*CPU Auto
*PROFILE best
*SCANMETHOD ZIGZAG
*ASPECT 9:16
*BITRATE 6800000
*MAXBITRATE 9100000
*DC_PREC 10
*GOP 12 2
*BATCH
*INTRAMATRIX
8 16 19 22 26 28 32 38
16 16 22 24 28 32 38 44
19 22 26 28 32 38 44 48
22 22 26 32 38 44 48 54
22 26 32 38 44 48 54 64
26 32 38 44 48 54 64 74
32 38 44 48 54 64 74 84
38 44 48 54 64 74 84 94
*NONINTRAMATRIX
16 20 24 28 32 36 40 44
20 24 28 32 36 40 44 48
24 28 32 36 40 44 48 52
28 32 36 40 44 48 52 56
32 36 40 44 48 52 56 58
36 40 44 48 52 56 58 60
40 44 48 52 56 58 60 62
44 48 52 56 58 60 62 62

for the SECOND episode, I'd create AVS and INI files which would be named...
you guessed it - lost2.avs and lost2.ini and put them in the d:\lost\2\ folder.
Of course, you'll want to change your lost2.ini file so it points to the lost2.avs file and will create an mpeg file called lost2.m2v


To invoke the HCbatch encoder, copy the following commands and save it as filename LostEnc.Bat in the SAME folder as your HCbatch.exe file.

rem -----------encoding first 2 episodes of lost--------------
HCBatch -ini d:\lost\1\lost1.ini
HCBatch -ini d:\lost\2\lost2.ini
pause
rem------------------------end encode-----------------------

Prodater64
30th July 2005, 05:04
would someone be able to give me a small tutorial on how to do batch encoding with HCbatch?
i've tried a bunch of ways including using a start /wait command to no avail. and i have no knowledge of .bat files. i tried to make one using the cli and when i save it its not in the folder i save it to.
if anyone can help that would be great, if not i'll be content doing them one at a time :)

1 - Create a text file and rename it to Batchlist.bat or any name with bat extension. It is better if you save it in HCBatch.exe folder where it should be the ini files for conversions.
2 - For each encoding you want to do add a line like:

start "HC-Batch" /wait HCBatch_015.exe "-ini" "path_to_your.ini" "-i" "path_to_input_file(avs or whatelse)" "-o" "path to your.m2v" "-log" "path to your.log" "-b" "avgbtr" "-maxbitrate" "maxbtr"

i.e.:
start "HC-Batch" /wait HCBatch_015.exe "-ini" "C:\movies\matrix.ini" "-i" "C:\movies\matrix.avs" "-o" "C:\movies\matrix.m2v" "-log" "C:\movies\matrix.log" "-b" "2500" "-maxbitrate" "8500"

All other settings are defined in ini files. Read pdf that comes with HC Encoder pack and also template.ini
A space before * inactivates function. If you delete the space before * it activates the function.

+-------------------------------
HC.ini template
These commands are required
Use full pathnames and just use the bitrate you want
-------------------------------
*infile d:\....\test.avs
*outfile d:\....\test.m2v
*bitrate 4000
*maxbitrate 9000
-------------------------------
Next commands are optional
putting a space for it disables a command
Not all commands are shown here,
see the manual for a complete list and default values
-------------------------------
*wait 0
*logfile d:\....\test.log
*matrix qlb
*profile best
*aspect 4:3
*gop 15 2
*interlaced
*tff
*closedgops
*cq 6.3
*cq_maxbitrate 5.000
*dc_prec 9
*frames 100 200

-------------------------------
BDVD Matrix
-------------------------------
*custommatrix
16 18 20 22 26 28 32 39
18 20 22 24 28 32 39 44
20 22 26 28 32 39 44 48
22 22 26 32 39 44 48 54
22 26 32 39 44 48 54 64
26 32 39 44 48 54 64 74
32 39 44 48 54 64 74 84
39 44 48 54 64 74 84 94

20 24 26 28 38 42 46 53
24 26 28 38 42 46 53 58
26 28 38 42 46 53 58 62
28 38 42 46 53 58 62 68
38 42 46 53 58 62 68 78
42 46 53 58 62 68 78 88
46 53 58 62 68 78 88 99
53 58 62 68 78 88 99 99


If you want to do a 3 movies encode:


@echo off
color 17
title My Batchlist

start "HC-Batch" /wait HCBatch_015.exe "-ini" "C:\movies\matrix.ini" "-i" "C:\movies\matrix.avs" "-o" "C:\movies\matrix.m2v" "-log" "C:\movies\matrix.log" "-b" "2500" "-maxbitrate" "8500"

start "HC-Batch" /wait HCBatch_015.exe "-ini" "C:\movies\matrix.ini" "-i" "C:\movies\matrix.avs" "-o" "C:\movies\matrix.m2v" "-log" "C:\movies\matrix.log" "-b" "2500" "-maxbitrate" "8500"

start "HC-Batch" /wait HCBatch_015.exe "-ini" "C:\movies\matrix.ini" "-i" "C:\movies\matrix.avs" "-o" "C:\movies\matrix.m2v" "-log" "C:\movies\matrix.log" "-b" "2500" "-maxbitrate" "8500"

danpos
30th July 2005, 15:33
@Prodater64

:goodpost:

esso
30th July 2005, 22:00
nice! thank you both for the info, im going to try them now with some Naruto avi's i have. i'll let you know how the progress goes.

Ron

esso
30th July 2005, 22:02
just a quick question, with the wait command, when i run the bat file, will it envoke the first hcbatch and wait till its finished before starting the next in line, or will it try to run them all at once? i tried to do it using the info from the pdf before you posted these commands and i got an error about the hc.db file already in use

esso
30th July 2005, 23:05
Do i have to specify in the ini file the location, output, and bitrate of the files even though im putting it in the bat file?

esso
31st July 2005, 00:15
hmmm...... i just finishe a batch encode (one by one), and i have no audio. do i have to split the audio from the avi before encoding it with HC?

Prodater64
31st July 2005, 02:55
just a quick question, with the wait command, when i run the bat file, will it envoke the first hcbatch and wait till its finished before starting the next in line, or will it try to run them all at once? i tried to do it using the info from the pdf before you posted these commands and i got an error about the hc.db file already in use


The /wait switch will invoke tasks one step one.

Do i have to specify in the ini file the location, output, and bitrate of the files even though im putting it in the bat file?

Those parameters I posted should be present in the batch command. It is not necessary to enable it again in ini file.

HC Encoder does not encode audio.

In http://www.vmesquita.com/forum/index.php?topic=2730.0 you can find a tool that uses DIKO and HC Encoder. You will obtain video and audio with batch facilities.

esso
31st July 2005, 04:49
ahhh, thanks alot! i just read the post after i tried it and it worked perfectly. i demuxed the audio with virtualdub. the only prob now is, tmpegenc is saying the video is not dvd standard which is crazy, these are the same avs i used before and it worked fine, eh... oh well, i got time and lots to learn, im really lovin this, thanks again!

Prodater64
31st July 2005, 12:21
ahhh, thanks alot! i just read the post after i tried it and it worked perfectly. i demuxed the audio with virtualdub. the only prob now is, tmpegenc is saying the video is not dvd standard which is crazy, these are the same avs i used before and it worked fine, eh... oh well, i got time and lots to learn, im really lovin this, thanks again!

It is not enough to demux audio if audio is not mpeg1 layer 2 one.
Frequently avi sources audio is mp3 or ac3. Then you should to reencode audio to mp2 with besweet or headac3he.

Surf
10th November 2006, 20:28
Hello experts:

I am about to embark on using the HC batch encoding....

In the GUI environment, I'm allowed to choose the file size option. But I don't see this choice in batch command...? All I see is bitrate & maxbitrate?

TIA

pc_speak
14th November 2006, 04:33
Seems that HCgui is also a bitrate calculator.:cool:
Select 'file length'. Enter 'file length in k/bytes'. Select 'average bitrate'.
The 'average(kb/s)' figure now shown should be good in the hc.ini file.