What does “copy” do in a ffmpeg command line?

一笑奈何 提交于 2021-02-17 20:33:07

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/38379412/what-does-copy-do-in-a-ffmpeg-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!