Batch convert videos using Handbrake and a script

So I mainly use Linux, but for some tasks I turn to Windows. In this particular case it was setting up my iPad so that my wife could take it to Spain with her, packed with movies, to entertain the kids. This included the use of iTunes. I’m sure there’s some way to make it work in Linux as well, but I thought I’d write a post based on a solution I found in Windows, for once.

I needed to convert existing .avi-files to the format the iPad uses. This is where the program Handbrake comes into play. It’s excellent for converting from one format to another, but it’s the batch-convert part that isn’t too good. So how to solve this? Well, first install Handbrake, then proceed to create a .bat-script in the directory that contains the .avi-files. I do realize that Handbrake has a Add to queue function, but that sort of takes away the point of batch-converting. Rather I specify a folder, then it convert every file in it, than me adding a file manually one by one.

Open up Notepad, and place the following bit of text in it:


When saving the file, remember to select All files on the Save as type-field. Then type in script.bat in the File Name field.

So when you’re done with this, it’s just a case of double-clicking the script to batch convert all of the .avi-files in the directory the script is placed in.

Oh, another word of advice. Make sure your Windows-machine doesn’t hibernate or go to sleep. I learned that the hard way.

6 thoughts on “Batch convert videos using Handbrake and a script

    1. jorge Post author

      You’re welcome! 🙂 From what I could tell last time, VLC (the app) should now be able to play .avi-files on the iPad. The people developing VLC have also mentioned that they’re planning on including support for Chromecast in future releases, so you should check that out!

      Reply
  1. Carles

    Thanks a lot, your script has helped me to find a way to convert all my video files to be able to play them on Chromecast and saving some space on my hadrdrives.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *