Instantly share code, notes, and snippets.

Embed
What would you like to do?
[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