Skip to content

Instantly share code, notes, and snippets.

@jemsgit
Created October 1, 2017 09:07
Show Gist options
  • Select an option

  • Save jemsgit/7e45514fe49a227681dcc7c0058e0316 to your computer and use it in GitHub Desktop.

Select an option

Save jemsgit/7e45514fe49a227681dcc7c0058e0316 to your computer and use it in GitHub Desktop.
echo "Введите rate раскадровки"
read VideoRate
echo "Введите ширину новых изображений"
read WIDTH
echo "Введите rate для gif"
read GIfrate
Filename=$1;
DestName='resized_im';
VideoImages='frames';
mkdir $DestName;
mkdir $VideoImages;
ffmpeg -i "$Filename" -r "$VideoRate" "$VideoImages"/image_%010d.png;
echo "Раскадровка завершена. Ресайзинг..."
cd $VideoImages
for i in *.png; do convert $i -resize "$WIDTH" ../"$DestName"/$i; done
echo "Ресайз завершен. Конвертирование..."
cd ../$DestName;
convert -delay "$GIfrate" -layers optimize *.png ../animation2.gif;
cd ..
rm -rf $DestName;
rm -rf $VideoImages;
echo "Успешно"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment