Skip to content

Instantly share code, notes, and snippets.

@repcsi
Created October 12, 2019 09:19
Show Gist options
  • Save repcsi/354da3c932af7579e61b76498d2d0d3e to your computer and use it in GitHub Desktop.
Save repcsi/354da3c932af7579e61b76498d2d0d3e to your computer and use it in GitHub Desktop.
Under File Storage -> Run a command
/etc/motioneye/convert.sh %f
convert.sh:
#!/bin/bash
FILEPATH="$1"
TMPPATH=$(mktemp).mp4
/usr/bin/ffmpeg -i "$FILEPATH" -pix_fmt yuv420p -vcodec libx264 -crf 20 "$TMPPATH"
/bin/rm -f "$FILEPATH"
/bin/mv "$TMPPATH" "$FILEPATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment