TTrimpx

Automation Guide

Batch Video Processing With FFmpeg

Two shell loops that process every file in a folder. Tested in Bash on macOS.

How we checked these commands: every command on this page was run with FFmpeg 8.1.2 on macOS on 24 October 2026, on short generated test clips, and the output was inspected with ffprobe (resolution, frame rate, duration, streams). Results on your files can differ if your FFmpeg build or input files are different.

Run these in Terminal from the folder that holds your videos. Test on a copy of two or three files first.

Convert every .MOV to MP4 (H.264 + AAC)

for f in *.MOV; do
  ffmpeg -n -i "$f" \
    -c:v libx264 -crf 18 -preset medium \
    -c:a aac -b:a 192k \
    -movflags +faststart \
    "${f%.MOV}.mp4"
done
  • "$f" in quotes keeps names with spaces working. In our test, a.MOV and b c.MOV became a.mp4 and b c.mp4 (H.264 and AAC, same 1920×1080 size and duration).
  • -n skips files that already exist. Without it, FFmpeg stops and asks whether to overwrite.
  • -crf 18 sets the quality: lower numbers give better quality and bigger files. -movflags +faststart moves the index to the start of the file so playback can begin before the whole file has downloaded.
  • *.MOV is case-sensitive on Linux. If your files end in .mov, change both places in the loop.

Resize every MP4 to 1920 pixels wide

mkdir -p resized
for f in *.mp4; do
  ffmpeg -n -i "$f" -vf scale=1920:-2:flags=lanczos -c:a copy "resized/${f%.mp4}-1080p.mp4"
done

The output goes into a resized folder, so the loop doesn't pick up its own results. -2 keeps the aspect ratio and an even height (see the filters guide for why -1 can fail). In our test, a 1280×720 clip and two 1920×1080 clips all came out 1920×1080, with the audio copied unchanged.

Windows

These loops are Bash. We haven't tested a PowerShell version, so we don't publish one here. On Windows you can run the Bash version in WSL or Git Bash.

Related guides