Skip to content

Instantly share code, notes, and snippets.

@cmavr8
Created December 8, 2016 13:09
Show Gist options
  • Save cmavr8/be5e58f42fb099c5520850a02d7ae67a to your computer and use it in GitHub Desktop.
Save cmavr8/be5e58f42fb099c5520850a02d7ae67a to your computer and use it in GitHub Desktop.
Super quick & dirty script to convert all video files of specific extension into x265 mp4s. Sure, it can be made fancy, but there's not enough motivation for it.
#!/bin/bash
# Super quick & dirty script to convert all video files of specific extension into x265 mp4s. Sure, it can be made fancy, but there's not enough motivation for it.
# v1 - 8-Dec-2016 by Chris Mavrakis
# How to use:
# Cd into the dir of your source video files.
# Change the .avi extension and target file dir in the script.
# Run the script.
for filename in *.avi; do
echo "$filename"
name="$(echo $filename | rev | cut -d'.' -f2- |rev)"
ffmpeg -i "$filename" -c:v libx265 -preset slow -x265-params crf=22 -c:a copy "/tmp/$name-x265.mp4"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment