Revisions
-
fnando revised this gist
Jun 5, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #!/usr/bin/env bash if [[ ! -f "$1" ]]; then echo "=> Movie file not found" exit 1 fi -
fnando created this gist
Jun 4, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ #!/usr/bin/env bash if [[ ! -f "$1" ]]; then echo "Movie file not found" exit 1 fi tempfile=/tmp/output.gif rm -f $tempfile echo "=> Converting $1 to GIF" ffmpeg -i "$1" -pix_fmt rgb24 "$tempfile" > /tmp/giffy.log 2>&1 if [[ ! -f "$tempfile" ]]; then echo "=> Error while converting $1 to GIF" echo "=> Check the file /tmp/giffy.log" exit 1 fi filename=$(basename "$1") filename="${filename%.*}" dir=$(dirname "$1") output="$dir/$filename.gif" echo "=> Exporting optimized GIF to $output" convert -layers Optimize "$tempfile" "$output" > /tmp/giffy.log 2>&1 if [[ ! -f "$output" ]]; then echo "=> Error while exporting $output" echo "=> Check the file /tmp/giffy.log" exit 1 fi rm $tempfile echo "=> Done!"