What's the difference in FFMPEG between using -c:v libx264, -c:v copy and -vcodec copy?

0

1

I'm trying to record video and audio from an IP Camera streaming in H.264.

I found these different options:

-i "camera_url"  -c:v libx264 -acodec copy "out.mp4"
-i "camera_url"  -c:v copy -acodec copy "out.mp4"
-i "camera_url"  -vcodec copy -acodec copy "out.mp4"

Could anybody tell me what's the difference between those 3 types of recordings? As far as I understand the last one doesn't do any transcoding so whatever comes from the camera is stored in the file. What about the other 2?

LEM

Posted 2018-11-28T17:23:04.027

Reputation: 103

Answers

1

The -codec option sets the choice of encoder. This can either be the name of an encoder or copy. The latter avoids transcoding and copies the packets from input to output. -c is a short form for -codec. Both of these can accept stream specifiers, like -c:v:2 or -codec:a. The former will set the encoder for the 3rd video stream in the output and the latter will set the encoder for all audio streams.

vcodec and acodec are aliases for -c:v and -c:a but do not accept stream specifiers.

Gyan

Posted 2018-11-28T17:23:04.027

Reputation: 21 016