
If you’re working with video files, then you’ve probably reached for FFmpeg to copy video more times than you can count. Perhaps you’re trimming a clip for a presentation, or stitching together several segments for a demo reel. Or maybe you need to convert between multiple video formats, extract an audio stream, or reorganize media in a folder. FFmpeg handles all of these tasks, often in just seconds, without touching your original video quality.
One of FFmpeg’s most powerful features is copy mode, which lets you move encoded video and audio streams from one container to another without re-encoding them. This preserves quality and dramatically speeds up your production pipeline.
In this tutorial, you’ll learn:
- What FFmpeg copy video mode does and why it’s so fast
- The difference between copy mode and full re-encoding
- How to copy and trim videos with FFmpeg
- How to expand your workflow to deliver videos at scale
In this article:
- Introduction to FFmpeg
- Using FFmpeg to Copy Videos
- How to Make a Video Copy with FFmpeg
- Where FFmpeg Falls Short
- Introducing Cloudinary as the Scalable Solution
- Mapping FFmpeg Tasks to Cloudinary Transformations
- Helpful FFmpeg Settings for Copying Video
Introduction to FFmpeg
FFmpeg is a command-line tool that reads, writes, and transforms virtually any audio or video format that you might encounter when working on your projects. With FFmpeg, you can perform operations like:
- Changing containers, like MKV to MP4
- Transcoding between different codecs, such as H.265 or AV1
- Extracting, replacing, or removing audio tracks from videos
- Video editing with trimming, concatenating, or applying filters
Most of the time, you’ll see FFmpeg used for transcoding, where the video file is decoded into its raw frames, has one or more filters applied to it, and then has those frames encoded into a new format. You may have even run a command like this yourself before:
ffmpeg -i input.mp4 -c:v libx264 -preset medium -crf 23 -c:a aac -b:a 128k output.mp4
This approach is useful for quickly working with a few video files, but it can be extremely slow and resource-heavy.
The FFmpeg copy video mode takes a completely different approach. Instead of decoding and re-encoding the video, FFmpeg simply copies the encoded packets from one container to another. Because the bitstream is unaltered, the video quality remains perfect, and processing is significantly quicker, frequently hundreds of times faster than transcoding, thus lightening the burden on your infrastructure.
Not to mention, the original video remains untouched. The FFmpeg copy video mode ensures you have access to quick video transformations on demand while keeping the source file intact.
Using FFmpeg to Copy Videos
Let’s start with the core idea, which is a fundamental concept called stream copy. This is how you can tell FFmpeg to copy video, audio, subtitles, and any other streams from one container to another without re-encoding.
ffmpeg -i source.mkv -c copy output.mp4
If the codecs in the source video (source.mkv) are compatible with the specified container (here, it’s MP4), then this command will execute quickly and the original video quality will be preserved.
You can also be more specific about what you want to copy over:
-c:v copysays to copy the video stream only-c:a copysays to copy the audio stream only
This becomes useful when, for instance, you want to keep the video as-is but want to re-encode the audio (perhaps for compatibility reasons).
Why use FFmpeg’s -vcodec copy and not -sameq?
Let’s say you’re trying to convert a video without losing quality, and you search online for FFmpeg copy video commands to help. You may come across something like the following:
ffmpeg -i source.mp4 -sameq output.mp4
Unfortunately, the -sameq option has nothing to do with the video quality. It actually stands for “same quantizer,” which is something completely different (an internal encoding parameter used when compressing video). -sameq tells FFmpeg to match the quantizer of the input, but it does not guarantee a visually identical output. In fact, it can easily produce lower-quality results if the target format, bitrates, or other settings differ.
The command was the source of such confusion that the developers eventually removed the option from FFmpeg entirely, since it didn’t copy the original video stream, didn’t preserve the video quality, and caused way more problems than it solved.
If you truly want to preserve the video quality, then you’ll need to use one of the following copy flags instead:
-vcodec copy-c:v copy-codec:v copy
These three commands all do the same thing: they perform a bit-for-bit copy of the existing video stream without re-encoding. This is the real “keep the same quality” operation that most users are looking for.
How to Make a Video Copy with FFmpeg
Now that you understand how FFmpeg copy video mode works, let’s try a few examples to see how it runs in the command line. First, you’ll need to navigate to the folder containing your source video file.
Use FFmpeg to Copy Video to a New Format
The most common use case for FFmpeg’s copy video mode is converting between containers without touching the underlying streams. Maybe you downloaded a perfectly good video in MKV format, but your video editing software only accepts MP4. Or perhaps you need to send a video to someone whose device doesn’t recognize certain containers.
The following FFmpeg copy video commands allow you to make these conversions almost instantly while preserving the exact quality of the original.
# MKV to MP4 - common for sharing or compatibility
ffmpeg -i jumping_from_rocks.mkv -c copy jumping_from_rocks.mp4
# MP4 to MOV - sometimes needed for Final Cut Pro or QuickTime ffmpeg -i jumping_from_rocks.mp4 -c copy jumping_from_rocks.mov
#AVI to MP4 - modernizing old video files
ffmpeg -i jumping_from_rocks.avi -c copy jumping_from_rocks.mp4
These commands run in just seconds because FFmpeg isn’t decoding and re-encoding anything–it’s simply reading the compressed video and audio data from one container and writing it into another (like converting MKV to WebM). The quality remains identical because the actual encoded data never changes.
Trim a Video by Copying a Section
When you need to extract a portion of a longer video without re-encoding it, FFmpeg’s copy video command can save you a lot of time:
ffmpeg -i jumping_from_rocks.mp4 -ss 00:00:05 -t 00:00:10 -c copy trimmed.mp4
Here’s how this code works:
-sstells FFmpeg where to start-ttells FFmpeg how much time
Copy Over Only the Audio or Video Stream
Separating the audio and video tracks is a common part of the production pipeline, especially for creating podcasts from video interviews, extracting background music, or preparing a video for subtitles based on the audio. FFmpeg makes this process straightforward with its stream selection flags:
# Extract audio only ffmpeg -i jumping_from_rocks.mp4 -vn -c:a copy audio.m4a # Extract video only ffmpeg -i jumping_from_rocks.mp4 -an -c:v copy video_only.mp4
The -vn flag tells FFmpeg to exclude any video streams from the output, resulting in an audio track. Similarly, the -an flag does the same for the audio track, excluding it from the video. With these commands, extracting a two-hour audio track from a video takes seconds, not the hour it could otherwise take to re-encode. The quality remains identical to the original because you’re not touching the encoded data, simply moving it to a new file.
Where FFmpeg Falls Short
FFmpeg is a powerful tool for local video processing, but it can become difficult to manage as projects grow. Manual commands, hardware demands, and file handling can slow teams down when they need to process many assets at once. These limitations often show up as libraries expand and workflows become more complex.
Some common challenges include:
- Steep learning curve for writing and maintaining command line operations
- Limited visibility into processing errors without extra logging tools
- Heavy resource usage that slows other tasks on the same machine
- Manual tracking of files, versions, and output locations
- No built in system for collaboration or shared workflows
As your needs scale, these issues can create friction and slow production. Cloudinary helps remove these bottlenecks with automated transformations, cloud based processing, and streamlined delivery that keep video workflows fast and reliable.
Introducing Cloudinary as the Scalable Solution
Cloudinary takes the core functions of FFmpeg and turns them into scalable, cloud-based transformations. Instead of running commands on your local machine, you:
- Upload a video once
- Request any transformation on demand
- Receive an optimized URL backed by a global CDN
Mapping FFmpeg Tasks to Cloudinary Transformations
Cloudinary gives teams a faster way to handle many tasks that FFmpeg covers, but without the need to manage command line operations or heavy local processing. Its programmable URLs let you create, edit, and deliver optimized videos on demand, which keeps workflows light and easier to scale.
Copying or Passing Through Video Streams
When you want to deliver a video without re-encoding, FFmpeg often uses the copy flag. In Cloudinary, you can achieve a similar result by requesting the original file or applying a transformation that keeps format and quality unchanged. This lets you serve the source version directly through a fast CDN.
To deliver the original file without re encoding, you can request it directly:
https://res.cloudinary.com/<cloud_name>/video/upload/v1/sample.mp4
Basic Edits Like Trimming and Cropping
FFmpeg supports trimming with flags that define start and end times. Cloudinary offers the same control with parameters for duration, start offset, and cropping. These adjustments can all exist within a single URL, so you can generate multiple versions without duplicating files.
Trim the first five seconds and crop to a centered 1:1 frame:
https://res.cloudinary.com/<cloud_name>/video/upload/so_0,du_5,c_crop,ar_1:1/sample.mp4
Applying Transformations
FFmpeg is often used for tasks like resizing, codec changes, or quality adjustments. Cloudinary simplifies this with transformation parameters that handle scaling, format conversion, and compression automatically. You can tune results manually or let Cloudinary select optimal settings for the device and connection.
Resize to 720p, optimize quality, and auto select the best format:
https://res.cloudinary.com/<cloud_name>/video/upload/w_1280,h_720,q_auto,f_auto/sample.mp4
Stitching or Combining Clips
FFmpeg uses complex filter chains to merge clips, while Cloudinary offers a simpler way using video overlays and chained transformations. You can layer videos, append segments, or add intro and outro clips through URLs that Cloudinary processes in the cloud.
Overlay a second clip onto the first:
https://res.cloudinary.com/<cloud_name>/video/upload/l_video:second_clip,fl_splice/sample.mp4
Adding (or Removing) Audio
Replacing or stripping audio tracks usually requires careful FFmpeg parameters. Cloudinary supports this with transformations that mute audio, extract it, or apply a different track. This gives you a clean workflow for producing silent loops or pairing new audio with existing footage.
Serve the video without its audio track:
https://res.cloudinary.com/<cloud_name>/video/upload/ac_none/sample.mp4
By mapping these tasks to Cloudinary, you shift from manual operations to automated media handling that adapts to your project needs. This approach helps teams work faster, deliver consistent results, and scale video workflows with confidence.
Helpful FFmpeg Settings for Copying Video
Copying video streams with FFmpeg is useful when you want to avoid re-encoding and keep the original quality intact. This approach speeds up processing and reduces the risk of introducing compression artifacts. It is a common technique when repackaging files, changing containers, or preparing clips for further edits.
A few helpful settings include:
-c copy:This flag tells FFmpeg to copy both audio and video streams without re-encoding. It is the core setting for fast, lossless operations.-codec:v copyand-codec:a copy:These give you control over which streams are copied. You can pass through only the video or only the audio depending on your needs.-map 0: This ensures FFmpeg includes all streams from the input file. It is helpful when the source has multiple audio tracks or metadata.-f <format>: This sets the output container without altering the streams. It is often used when moving from one file type to another.
Wrapping Up
FFmpeg is ideal for quick, local video manipulation, and its copy mode is especially powerful when you need speed and lossless quality. Cloudinary extends this by providing a scalable, cloud-based environment for video transformations: frame-accurate trimming, automatic codec handling, splicing, metadata, and global delivery via CDN.
FFmpeg is your local tool. Cloudinary is your production workflow. Deliver responsive videos that look great on any device with Cloudinary’s flexible tools. Join Cloudinary today and ensure your videos always look their best.