Clare3Dx FFMPEG batch file for Web Standard MP4

become a patreon

Clare3Dx's FFMPEG Batchfile

Create videos matching the web standards easily

Download ffmpeg.org (get windows builds here ffmpeg.zeranoe.com/builds)

Filename: makevideos.bat

Copy the bat file below or download it from the link below, place the file inside of a folder which is also in %path% (C:\Windows if you have no idea what %path% is).

Open Command Prompt and browse to your folder with the rendered image series and type:
makevideos "nameofimageseries%03d.png" "nameofvideo"

@echo off setlocal set ffmpeg=D:\Tools\ffmpeg\bin\ffmpeg.exe set overwrite=n set dfps=30 if {%1}=={} ( goto help ) else ( if {%2}=={} ( goto help ) set input=%1 set output=%2 if {%3}=={y} ( set overwrite=%3 ) else if {%3} GEQ {1} if {%4}=={} ( set dfps=%3 ) else if {%3} GEQ {1} if {%4}=={y} ( set dfps=%3 set overwrite=%4 ) else ( if {%3} GEQ {1} if {%4} GEQ {1} ( set ifps=%3 set ofps=%4 ) if {%5}=={y} ( set overwrite=%5 ) ) ) set mp4setting=-c:v libx264 -pix_fmt yuv420p -profile:v baseline -level 3.0 -crf 22 -preset veryslow -an -movflags +faststart -threads 0 -%overwrite% if {%dfps%} GEQ {1} ( echo create default web videos %ffmpeg% -framerate %dfps% -i %input% %mp4setting% -vf scale=-2:480 -r 20 %output%[email protected] %ffmpeg% -framerate %dfps% -i %input% %mp4setting% -vf scale=-2:960 -r 25 %output%[email protected] %ffmpeg% -framerate %dfps% -i %input% %mp4setting% -vf scale=-2:1920 -r 30 %output%[email protected] ) if {%ifps%} GEQ {1} if {%ofps%} GEQ {1} ( echo create reframed video %ffmpeg% -framerate %ifps% -i %input% %mp4setting% -vf scale=-2:1920 -r %ofps% %output%-i%ifps%[email protected]%ofps%.mp4 ) echo input: %input% echo output: %output% echo default fps: %dfps% echo input fps: %ifps% echo output fps: %ofps% echo overwrite: %overwrite% echo mp4setting: %mp4setting% goto end :help echo makevideos.bat help! echo command-line: echo makevideos "001b\ImageSeries %03d.png" "Video 001b" echo will create web videos at the default input 30 fps echo. echo makevideos "001b\ImageSeries %03d.png" "Video 001b" 60 echo will set default input fps to 60 and keep the output to 30, 25, 20 echo for web videos echo. echo makevideos "001b\ImageSeries %03d.png" "Video 001b" 60 30 echo will create web videos and overwrite existing videos at default fps echo will create a reframed video matching 60 input and 30 as output fps echo. echo hint: echo include a single y at the end to overwrite :end endlocal