Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # You need to have ImageMagick and ffmpeg installed (Installer (ffmpeg included): https://www.imagemagick.org/script/download.php#windows - ImageMagick-7.0.8-14-Q16-x64-static.exe)
- # Run in "images\Animated CGs"
- Get-ChildItem "." -Directory | Sort |
- Foreach-Object {
- $name = $_.Name
- if ($name -ne "foreplay_minigame" -and $name -ne "time_transition") {
- # Converts .tga files to .png and fixes the numbering syntax, my intent is to make it easier to work with the individual frames
- # so that we may loop segments in the future. Beware that this will take very long (1 hour+). If you just want to generate the videos from
- # the .tga files just change this block to do a simple rename and tell ffmpeg to use .tga instead of .png
- # You can comment this block out after the 1st run.
- Get-ChildItem "$name\." -File -Filter "*.tga" |
- Foreach-Object {
- $filename = $_.Name
- $newFilename = ([int]($filename).Substring(6).Replace(".tga", "")) # Fixes the broken numbers (leading 0s)
- echo "Converting $name\$filename -> $name\$newFilename.png"
- magick "$name\$filename" "$name\$newFilename.png"
- }
- ffmpeg -framerate 17 -i "$name\%d.png" -preset veryslow -c:v libvpx -b:v 0 -crf 30 -pix_fmt yuv420p "$name.webm"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement