I deal with the processing and uniqueness of 9:16 videos.
I need to make the video take on a random zoom value to increase it in scale and crop it accordingly at the edges.
I need to make a random value from +1% to +10%. From the original 100%
The command I have, it only changes the zoom to +30%.
@echo off
setlocal enabledelayedexpansion
for %%G in (*.mp4) do (
set "video_file=%%G"
set /a "random_int=!RANDOM! %% 401 + 100"
set "trim_start=!random_int:~0,-2!.!random_int:~-2!"
echo Processing "!video_file!" with trimming start by !trim_start! seconds
set "output_file=!video_file:.mp4=_zoomed.mp4!"
ffmpeg -i "!video_file!" -vf "crop=iw/1.3:ih/1.3" -c:v libx264 -crf 23 -preset medium -c:a copy "!output_file!"
if ERRORLEVEL 1 (
echo Error processing "!video_file!"
) else (
echo Successfully processed "!video_file!"
ren "!output_file!" "!video_file!"
)
)
pause