Skip to content

Instantly share code, notes, and snippets.

@craftamap
Created June 8, 2020 21:50
Show Gist options
  • Save craftamap/42ffd69a9bd092630e74751aaed69bdf to your computer and use it in GitHub Desktop.
Save craftamap/42ffd69a9bd092630e74751aaed69bdf to your computer and use it in GitHub Desktop.
#!/usr/bin/bash
#
# This script transcodes the input video into x265 30fps
#
INPUT=$1
SEC=$2
[[ -f "$INPUT" ]] || (echo "No input file specified" && exit 1)
[ -z "$SEC" ] && OUTPUT="${INPUT%.*}.mp4" || OUTPUT="$SEC"
echo "$INPUT -> $OUTPUT"
read -p "Are you sure? (y/N) " -r
[[ $REPLY =~ ^[Nn]$ ]] && exit
ffmpeg -i "$INPUT" -c:v libx265 -r 30 "$OUTPUT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment