13 lines
654 B
Bash
Executable File
13 lines
654 B
Bash
Executable File
#!/usr/bin/sh
|
|
|
|
file_to_convert=$1
|
|
file_to_convert_extension="${file_to_convert##*.}"
|
|
|
|
pallete_file=$(mktemp --suffix=.png)
|
|
video_res=$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 "$file_to_convert")
|
|
video_framerate=$(ffmpeg -i $file_to_convert 2>&1 | sed -n "s/.*, \(.*\) fp.*/\1/p")
|
|
|
|
ffmpeg -y -i $file_to_convert -vf palettegen $pallete_file
|
|
# ffmpeg -y -i $file_to_convert -i $pallete_file -filter_complex fps=20,paletteuse "${file_to_convert%".$file_to_convert_extension"}.gif"
|
|
ffmpeg -y -i $file_to_convert -i $pallete_file -filter_complex paletteuse "${file_to_convert%".$file_to_convert_extension"}.gif"
|