Skip to content

Instantly share code, notes, and snippets.

@mattak
Created August 2, 2022 08:27
Show Gist options
  • Select an option

  • Save mattak/0709fb2479f96da6c5a97ac9ccb61fc8 to your computer and use it in GitHub Desktop.

Select an option

Save mattak/0709fb2479f96da6c5a97ac9ccb61fc8 to your computer and use it in GitHub Desktop.

Revisions

  1. mattak created this gist Aug 2, 2022.
    12 changes: 12 additions & 0 deletions mp4small
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    #!/bin/sh

    set -xe

    if [ $# -eq 0 ]; then
    echo "usage: <input_mp4>"
    exit 1
    fi

    f1=$1
    f2=${f1%.*}_small.mp4
    ffmpeg -y -i $f1 -vf 'scale=320:trunc(ow/a/2)*2' $f2