What does "copy" do in a ffmpeg command line?
Asked Answered
T

1

17

I know that it copies something but other than that what does it do (to what extend it affects the output file)? Is it a switch or option? Why does it not have a hyphen before the word itself?

I see from other questions that it can copy streams without transcode but what are other possibility that I can manipulate it?

I have done ffmpeg --help but I don't see any documentation about it. Is there a website I can read more about it?

Tallbott answered 14/7, 2016 at 16:23 Comment(1)
I voted to close this question because, as the ffmpeg tag states: Only questions about programmatic use of the FFmpeg libraries, API, or tools are on topic. Questions about interactive use of the command line tool should be asked on superuser.com or video.stackexchange.com. Please delete this.Wentzel
R
30

copy is neither a switch nor an option. It's the value that can be set for the codec option, and means what it suggests i.e. copy the frames over instead of going through a decode->filter->encode process.

In the question you linked, the string is -c copy, which means set all codec operations to copy i.e. video, audio, subtitles, data and attachments, if any. -c is short for -codec.

If you set -c:v copy, it means to copy any video streams being processed. Same holds for -c:a or -c:s or -c:d. Of course, FFmpeg must support muxing the targeted stream into the output container. If it does not, the command will fail.

You cannot use audio/video/multimedia filters when asking to copy the stream over, since filters need to decode the audio/video frames and manipulate them. So their result needs to be re-encoded. You can, however, use bitstream filters with copy since those don't alter the main payload but only the associated metadata stored in the stream.

Ridiculous answered 14/7, 2016 at 18:2 Comment(1)
If you loose your audio streams despite using copy, try adding -map 0:a -map 0:vFlashing

© 2022 - 2024 — McMap. All rights reserved.