Created
August 3, 2018 16:58
-
-
Save travishathaway/46a3e3144e0f51d219c9056c29e38997 to your computer and use it in GitHub Desktop.
This is a simple script using ffmpeg to convert .mov files to .gif
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 characters
#! /bin/bash | |
############################################################################# | |
# Author: Travis Hathaway # | |
# # | |
# Description: # | |
# This is a simple script used to transform a .mov file to a .gif file # | |
# # | |
# Example: # | |
# mov_to_gif <mov_file> <start_time:seconds> <duration:seconds> # | |
# mov_to_gif your_movie.mov 5 2.5 # | |
############################################################################# | |
mov_file=$1 | |
gif_file=$(echo $mov_file | sed -e 's/.mov$/.gif/') | |
start_time=$2 | |
duration=$3 | |
ffmpeg -ss "$2" -t "$3" -i "$mov_file" -filter_complex "[0:v] fps=12,scale=480:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" "$gif_file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment