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?


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.

  • Thanks, it makes sense now. – LEM Nov 28 '18 at 18:22

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.