ffmpegremuxstream-copycodecbucket-doc

FFmpeg -c copy Explained: How to Remux Video Without Re-encoding

·Javid Jamae·6 min read
FFmpeg -c copy Explained: How to Remux Video Without Re-encoding

You have an MKV file. Your player needs MP4. The video and audio codecs inside are already perfect. Re-encoding the whole thing would take minutes, burn CPU, and quietly degrade quality.

The fix is one flag: -c copy.

What -c copy actually does

FFmpeg's -c copy tells the encoder to skip encoding entirely. It copies the raw video and audio bitstreams from the input container into the output container without touching a single frame. This process is called remuxing.

The difference is massive:

OperationTime (1 min video)CPU usageQuality loss
Re-encode (libx264, CRF 23)15-45 seconds100%Yes (generational)
Stream copy (-c copy)Under 1 secondNear zeroNone

Remuxing is instant because there's no decode-encode cycle. FFmpeg reads packets from the source container and writes them to the target container. That's it.

When to use -c copy (and when not to)

Use -c copy when:

  • You're changing containers (MKV to MP4, MP4 to MKV, AVI to MP4)
  • You need to extract a single stream (pull audio out of a video, pull video without audio)
  • You're adding faststart for web delivery without re-encoding
  • You want to strip metadata or chapters while keeping the media intact

Don't use -c copy when:

  • The source codec isn't compatible with the target container (VP9 in an MP4 container will fail in most players)
  • You need to change resolution, bitrate, or codec
  • You're trimming and need frame-accurate cuts (stream copy can only cut on keyframes)

Common remux operations

Change container: MKV to MP4

The most common remux. MKV files with H.264 video and AAC audio drop into MP4 containers without issues.

ffmpeg -i input.mkv -c copy output.mp4

Add faststart for web streaming

MP4 files store their metadata (the "moov atom") at the end by default. Browsers need that metadata before they can start playing. The -movflags +faststart flag moves it to the front so the video starts playing immediately instead of downloading the whole file first.

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

Extract audio from video

Pull the audio track out without re-encoding. The output format should match the audio codec. If the source has AAC audio, output to .aac or .m4a. If it's Opus, output to .ogg or .opus.

ffmpeg -i input.mp4 -c:a copy -vn audio-only.aac

The -vn flag tells FFmpeg to drop the video stream entirely. The -c:a copy copies the audio bitstream as-is.

Extract video without audio

ffmpeg -i input.mp4 -c:v copy -an video-only.mp4

Same idea, reversed. -an drops audio, -c:v copy keeps video untouched.

Remux multiple files in a batch

When you have a folder of MKV files that need to be MP4:

for f in *.mkv; do
  ffmpeg -i "$f" -c copy "${f%.mkv}.mp4"
done

Remuxing with the FFmpeg Micro API

If you're processing videos in an application or automation workflow, you can remux through the FFmpeg Micro API. No FFmpeg installation needed.

Container change via API

curl -X POST https://api.ffmpeg-micro.com/v1/transcodes \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": [{"url": "https://storage.example.com/input.mkv"}],
    "outputFormat": "mp4",
    "options": [
      {"option": "-c", "argument": "copy"},
      {"option": "-movflags", "argument": "+faststart"}
    ]
  }'

This queues a remux job that copies all streams into an MP4 container with faststart enabled. The response includes a job ID you can poll:

{
  "id": "abc-123",
  "status": "queued",
  "billableMinutes": 0.5
}

Extract audio via API

curl -X POST https://api.ffmpeg-micro.com/v1/transcodes \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": [{"url": "https://storage.example.com/input.mp4"}],
    "outputFormat": "aac",
    "options": [
      {"option": "-c:a", "argument": "copy"},
      {"option": "-vn", "argument": ""}
    ]
  }'

Both operations complete in seconds because there's no re-encoding involved. You only pay for the input duration, and the processing time is minimal.

Common pitfalls

Codec/container mismatch. Not every codec fits in every container. VP9 video works in WebM and MKV but most players choke on VP9 inside MP4. If your remux produces a file that won't play, check whether the codec is compatible with the target container.

Keyframe-only cuts. When you combine -c copy with -ss (seek) and -t (duration) for trimming, FFmpeg can only cut at keyframe boundaries. Your trim points might be off by a few frames. If you need frame-exact cuts, you'll need to re-encode at least the video stream.

Missing moov atom on interrupted encodes. If an MP4 encode was interrupted, the moov atom never got written. You can't fix this with -c copy because the container metadata is corrupt. Tools like untrunc or recover_mp4 can sometimes reconstruct it, but that's outside FFmpeg's scope.

Audio codec mismatch in MKV to MP4. MKV files sometimes contain audio in formats that MP4 doesn't support well (like Vorbis or FLAC). The remux will succeed, but playback might fail. In that case, copy the video but re-encode just the audio: -c:v copy -c:a aac.

FAQ

Is -c copy the same as -codec copy?

Yes. -c copy is shorthand for -codec copy. Both tell FFmpeg to copy all streams without re-encoding. You can also be specific per stream: -c:v copy for video only, -c:a copy for audio only.

Does -c copy reduce file size?

Not directly. Since no re-encoding happens, the bitstream stays the same size. The file might be slightly smaller or larger depending on container overhead differences between MKV and MP4, but we're talking kilobytes, not megabytes.

Can I remux a WebM file to MP4?

It depends on the codecs. If the WebM contains VP8 or VP9 video, putting it in an MP4 container is technically possible but playback support is inconsistent. If it contains H.264 (rare in WebM), the remux to MP4 works fine. For VP9 to MP4 conversion that actually plays everywhere, you'd need to re-encode to H.264.

How do I check what codecs are in my file?

ffmpeg -i input.mkv

Look for the "Stream" lines. They'll show something like Stream #0:0: Video: h264 and Stream #0:1: Audio: aac. If both are compatible with your target container, -c copy will work.

Why is my remuxed file slightly different in size?

Container formats have different overhead. MKV and MP4 store metadata differently, use different packet framing, and have different alignment requirements. A few KB difference is normal and expected.

*Last verified: June 2026. CLI examples tested with FFmpeg 7.x, API examples use FFmpeg Micro v1.*

About Javid Jamae

Founder & CEO at FFmpeg Micro

Javid is a software engineer, author, and entrepreneur with over 25 years of professional software development experience across enterprise, startup, and consulting environments. He founded FFmpeg Micro to make video processing accessible to developers through a simple, automation-first REST API.

Software EngineeringVideo ProcessingFFmpegCloud ArchitectureAPI DesignAutomation

Ready to process videos at scale?

Start using FFmpeg Micro's simple API today. No infrastructure required.

Get Started Free