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?

1 Answer 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.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .