Very Good FFmpeg
How it worksPricingCompareFAQDocs
Guide #1

Convert video format with FFmpeg

Format conversion is often about the container, codec, or both. The safest default for broad playback is H.264 video, AAC audio, and an MP4 container.

Copy + paste this:

Re-encode to a broadly compatible 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

3 Good fit
  • A file plays locally but fails in a browser or mobile app.

  • Users upload MOV, MKV, AVI, or WebM and your product needs one standard output.

  • You need predictable files for downstream editing, playback, or storage.

Be careful when

2 Watch out
  • You only need to change the file extension. That can corrupt expectations.

  • You can stream-copy safely and do not need a codec change.

Examples

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

Safe MP4 output

Re-encode to a broadly compatible 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 codec.
-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 codec.
-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.

Fast remux

Change container without re-encoding when streams are already compatible.

ffmpeg -i input -c copy -movflags +faststart output.mp4

Command breakdown

input input
Reads this input file.
-c copy
Copies streams without re-encoding.
-movflags +faststart
Moves MP4 metadata to the front so web playback can start sooner.
output output.mp4
Writes this output file.

Helpful tips

These details prevent most bad outputs and confusing FFmpeg results.

Container is not codec

MP4, MOV, and MKV are containers. H.264, H.265, VP9, and AV1 are codecs. You may need to change one or both.

Use stream copy when possible

If the codecs already work in the target container, `-c copy` avoids quality loss and runs very fast.

Use faststart for web MP4

`-movflags +faststart` moves playback metadata near the start of the file, so browsers can begin sooner.

Related guides

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

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.

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
Legal
  • Terms
  • Privacy
Compare
  • vs Rendi
  • vs RenderIO
  • vs ffmpeg-api.com
  • vs FFmpeg Micro
  • vs AWS MediaConvert
  • vs Google Transcoder API
  • vs Self-Hosted FFmpeg
  • vs Cloudinary
Integrations
  • Zapier
  • Make
  • n8n
Use Cases
  • Video SaaS Platforms
  • Content Creators & UGC Platforms
  • AI Video Startups
  • Agencies & Freelancers
  • Podcasts & Audio Pipelines
Guides
  • 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 (2026)
  • Best Video Compression API (2026)
  • Best Audio Extraction API (2026)
  • Best API for Trimming Video (2026)
  • Best Video Thumbnail API (2026)
  • Best Video Resizing API (2026)
  • Best API for Adding Subtitles to Video (2026)
  • Best FFmpeg API (2026)
© 2026 Very Good FFmpeg