Last active
February 28, 2022 17:01
-
-
Save cadebrown/dd4a4d042dd6c6bd56db8df7ce50fe65 to your computer and use it in GitHub Desktop.
use GPU acceleration 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
# run this to turn frames into video, using a NVIDIA GPU | |
ffmpeg -y -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -r 30 \ | |
-i 'frame_%05d.png' -c:a copy -c:v h264_nvenc -b:v 50M \ | |
output.mp4 | |
# CPU | |
ffmpeg -y -vsync 0 -r 30 \ | |
-i 'frame_%05d.png' -c:a copy -c:v h265 -b:v 50M \ | |
output.mp4 | |
# CPU, with upscaling to 1080p | |
ffmpeg -y -vsync 0 -r 15 \ | |
-i 'frame_%05d.png' -vf scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:-1:-1,setsar=1 -c:a copy -c:v libx265 -b:v 50M \ | |
output.mp4 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment