Last active
August 5, 2021 19:33
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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