FFmpeg Video Converter Tutorial for Beginners — Batch & Automation

FFmpeg Video Converter Tutorial for Beginners — Batch & Automation

This tutorial shows how to convert videos with FFmpeg, automate repeated tasks, and create simple batch workflows for Windows, macOS, and Linux. It assumes no prior FFmpeg experience and provides ready-to-run commands and scripts.

What is FFmpeg?

FFmpeg is a free, cross-platform command-line tool for processing audio and video: converting formats, extracting audio, resizing, changing codecs, and more.

Install FFmpeg

  • Windows: Download a static build from ffmpeg.org, extract, and add the “bin” folder to PATH.
  • macOS: Install via Homebrew:

    bash

    brew install ffmpeg
  • Linux (Debian/Ubuntu):

    bash

    sudo apt update sudo apt install ffmpeg

Basic single-file conversions

  • Convert to MP4 (H.264 + AAC):

    bash

    ffmpeg -i input.mkv -c:v libx264 -preset medium -crf 23 -c:a aac -b:a 128k output.mp4
    • -c:v libx264: H.264 video encoder
    • -crf 23: quality (lower = better quality, range ~18–28)
    • -preset medium: encoding speed vs. compression
  • Convert to WebM (VP9 + Opus):

    bash

    ffmpeg -i input.mp4 -c:v libvpx-vp9 -b:v 0 -crf 30 -c:a libopus -b:a 96k output.webm
  • Extract audio:

    bash

    ffmpeg -i input.mp4 -vn -c:a libmp3lame -b:a 192k output.mp3

Common useful options

  • Resize video:

    bash

    ffmpeg -i input.mp4 -vf “scale=1280:720” -c:a copy output720p.mp4
  • Change frame rate:

    bash

    ffmpeg -i input.mp4 -r 30 -c:a copy output30fps.mp4
  • Fast remux (no re-encoding):

    bash

    ffmpeg -i input.mkv -c copy output.mp4
  • Preserve subtitles:

    bash

    ffmpeg -i input.mkv -c copy -c:s mov_text output.mp4

Batch conversion: Windows (Batch script)

Create convert.bat in the folder with videos: “`bat @echo off for %%F in (*.mkv.avi *.mov *.mp4) do ( echo Converting %%F… ffmpeg -y -i “%%F” -c:v libx264 -preset

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *