Code Monkey home page Code Monkey logo

handbrake-cli-script's Introduction

Script for video compression automation using Handbrake CLI

This is a bash script I wrote to automate the compression process. I would usually render a video using Davinci Resolve and then have to manually put the video through Handbrake to compress the video into a smaller file size.

How to use it

First, download the git repo by

git clone https://github.com/Roshan-Thomas/handbrake-cli-script.git

And then run the script by

./cron-job.sh '<PARENT FOLDER>' <NUMBER OF SECONDS TO WAIT>

The first argument takes in the parent folder where the video file to be compressed exists. And, the second argument takes in the number of seconds to wait before running Handbrake CLI (default is 0 seconds).

Note: The waiting period was done so that the video can be completely rendered by Resolve and then be compressed

Here i am using a specific folder structure for my video editing process. You can choose to use the same structure or change the script accordingly

project
└───01 Footage
│   │   footage.mov
│   
└───02 Titles
    │   title.png
|
└───03 Exports
│   │   Export 1.mov 

If you decide to change the file structure, then change line 16 in the script to

cd "$CURRENT_DIR/$1/<EXPORTS FOLDER NAME>/"

Handbrake Preset

I have also included the HandBrake preset I use for compressing my videos in the git repo as well.

If you want to change the preset to someother .json file then change line 20 to

HandBrakeCLI --preset-import-file "$CURRENT_DIR/<YOUR CUSTOM PRESET>" -i 'Export 1.mov' -o 'Export 1 (Compressed).m4v' -a 1

Contributions

This is a very rudimentary script I wrote so that it can speed up my editing process. If you would like to contribute to it, then fork the repo and make the neccessary changes and then create a pull request.

Thanks and Happy Editing 😊

handbrake-cli-script's People

Contributors

roshan-thomas avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.