/compare/ffmpeg/ffmpeg-copy-vs-reencode
ffmpeg -c copy vs re-encoding: speed, quality and limits
verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash) · ffmpeg version 9.0.2-full_build-www.gyan.devupdated 2026-10-20
- tool
- FFmpeg
- compares
- -c copy vs re-encode
-c copy (stream copy) moves the compressed audio and video packets into a new container without decoding them: it takes seconds and loses nothing, but you cannot scale, filter or change the codec, and cuts can only start at keyframes. Re-encoding decodes and compresses again: slower and lossy, but it allows any filter, codec or frame-accurate cut.
Criterion by criterion
| Criterion | -c copy | Re-encode (e.g. -c:v libx264) |
|---|---|---|
| Speed | limited by disk speed | limited by the encoder (much slower) |
| Quality | identical to the source | generation loss, controlled by -crf / -b:v |
| Cutting | start snaps to the nearest keyframe | frame-accurate |
| Filters (scale, crop, overlay) | not possible | possible |
| Change codec | no | yes |
| Change container | yes, if the target supports the codec | yes |
Same task both ways
ffmpeg -hide_banner -loglevel error -f lavfi -i testsrc2=size=1280x720:rate=30:duration=10 -c:v libx264 -preset veryfast -g 60 -pix_fmt yuv420p -y src.mp4
start=$(date +%s%N); ffmpeg -hide_banner -loglevel error -i src.mp4 -c copy -y copy.mkv; t_copy=$(( ($(date +%s%N) - start) / 1000000 ))
start=$(date +%s%N); ffmpeg -hide_banner -loglevel error -i src.mp4 -c:v libx264 -preset medium -crf 23 -y reenc.mkv; t_enc=$(( ($(date +%s%N) - start) / 1000000 ))
echo "stream copy: $( [ "$t_copy" -lt "$t_enc" ] && echo faster || echo slower ) than re-encoding"
for f in copy.mkv reenc.mkv; do printf '%-9s codec=%s\n' "$f" "$(ffprobe -v error -select_streams v -show_entries stream=codec_name -of csv=p=0 $f)"; doneOutput
stream copy: faster than re-encoding copy.mkv codec=h264 reenc.mkv codec=h264
Timings vary from machine to machine, so only the comparison is shown. On this 10-second 720p clip stream copy is near-instant while libx264 has to encode all 300 frames.
When to use which
- Copy: change MP4 ↔ MKV, drop or extract a track, trim at keyframes, add
-movflags +faststart. - Re-encode: resize, burn subtitles, change codec for compatibility, cut at an exact frame, reduce file size.
- Mix them:
-c:v copy -c:a aaccopies the video and converts only the audio.
Sources
Related pages
commands · ffmpegffmpeg: extract audio from a video (with and without re-encoding)Extract audio with ffmpeg -i input.mp4 -vn -c:a copy audio.m4a without re-encoding, or make an MP3 with -c:a libmp3lame -q:a 2. Check codecs with ffprobe.flags · ffmpegffmpeg -crf: constant rate factor for x264, x265 and AV1-crf sets constant quality: lower means better and bigger. libx264 defaults to 23 on a 0 to 51 scale, libx265 to 28. Use it with -preset; sizes measured.glossary · ffmpegWhat is a keyframe (I-frame) in video?A keyframe, or I-frame, is a video frame encoded on its own, without other frames. Seeking and -c copy cuts start at keyframes; -g sets their interval.