How to batch convert in a simple way?

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
KUD
Posts: 1
Joined: Fri Sep 09, 2011 8:58 am

How to batch convert in a simple way?

Post by KUD »

I'm trying to batch-convert 150 videos and right now it looks like I need to add one video at a time to the queue and it does take too long!

Can I do it in a more simple way? I want to add everything directly to the same video encoding settings as the first video...
codeblue2k
Posts: 29
Joined: Wed Oct 08, 2008 2:46 pm

Re: How to batch convert in a simple way?

Post by codeblue2k »

You could probably write a script or something using Handbreak CLI. Ive been playing around with this idea for a while now, but havent really had time to finish it
Smithcraft
Veteran User
Posts: 2697
Joined: Thu Jan 22, 2009 8:04 pm

Re: How to batch convert in a simple way?

Post by Smithcraft »

Not sure what version you have, but you can add a folder of files and then if you are converting all the files in the same way, you can tell HB to add all the files that were scanned to the queue.

That's the easiest way to do it that I can think of.

SC
userix
Posts: 6
Joined: Fri Jun 24, 2011 8:19 pm

Re: How to batch convert in a simple way?

Post by userix »

Smithcraft wrote:Not sure what version you have, but you can add a folder of files and then if you are converting all the files in the same way, you can tell HB to add all the files that were scanned to the queue.

That's the easiest way to do it that I can think of.

SC
Where is the option to have handbrake add all files from folder directly to queue?
Smithcraft
Veteran User
Posts: 2697
Joined: Thu Jan 22, 2009 8:04 pm

Re: How to batch convert in a simple way?

Post by Smithcraft »

In the Windows (nightly) version - Yes.

Other versions? I don't know.

SC
mcpish
Posts: 14
Joined: Wed Apr 20, 2011 9:19 pm

Re: How to batch convert in a simple way?

Post by mcpish »

I've been using a script that I've written awhile ago that does much exactly you asked. It's for handbrakeCLI and I use this in Ubuntu Linux. For this to make sense I'll have to explain a bit about my workflow. I convert a LOT of videos recorded from my PC based PVR-machine (MythTV).

First after recording off my PVR, I edit out the commercials using VideoREDO. Then the edited files are stored in a batch folder, ready to be transcoded.

The trick is though, that there are 2 different encoding settings used depending on whether the source is pure interlaced (30i) or if it's been telecined (24p originally shot on film). I quickly check each video using something like mplayer and using the period key to step through the video frame-by-frame to determine if it's telecined or if it's progressive. After editing in VideoREDO, When I export the new edited MPEG-2 file from VideoREDO I make sure I rename it according to whichever catagory it is (30i or 24p), so for instance files will end in either a ".30i.mpg" or ".24p.mpg" extension.

Then when I run my batch script, the script looks for all the files in the current directory that end with a .24p.mpg extension and will properly Inverse-Telecine and downscale any 1080i recording to a 720p24 mp4 file along with the AC-3 audio track. Then the script will move on and convert any files in the current directory that end with a .30i.mpg extension and apply decombing deinterlacing and store the result as a 720p30 mp4 file along with the AC-3 audio track.

I've been using this script for about 2 years to do my transcode jobs. I edit a lot of recordings off my PVR box to get them ready, throw them in a directory/folder, then just run the script before I go to bed. When I wake up, they are all converted into the proper format.
#!/bin/bash
for f in *30i.mpg
do
nice -n 19 HandBrakeCLI -e x264 -b 3000 -2 -T -E copy --crop 0:8:0:0 -w 1280 -l 720 -5 -r 29.97 -f mp4 -i $f -o $f.x264.720p.mp4 -x 8x8dct:trellis=1:cabac=1:me=hex:merange=24:subme=7:b-adapt=2:rc-lookahead=50:ref=4:bframes=4:slices=4:vbv-bufsize=30000:vbv-maxrate=40000
done

for f in *24p.mpg
do
nice -n 19 HandBrakeCLI -e x264 -b 3000 -2 -T -E copy --crop 0:8:0:0 -w 1280 -l 720 --detelecine=1:1:4:200:-1:0:-1 -r 23.976 -f mp4 -i $f -o $f.x264.720p.mp4 -x 8x8dct:trellis=1:cabac=1:me=hex:merange=24:subme=7:b-adapt=2:rc-lookahead=50:ref=4:bframes=4:slices=4:vbv-bufsize=30000:vbv-maxrate=40000
done
Post Reply