Created
March 18, 2023 06:23
-
-
Save msurguy/8689aeda98ca322a8b94058f1f598c9f to your computer and use it in GitHub Desktop.
FFMPEG commands for stitching Blender videos
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
function stitch { | |
if [ -z "$1" ]; then | |
echo "Input prefix must be specified." | |
return | |
fi | |
if [ -z "$2" ]; then | |
echo "Output file must be specified." | |
return | |
fi | |
if [ -z "$3" ]; then | |
crf=18 | |
else | |
crf=$3 | |
fi | |
command="ffmpeg -r 30 -i ${1}%04d.png -c:v libx264 -crf $crf -pix_fmt yuv420p -f mp4 ${2}.mp4" | |
eval $command | |
} |
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
function stitch($inputPrefix, $outputFile, $crf = 18) { | |
if (-not $inputPrefix) { | |
Write-Error "Input prefix must be specified." | |
return | |
} | |
$cmd = "ffmpeg -r 30 -i ${inputPrefix}%04d.png -c:v libx264 -crf $crf -pix_fmt yuv420p -f mp4 $outputFile.mp4" | |
Invoke-Expression $cmd | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment