Skip to content

Instantly share code, notes, and snippets.

@skuzzymiglet
Created January 30, 2020 20:04
Show Gist options
  • Save skuzzymiglet/e4affd251da866a0525f28803e425227 to your computer and use it in GitHub Desktop.
Save skuzzymiglet/e4affd251da866a0525f28803e425227 to your computer and use it in GitHub Desktop.
ffbatch specification

ffbatch

features

  • edit videos inplace
  • batch processing
  • conditionals
  • simple ffprobe access
  • file extension changing

usage

  • --if [EXPR]: if [EXPR] is true, run subsequent processing
  • {file.webm:v0.stream.width}: equivalent to ffprobe -v error -select_streams v:0 -show_entries stream=width -of "csv=s=*:p=0" file.webm
  • automatic quotation of filenames with spaces
  • batch: ffbatch -i {x.webm y.webm z.webm} {one.mp3 two.mp3 three.mp3} runs command 3 times with bracketed options
  • file extension changing: ffbatch -i {*.webm} {mp3(*)}: outputs * as mp3 e.g. x.mp3, y.mp3, z.mp3

example

If video length is longer than 1 minute, convert file to mp3

ffbatch --if {*:v0.format.duration > 60} -i {*} {mp3(*)}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment