Skip to content

A few scripts for FFMPEG and HandBrakeCli to automate single- or multi file encoding.

Notifications You must be signed in to change notification settings

dragnod0/VideoEncodingScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

These Bash scripts can convert multible files inside a single folder (not recursive) into another. It's grap the name from the source files and give the destitnation file the same name. The scripts are testet on Debian and Ubuntu based Linux Distros.

Requiments

FFMPEG

Ubuntu & Debian based Distros:
sudo apt update
sudo apt install ffmpeg

HandBrakeCli

Ubuntu & Debian based Distros
sudo add-apt-repository -y ppa:stebbins/handbrake-releases
sudo apt update
sudo apt install handbrake-cli

If you missing the add-apt-repository in Debian see here

Installation

  1. Download or Copy the scripts into the /bin dir for system wide use.
  2. Make the scripts executable with sudo chmod +x /bin/[Filename]

Syntax

[scriptname] [source container] [destination container] [sorce directory] [destination directory]

An example: ffmpeg-batch mkv mp4 /home/user/Movies /home/Movies/optimized In this example the Script encode all mkv Videos into mp4 files. All other containers will be ignored.

Important: Don't use slash "/" at the end of the path. Otherwise the script does't work! This is WRONG: /home/user/Movies/

Features

ffmpeg-batch

  • CPU based encoding
  • adds chapter from the Source
  • remove black bars
  • assume the forced subtitle
  • Checks whether the file already exists in the target folder
  • easy change the ffmpeg encoding options
  • encoded files are ready for native decode with Plex (if you use mp4 at output container)

ffmpeg-batch-gpu

  • GPU based encoding with vaapi
  • adds chapter from the Source
  • assume the forced subtitle
  • Checks whether the file already exists in the target folder
  • easy change the ffmpeg ecoding options
  • encoded files are ready for native decode with Plex (if you use mp4 at output container)
  • remove black bars is not possible with GPU encoding!

hanbrake-batch

  • CPU based encoding
  • adds chapter from the Source
  • remove black bars
  • assume the forced subtitle
  • Checks whether the file already exists in the target folder
  • easy change the HadBrakeCli encoding options
  • encoded files are ready for native decode with Plex (if you use mp4 at output container)
  • The script is costamized for german audio and subtitle tracks. You must change it with the ISO 639-2 code (e.g. fre, eng, spa, dut,...)

hanbrake-batch-rm and ffmpeg-batch

  • do all what the original *-batch files do
  • after the encoding is finished, the source file will be deleted

FFMPEG vs. HandBrakeCli - The differences

FFMPEG

  • you can relative easy add more advanced options
  • supports GPU encoding
  • it's relativ hard to add extras (subtitles, auto crop black bars, chapter, ...)
  • can copy Video track if you just want to convert only the audio track

HandBrakeCLI

  • makes the most features automatic
  • has no GPU encoding Support
  • has no support for more advanced options (thay are not documentet for CLI)

FFMPEG or HandBrakeCli?

For most tasks and if you don't need support for GPU encoding HandBrakeCLI is the best option. Only you will encode with your graphic card or need advanced options you must use FFMPEG.

About

A few scripts for FFMPEG and HandBrakeCli to automate single- or multi file encoding.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages