Last active
October 26, 2017 14:35
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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