Skip to content

Instantly share code, notes, and snippets.

@positlabs
Last active August 5, 2021 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save positlabs/0b27a8739584b4b72f75940cc4a08031 to your computer and use it in GitHub Desktop.
Save positlabs/0b27a8739584b4b72f75940cc4a08031 to your computer and use it in GitHub Desktop.
Lens Studio video asset encoder. Max dimension of 1280 using H.264 / AVC / MP4
#!/bin/bash
# Lens Studio video asset encoder. Max dimension of 1280 using H.264 / AVC / MP4
# https://lensstudio.snapchat.com/guides/2d/video/
# USAGE: ./encode-lens-studio.sh myvideo.mov
ffmpeg -i $1 \
-vf "scale='if(gt(iw, ih), min(1280, iw-mod(iw, 16)), -16)':'ifnot(gt(iw, ih), min(1280, ih-mod(ih, 16)), -16)'" \
-c:v libx264 \
-crf 23 \
-preset veryslow \
-c:a copy \
$1_ls.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment