What is the correct command line to convert a MKV 10b to MKV 8b with identical quality?

1

I want to convert a MKV 10b to MKV 8b, with identical quality of sound and video.

I uses the following command line:

 ffmpeg -i -c my_file.mkv: libx264 v -profile -crf 18 -PRESET medium high -level 40 -c:a copy c: s copy output.mkv

but I think with the CRF parameter I'm losing video quality... So my question is, what is the correct command line to convert a MKV 10b to MKV 8b with identical quality?

Pancho

Posted 2016-01-27T20:17:09.660

Reputation: 13

210b? Does that mean 10bit? If so, what you are asking is impossible. You can't encode 10bits of data in 8bits without losing a little color information. – szatmary – 2016-01-28T02:51:37.213

Thanks for the answer, and yes, I was referring to 10 bits. – Pancho – 2016-01-28T15:49:23.767

Answers

1

As @szatmary said: Unless your original video's color range was originally upsampled from the 8 bits that you're trying to encode to, you are necessarily going to lose that extra information when downsampling. There is no way 10 Bits of information can be represented in 8. Depending on the content you may not even notice that difference though.

The CRF parameter instead controls the amount of lossy compression that is applied to the video. CRF in x264 ranges from 0 to 51, where 0 gives you lossless compression – that is, the best possible quality – and 51 gives you the worst quality. Typically, you would choose a CRF between 18 and 28. For most videos, 18 should yield a video that cannot easily be distinguished from the original. It will however still be compressed, so if you want to make sure that – at least in this sense – no quality will be lost, you should choose an even lower CRF value such as 12. This will still degrade the video, but it should be imperceptible.

slhck

Posted 2016-01-27T20:17:09.660

Reputation: 182 472

Thank you for your excellent answer, I did not understand well the parameter CRF, because I thought I might have to put it to 0 to have the identical quality of 10-bits mkv, but when testing on a 10-bits 435mb came a 8bits mkv with 3.5 GB size, thank you very much again and do a test with a CRF 12, an apology for my bad English and greetings from Mexico city. – Pancho – 2016-01-28T16:03:14.740

You are welcome! If this answer helped you solve your problem, it'd be great to mark it as the accepted answer using the checkmark to the left of it. – slhck – 2016-01-29T08:32:51.777