I've been looking into how to compress a video using ffmpeg when I stumbled across CABAC encoding which I could specify by using the libx264 for the video codec and pairing it with the proper arguments (-x264opts cabac=1), however I know that libx264 is usually used for lossy compression. However, CABAC encoding is listed as a lossless compression technique on Wikipedia. I know I can control the quality of the file by using the -crf tag but I wanted to know if I specified ffmpeg to use cabac, would the output video be compressed lossless or lossy?

2 Answers 2


Cabac is lossless, but h264 is lossy. The part you are missing is that cabac is not THE compression algorithm. It is just the final step out of hundreds of steps in video compression. By the time you get to cabac, all the lossy steps have already been performed, and a final lossless step is added to squeeze a few more bits out.


CABAC will give a small compression but increases the encoding time a bit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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