Created
July 15, 2021 20:48
-
-
Save plmrry/678f9b0a5239be5609ac61e85be47d19 to your computer and use it in GitHub Desktop.
Create videos with ffmpeg
This file contains 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
// Various ways that I have called ffmpeg in the past | |
exec( | |
`ffmpeg -y \ | |
-framerate 60 \ | |
-pattern_type glob \ | |
-i "${framesDirectory}/*.png" \ | |
-crf 27 \ | |
-pix_fmt yuv420p \ | |
-filter:v scale=1000:-1 \ | |
${mp4_path}` | |
); | |
exec( | |
`ffmpeg -y \ | |
-framerate ${fps} \ | |
-pattern_type glob \ | |
-i "${framesDirectory}/*.png" \ | |
-vcodec libx264 \ | |
-crf 22 \ | |
-pix_fmt yuv420p \ | |
-x264-params keyint=1 \ | |
-filter:v scale=720:-1 \ | |
${outPath}` | |
); | |
exec( | |
`ffmpeg -y \ | |
-framerate ${30} \ | |
-pattern_type glob \ | |
-i "${framesDirectory}/*.png" \ | |
-crf ${crf} \ | |
-filter:v scale=1000:-2 \ | |
-pix_fmt yuv420p \ | |
-x264-params keyint=1 \ | |
${outputDirectory}/${fileName}.mp4` | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment