Skip to content

Instantly share code, notes, and snippets.

@cygmris
Last active September 20, 2018 05:23
Show Gist options
  • Select an option

  • Save cygmris/2e3c0ebd5b8c5269721a34e4867cf6da to your computer and use it in GitHub Desktop.

Select an option

Save cygmris/2e3c0ebd5b8c5269721a34e4867cf6da to your computer and use it in GitHub Desktop.
ffmpeg_scale_with_remaining.sh
#!/bin/bash
for i in $(ls *.jpg)
do
ffmpeg -i $i -vf "scale=800:-1:force_original_aspect_ratio=decrease" output$i.jpg
done
#!/bin/bash
for i in $(ls *.mp4)
do
ffmpeg -i $i -vf "scale=320x240:force_original_aspect_ratio=decrease,pad=320:240:(ow-iw)/2:(oh-ih)/2" output$i.mp4
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment