Skip to content

Instantly share code, notes, and snippets.

@goodevilgenius
Last active October 26, 2017 14:35
Show Gist options
  • Save goodevilgenius/5545191 to your computer and use it in GitHub Desktop.
Save goodevilgenius/5545191 to your computer and use it in GitHub Desktop.
[vid shrinker] This shrinks videos. The result is a 320x240 mkv with xvid video and ogg audio. Good for putting on a device with a small screen and limited memory. #video #obsolete
#!/bin/sh
while [ "$#" -ne 0 ]; do
EXT="${1##*.}"
FILENAME=`basename "$1" .${EXT}`
TMP=`mktemp`
ffmpeg -i "$1" -s 320x240 -vcodec xvid -an "${TMP}.avi"
ffmpeg -i "$1" -vn "${TMP}.wav"
oggenc -q 1 --downmix -o "${TMP}.ogg" "${TMP}.wav"
mkvmerge --title "${FILENAME}" -o "mini-${FILENAME}.mkv" "${TMP}.avi" "${TMP}.ogg"
rm ${TMP}*
shift
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment