Very Good FFmpeg
How it worksPricingDocsContent
Guide #1

Transcode video with FFmpeg

Transcoding changes the encoded audio or video streams. It is the right move when uploads use codecs your player, device, or downstream pipeline cannot handle.

Copy + paste this:

Transcode video and audio to web-safe H.264/AAC MP4.

ffmpeg -i input -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k -movflags +faststart output.mp4

When this is the right tool

Start by checking whether this operation matches the job you actually need.

Use this when

  • User uploads arrive in many codecs and need one standard playback format.

  • You need H.264, H.265, AV1, VP9, ProRes, AAC, or Opus outputs.

  • You want to normalize files before storage, review, editing, or streaming.

Be careful when

  • The source codecs are already right and a container remux with `-c copy` is enough.

  • You need a lossless archive copy and cannot accept generational quality loss.

Examples

Use these as starting points, then tune quality, size, and timing on real input files.

Broadly compatible MP4

Transcode video and audio to web-safe H.264/AAC MP4.

ffmpeg -i input -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k -movflags +faststart output.mp4

Command breakdown

input input
Reads this input file.
-c:v libx264
Sets the video encoder.
-crf 23
Controls visual quality. Lower values make larger, higher-quality files.
-preset medium
Controls encode speed and compression efficiency.
-c:a aac
Sets the audio encoder.
-b:a 128k
Sets the audio bitrate.
-movflags +faststart
Moves MP4 metadata to the front so web playback can start sooner.
output output.mp4
Writes this output file.

HEVC output

Create a smaller H.265 copy when target devices support HEVC.

ffmpeg -i input -c:v libx265 -crf 28 -preset medium -c:a aac -b:a 128k output-hevc.mp4

Command breakdown

input input
Reads this input file.
-c:v libx265
Sets the video encoder.
-crf 28
Controls visual quality for x265. Lower values make larger files.
-preset medium
Controls encode speed and compression efficiency.
-c:a aac
Sets the audio encoder.
-b:a 128k
Sets the audio bitrate.
output output-hevc.mp4
Writes this output file.

Helpful tips

These details prevent most bad outputs and confusing FFmpeg results.

Transcoding is not remuxing

Remuxing changes the container. Transcoding decodes and re-encodes streams, which costs more CPU but fixes codec compatibility.

Pick codec for the playback target

H.264 and AAC in MP4 remain the broadest default. H.265, AV1, and VP9 can be smaller but need more player support checks.

Quality controls cost

CRF, bitrate, preset, resolution, and audio settings decide the balance between quality, file size, and runtime.

Related guides

Useful next steps when this operation is part of a larger workflow.

Convert video format with FFmpeg

Learn how to convert MOV, MKV, WebM, and AVI files to MP4 with FFmpeg, when to copy streams, and when to re-encode.

Compress video with FFmpeg

Learn practical FFmpeg video compression using CRF, presets, bitrate caps, and web-safe MP4 settings.

Resize video with FFmpeg

Learn how to resize video with FFmpeg while keeping aspect ratio, avoiding odd dimensions, and padding when needed.

Related use cases

See how this FFmpeg task fits into real product workflows.

Video SaaS Platforms

Run FFmpeg at scale for your video SaaS product. User uploads land, [transcodes fan out to multiple resolutions](/content/best/best-video-transcoding-api), and you never manage a worker fleet. Per-GB pricing, 6-hour runtimes.

AI Video Startups

FFmpeg API for AI video startups generating content programmatically. [Frame extraction](/content/guides/create-thumbnails), format wrangling, GPU encoding for AI-generated video output. Pay per GB, no server management.

Need to run this at scale?

Run the same FFmpeg commands through a hosted API.

Keep the FFmpeg command surface. Very Good FFmpeg handles machines, logs, long jobs, outputs, and webhooks.

Try free →Read API docs
Very Good FFmpegChecking status...
Product
  • How it works
  • Pricing
  • Comparison
  • FAQ
Developers
  • Documentation
  • API Reference
  • MCP Server
  • TypeScript SDK
  • Python SDK
Company
  • Contact
  • Sign in
  • Sign up
  • Terms
  • Privacy
As Seen On
  • G2
  • Product Hunt
  • GitHub
  • PyPI
  • NPM
  • Smithery
  • MCP.so
  • AlternativeTo
  • Make
Compare
  • vs Rendi
  • vs RenderIO
  • vs AWS MediaConvert
  • vs Google Transcoder API
  • vs Self-Hosted FFmpeg
  • vs Coconut
Integrations
  • Zapier
  • Make
  • n8n
Use Cases
  • Video SaaS Platforms
  • Content Creators & UGC Platforms
  • AI Video Startups
  • Agencies & Freelancers
  • Podcasts & Audio Pipelines
Guides
  • Transcode video with FFmpeg
  • Convert video format with FFmpeg
  • Compress video with FFmpeg
  • Extract audio with FFmpeg
  • Trim video with FFmpeg
  • Create video thumbnails with FFmpeg
  • Resize video with FFmpeg
  • Add subtitles with FFmpeg
Best APIs
  • Best Video Transcoding API
  • Best Video Compression API
  • Best Audio Extraction API
  • Best API for Trimming Video
  • Best Video Thumbnail API
  • Best FFmpeg API
© 2026 Very Good FFmpeg