Skip to content

Instantly share code, notes, and snippets.

@deckerego
Created September 16, 2015 17:04
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 deckerego/0aff3450896e630b04f3 to your computer and use it in GitHub Desktop.
Save deckerego/0aff3450896e630b04f3 to your computer and use it in GitHub Desktop.
Transcode a video to be HTML5 compliant
#!/bin/bash
FILE_PATH="$1"
FILE_DIR=$(dirname "$FILE_PATH")
FILE_NAME=$(basename "$FILE_PATH")
FILE_BASE="${FILE_NAME%.*}"
avconv -i "$FILE_PATH" -vcodec h264 -acodec aac -strict -2 "$FILE_DIR/$FILE_BASE.mp4"
rm -r -f "$FILE_PATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment