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 echo FFMPEG Batch Video Creator by Clare3Dx.com setlocal set ffmpeg=D:\Tools\ffmpeg\bin\ffmpeg.exe set hardware=-init_hw_device cuda set debug=info set overwrite=n set dfps=30 if {%1}=={} ( goto help ) if {%2}=={} ( goto help ) set input=%1 set output=%2 if {%3}=={} goto prepare if {%3}=={y} ( echo set to overwrite set overwrite=%3 ) else if %3 GEQ 1 if {%4}=={} ( echo change default fps set dfps=%3 ) else if %3 GEQ 1 if {%4}=={y} ( echo change default fps and overwrite set dfps=%3 set overwrite=%4 ) else ( if %3 GEQ 1 if %4 GEQ 1 ( echo change input & output fps set ifps=%3 set ofps=%4 ) if {%5}=={y} ( echo set to overwrite set overwrite=%5 ) ) :prepare echo prepare to run set mp4setting=%hardware% -loglevel %debug% -c:v libx264 -pix_fmt yuv420p -profile:v baseline -level 3.0 -crf 22 -preset veryslow -an -movflags +faststart -threads 0 -%overwrite% if {%ifps%}=={} goto default if {%ofps%}=={} goto default :reframed echo create reframed video %ffmpeg% -framerate %ifps% -i %input% %mp4setting% -vf scale=-2:1920 -r %ofps% %output%-i%ifps%-1920@%ofps%.mp4 goto done :default echo create default web videos %ffmpeg% -framerate %dfps% -i %input% %mp4setting% -vf scale=-2:480 -r 20 %output%-480@20.mp4 %ffmpeg% -framerate %dfps% -i %input% %mp4setting% -vf scale=-2:960 -r 25 %output%-960@25.mp4 %ffmpeg% -framerate %dfps% -i %input% %mp4setting% -vf scale=-2:1920 -r 30 %output%-1920@30.mp4 goto done :done 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