The purpose of this guide is for simple batch processing of avi's using HCEnc. After much searching using google I did not come up with much useful help in batch processing with HC. I then posted here and with the help of two forum members came up with a simple batch script that will allow for easy batch encoding.
Much thanks to ronnylov for the initial inspiration and to Vhelp for some help with the scripting syntax.
************************************************** ********************************************
edit...
I have created HCbatchGUI to serve the same purpose as following the steps below but this gui will create the bat file for you as well as add dgpulldown and encode the audio to ac3. It is in early development but hopefully will be of some use. Newest version is written in c++ and will work on any windows based pc. If you are interested check out the development thread here. Also see the HCbatchGUI user guide here
************************************************** ********************************************
First thing is this isn't a guide to use HC. This is a guide for batch processing with HC. I'm assuming that you already know how to use HC. If you need a guide to learn HC click here.
The basic idea behind using this method is simplicity.
The idea is to use the HCgui as much as possible.
AlanHK has posted another batch method just a few posts below. His method does not use the gui at all. I suggest you try both his and my method and see which you like best.
I loaded a few avs scripts into hcgui, adjusted the settings for each (using the GUI...love this), then clicked "save ini" for each avs script.
Now close the gui.
************************************************** ******************************
Edit:
In my effort to make this batch as simple as possible I have uploaded the Batch file as a zip file. The zip includes HC Batch.bat and HCenc_021.exe. Just unzip these two files into the directory you saved your ini files and double click the HC batch.bat file and your encodes will start. There will be no need to change the script at all. If all you want is for it to work then your done here. If you want to learn how it is done then keep reading.
HC_Batch.zip hosted on my web site
Also hosted here on videohelp. See this post below
************************************************** ******************************
Then create a simple batch script
And make sure to point to HCenc_021.exe and not HCgui.exe
You can change the directories to whatever you need just make sure to put quotations around the directories otherwise you will run into problems if you have spaces in the names.
Example 1: "c:\S P A C E S.mpg"
Example 2: "c:\my folder\SPA CES.mpg"
You only need to change the info in bold.
This will work for any one just change the directories accordingly in your text file.for %%a in ("F:\Directory you saved your HC_ini_files\*.ini") do "F:\Directory your HCenc exe is in\HCenc_021.exe" -ini "%%a"
Save the text as HC Batch.bat in notepad.
Just double click the bat file and watch it work.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 14 of 14
Thread
-
Donadagohvi (Cherokee for "Until we meet again")
-
Pretty kewl !!!
Will have to give it a try which will be soon as I have some downloaded TV episodes that I want to convert and they are short enough that I can fit four episodes per DVD disc so this batch method will come in rather handy for this project.
BTW for those looking for more on how to use HCenc here is a link: CLICK HERE
- John "FulciLives" Coleman"The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE
-
For anyone that has had trouble with this it is because I forgot to add quotation marks aournd the last paramater. I edited the code box and fixed it.
Donadagohvi (Cherokee for "Until we meet again") -
Fulci Lives you might like this...as I know you like dgpulldown. You can now include dgpulldown in your batch.
You only need to change the text in Bold
copy and paste the following code only changing the directory you have your dgpulldown.exe and your input fps. In this example it is 25fps.
The following is doing a pulldown from a pal 25.00fps to ntsc 29.97.
for %%a in ("*.m2v") do
"c:\Directory your pulldown exe is\dgpulldown.exe" "%%a" -srcfps 25.00 -destfps 29.97 -o pulldown_"%%a"
Now add the following text to your HC Batch.bat file changing only the directories that you had hc save the m2v files. In this example it is F:\Where HC will Output M2V files\
start "pulldown" /d"F:\Where HC will Output M2V files\" "F:\Where HC will Output M2V files\dgpulldown PAL 2 NTSC batch.bat"
for %%a in ("F:\Directory you saved your HC_ini_files\*.ini") do "F:\Directory your HCenc exe is in\HCenc_021.exe" -ini "%%a"
start "pulldown" /d"F:\hc m2v output\" "F:\hc m2v output\dgpulldown PAL 2 NTSC batch.bat"Donadagohvi (Cherokee for "Until we meet again") -
I mentioned this in another post, but I thought I might add in my method to this topic.
I put all the variable information in the batch file parameters.
The ini file referenced is just a stub that never changes, may not be necessary at all, but I put it in for safety.
Code:set rate=1970 set ar=16:9 ::set ar=4:3 set hc=P:\HCenc\HCenc_021 set mpgd=s:\mpg\ for %%a in ( e-101 e-102 e-103 e-104 e-105 e-106 e-107 e-108 e-109 e-110 e-111 e-112 ) do %hc% -i %~dp0%%a.avs -o %mpgd%%%a.m2v -b %rate% -aspectratio %ar% -pulldown -profile best -matrix qlb -ini P:\HCenc\hc0.ini
-- The input directory is the current folder, which should have the AVS (and usually the AVI) and the batch file itself. (The location of the batch file is the %~dp0 parameter.)
-- The output directory, where the M2V files are written, is the mpgd parameter.
-- The filenames listed in the brackets are the root names, thus "e-101" means the file e-101.avs will be encoded to file e-101.m2v.
-- The second line sets the aspect ratio, either 16:9 or 4:3, comment out whichever does not apply. Normally all files in a set are the same.
-- Pulldown is always set, HC ignores it except for 23.976 fps.
-- hc parameter is the name of the HC exe, which changes with updates.
So to use this I copy the batch to the working folder, paste in the list of names, set the bitrate in line 1, and execute. -
I just batch encoded 5 files with CCE 8)
I would have used HCenc and one of these batch methods but the source files were "bad" enough that I wanted to use Convolution3D which is YUY2 so since I had to do a colorspace change to YUY2 I just used CCE instead of HCenc where I would have had to switch back to YV12 so ...
Next time I guess
Normally I have YV12 to start with and use RemoveGrain for filtering (which works with YV12) thus making HCenc the smart choice.
But this time I had some anime I was converting and so far I haven't found a better filter for anime than the Convolution3D filter (when the anime needs it which I admit is not all the time).
I definitely have this thread bookmarked though for future reference.
- John "FulciLives" Coleman"The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE
-
Edit...Not useful info deleted.
Donadagohvi (Cherokee for "Until we meet again") -
Originally Posted by freebird73717
My method puts all the parameters for a group to be authored together, in a single batch file, which I find more convenient and portable than making a separate ini file for each encode. Also, it's faster, I think to set up, and less chance of error. All I need to put in are the filenames and the bitrate.
If you're doing 3 or 4 files at a time it doesn't matter much; as you see I do up to a dozen or so -- the maximum was 20 (10 minute cartoons). In that case it really does save time. -
Edit...Not useful info deleted.
Donadagohvi (Cherokee for "Until we meet again") -
In addition I use to batch the computer to go back to hibernation mode when the encoding has finnished. To do this I use the great utility PowerOff.
http://users.pandora.be/jbosman/poweroff/poweroff.htm
Scroll down to section 4 in the linked page above to see command line options.
I have added this at the end of my script:
C:\poweroff\poweroff hibernate -warn -warntime 10 -msg "Going to sleep in 10 seconds"
The reason for this is that my PC are normally in hibernate and automatically wakes up at predetermined times when starting a recording. However this idea was not very good when it started to sleep while it was recording from TV... But if you know there are nothing scheduled when the encoding is estimeted to finnish then this can be useful. I wish that it could check this himself. Oh Im doing something now, let's stay awake a little bit longer...
Of course you can use the command poweroff instead of hibernate to do a real power off if you want to. If you are sitting at the computer and doing something you can cancel the shutdown when you get the warning message. -
Originally Posted by freebird73717
But considering it might take anything from minutes to hours (setting up complex filters) to make the AVS files, and 8-12 hours to encode, it's a rounding error.
More importantly, I can change a parameter (usually the bitrate) for all the files at once by editing the one file, and I can see the parameters at a glance.
When making several ini files with the GUI, you have to stay sharp and be sure you change the output file to match, otherwise it will remain the same as the last file and when you run the batch it'll silently overwrite it. I did that once or twice whe I was using ini files.
I can check if my batch is set up correctly by running it, looking at the preview, then aborting each encode. Then I can start it for real and feel pretty sure it'll be done correctly in the morning. -
Edit...Not useful info deleted.
Donadagohvi (Cherokee for "Until we meet again") -
Edit:
In my effort to make this batch as simple as possible I have uploaded the Batch file as a zip file. The zip includes HC Batch.bat and HCenc_021.exe. Just unzip these two files into the directory you saved your ini files and double click the HC batch.bat file and your encodes will start. There will be no need to change the script at all. If all you want is for it to work then your done here.
hc_batch.zipDonadagohvi (Cherokee for "Until we meet again") -
Okay then, this is my alternative:
No-ini-file, no-GUI batch file.
Converts AVS to M2V in one line.
Save as batHC.bat
Code:@echo off @echo batHC @echo usage: batHC [rate] @echo Where "rate" is the bitrate, default 3000. @echo Processes all AVS files in current directory into M2V files. if %1X==X (set rate=3000) else (set rate=%1) :: Bitrate. Default is 3000, command line overrides. Can change the default here if you want. set ar=16:9 ::set ar=4:3 :: Aspect ratio, default 16:9. Uncomment the 4:3 line to use that ratio. set m2vd=%~dp0 :: This is the output folder. Now set to be the current folder. Change this if you want. set hc=P:\HCenc\HCenc_021.exe :: Where you've installed the latest version of HCEnc batch encoder. Update when a new version comes out. for %%A in (*.avs) do %hc% -i %~dp0%%A -o %m2vd%%%~nA.m2v -b %rate% -aspectratio %ar% -pulldown -profile best -matrix qlb -frames 0 999999 :: The command line. You can change the matrix if you like. Pulldown ignored unless framerate is 23.976.
Type "batHC" in a command window.
This will process all AVS files in the current folder into M2V files in the same folder.
The bitrate defaults 3000. If you want another rate, eg 5600, add that to the command "batHC 5600".
Aspect ratio default is 16:9. Uncomment the 4:3 line (remove the colons) to use that ratio.
Similar Threads
-
HCbatchGUI - (batch processor for HCenc and Aften). Development Thread.
By freebird73717 in forum ProgrammingReplies: 253Last Post: 28th Nov 2012, 17:07 -
How can I batch process AVI files and overwrite the originals? Please help!
By DrivesALot in forum Video ConversionReplies: 5Last Post: 21st Oct 2011, 20:59 -
Can I batch process some mp3's with Audacity to make them louder?
By snafubaby in forum AudioReplies: 2Last Post: 10th May 2011, 13:24 -
Batch processing GUI for HCEnc
By freebird73717 in forum ProgrammingReplies: 15Last Post: 20th Apr 2011, 21:31 -
How to Batch Process Using Avidemux? Or Batch Processing H264 .m2ts or .ts?
By forgotpassword in forum Video ConversionReplies: 0Last Post: 14th Apr 2009, 00:00