How to correctly use x265 lossless parameter with avconv

4

2

x265 has a lossless mode which is used for ultra-high bitrates with zero loss of quality. I tried using this mode with avconv as follows:

avconv -i input.mp4 -c:v libx265 -x265-params lossless -c:a copy output.mp4

However, using this mode has an opposite effect : video came out to be of extremely low quality. It was totally lossy!!

Am I using the parameter incorrectly? Or am I somehow misunderstanding the definition of the word "lossless"?

Important Links:

shivams

Posted 2015-09-21T20:01:23.360

Reputation: 1 269

Should it not be --lossless ? – Linef4ult – 2015-09-23T07:20:48.657

@Linef4ult : No. That doesn't work. --lossless is used when using the x265 binary directly. However, when using avconv, parameters are passed differently. For example, CRF value is passed as --crf 28 when using x265 directly, however it is passed as -x265-params crf=28 when using avconv. – shivams – 2015-09-23T07:51:46.553

Answers

2

FFmpeg/Libav require a "key=value" format so it requires a "=1". So for your example:

avconv -i input.mp4 -c:v libx265 -x265-params lossless=1 -c:a copy output.mp4

To confirm if it works (via command line) you should see the following log:

x265 [info]: Rate Control                        : Lossless

Refs:

TheBiggerGuy

Posted 2015-09-21T20:01:23.360

Reputation: 36

This does work!! Thanks @TheBiggerGuy. I tried converting a x264 file to x265 losslessly, and it worked. The file size of x265 came out to be larger, which was kind of a bummer, though not unexpected. I will accept your answer soon after a bit of further testing. – shivams – 2016-06-04T04:11:44.260