Batch process videos using a bat file with ffmpeg, scaling and blurring specific areas

⌚Time: 2026-03-11 15:44:00

👨‍💻Author: Jack Ge

Using batch processing to traverse the current directory ./ is like this

for /r "./" %%G in (*) do (

)

Resize all files to 720p

for /r "./" %%G in (*) do (
    ffmpeg -i "%%G" -vf scale=1280:720 "%%~dpnG_720p.mp4"
)

For example, the test.mp4 in the folder will become test_720p.mp4 with a 720p resolution.

Blur all files in the specified area


for /r "./" %%G in (*) do (
    ffmpeg -i "%%G" -filter_complex "[0:v]crop=500:140:30:730,boxblur=20[fg]; [0:v][fg]overlay=30:730[out]" -map "[out]" -map 0:a "%%~dpnG_blurred.mp4"
)

Blur all files in the specified area and then scale the size to 720p


for /r "./" %%G in (*) do (
    ffmpeg -i "%%G" -filter_complex "[0:v]crop=500:140:30:730,boxblur=20[fg]; [0:v][fg]overlay=30:730,scale=1280:720[out]"  -map "[out]" -map 0:a "%%~dpnG_720p.mp4"
)

Scaling this way will not affect the blur position. Because it is executed sequentially. The blur area has already been processed before scaling.