Skip to content

Instantly share code, notes, and snippets.

@bennylope
Created May 24, 2016 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bennylope/2987dfa723e23c9480b3478ffe00799f to your computer and use it in GitHub Desktop.
Save bennylope/2987dfa723e23c9480b3478ffe00799f to your computer and use it in GitHub Desktop.
A short helper script to decode QuickTime .mov files to mp4 files using default settings. Good for creating short screencasts.
#!/bin/bash
#
# A short helper script to decode QuickTime .mov files to mp4 files using default settings.
#
# Usage:
# ./trim-movie.sh path/to/source.mov path/to/destination.mp4
# ./trim-movie.sh path/to/source.mov path/to/destination.mp4 1080
#
# The optional third paramater is width. You may need to respecify this if you encounter
# divisibility by 2 errors. Not sufficiently motivated to bother checking the size and
# correcting in the script!
#
# Author: Ben Lopatin
# License: Public domain
#
ffmpeg -i "$1" -vf scale=${3:-720}:-1 -vcodec h264 -acodec aac -strict -2 "$2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment