Log in

View Full Version : 10-bit encoding


WeWant10bit
7th February 2013, 08:17
I'm not sure if this should be posted in the AVIsynth portion or this but regardless, I'm sure either will do.

Anyway, I'd like to convert (encode?) my 8-bit movies to 10-bit WITHOUT the loss of quality (dropping the video bitrate?). I'm pretty sure I have the MeGUI settings correct. I seem to only be missing the "AVIsynth script" for which I spent about 2 to 3 hours looking for to no avail. When I found something remotely close to use, I couldn't figure out how to insert it into MeGUI.

Is there a site with step-by-step instructions on this? Also, if I can future proof myself further by convert/encoding them to 12 or 16-bit, that'd be nice!

Thanks! :thanks:

upyzl
7th February 2013, 11:54
Anyway, I'd like to convert (encode?) my 8-bit movies to 10-bit WITHOUT the loss of quality (dropping the video bitrate?)

Any encodings, except lossless encoding(that means x264 --qp 0, without 8bit or 10bit), always has the loss of quality. Generally, video encoding is always lossy encoding.

for 10-bit depth encoding, just use 10bit encoders(e.g. 10bit x264) instead of 8bit.

WeWant10bit
7th February 2013, 21:31
Any encodings, except lossless encoding(that means x264 --qp 0, without 8bit or 10bit), always has the loss of quality. Generally, video encoding is always lossy encoding.

for 10-bit depth encoding, just use 10bit encoders(e.g. 10bit x264) instead of 8bit.

Alright. I understand that now. :thanks:
Now, what do I do about applying a Avisynth script to MeGUI? I'm sure there's already a premade script lying around, right?

WeWant10bit
10th February 2013, 13:20
Bump?

J_Darnley
10th February 2013, 13:51
What are you trying to do? If you want 10-bit video, use a 10-bit x264, just as was stated. You do not need to do anything special in Avisynth if you want 10-bit. If you need help with Avisynth you need to state what your problem is and this is not the place to ask.

Overdrive80
11th February 2013, 04:39
One question: If I want use x264_CLI with avs:

"c:\x264.exe" --preset slow --tune film --crf 16 --level 4.1 --vbv-bufsize 30000 --vbv-maxrate 40000
--output "c:\video.mkv" "c:\ script.avs"

Should I use any loader patched as this ffmpegsource (http://forum.doom9.org/showpost.php?p=1528494&postcount=1295)?

J_Darnley
11th February 2013, 12:00
No, unless your input video has a bit depth greater than 8 bits.

WeWant10bit
11th February 2013, 14:28
I would like to ENSURE that I'll be receiving the highest quality 10-bit has to offer by using these settings: 16 Quality, slowest speed (slowest next to 'Placebo'). With those settings, will I receive the best possible quality 10-bit has to offer? Also, how can I make it 16-bit for future proofing purposes?

J_Darnley
11th February 2013, 14:36
Most will regard crf 16 as good quality. Using the veryslow preset is fine but very slow. x264 does not support anything greater than 10-bit. I don't see how this is future proofing at all. If you want to retain the best possible quality, do not encode. Very easy, very future proof.

WeWant10bit
11th February 2013, 15:00
Most will regard crf 16 as good quality. Using the veryslow preset is fine but very slow. x264 does not support anything greater than 10-bit. I don't see how this is future proofing at all. If you want to retain the best possible quality, do not encode. Very easy, very future proof.

I don't understand. Doesn't the conversion to 10-bit make the visual quality better, while also lowering file size?

LoRd_MuldeR
11th February 2013, 15:26
10-Bit doesn't make the quality "better" magically ;-)

It can be helpful to fight certain artifacts, like banding, and generally improves compression efficiency a bit - even for 8-Bit sources.

Anyway, just encoding your source as 10-Bit doesn't make it look better than the original. There still will be a "generation loss" (quality drop) in the re-encoded file. Only the quality loss should be a bit smaller with 10-Bit encoding than with 8-Bit encoding, at the same bitrate.

(As J_Darnely said, getting the best possible quality, by definition, would be not re-encoding at all. Either that or using lossless encoding, which of course would be HUGE)

detmek
11th February 2013, 15:33
No. Every lossy compression introduces quality loss. And x264 does lossy compression (except for --qp 0). 10-bit x264 will give you better quality at the same file size and same settings compared to 8-bit x264 encoding but it will not give you bettet quality compared to source.
And CRF 15 will give you better quality then CRF 16. Also, CRF 14 will give you better quality compared to CRF 15, and so on... You will end up with CRF/QP 0 which will give you the same quality as source but the file will be much larger.

WeWant10bit
11th February 2013, 15:53
So in order to exceed the quality from the source into a better quality 10-bit "source", I'll have to do "lossless encoding that'll make the file HUGE"? Does this lossless encoding in 10-bit automatically fight the banding and color reproduction issues? I thought I understood but now I realize I don't. I appreciate the in-detail explanation. Just more further clarification on getting the BEST quality possible. Let's remove file size from the equation.

LoRd_MuldeR
11th February 2013, 16:00
There is no way to "magically" make your re-encode better than the source ;)

Lossy compression always introduces some quality degradation. 10-Bit encoding can help to reduce that quality loss. Using a higher bitrate (i.e. lower CRF) also helps to reduce the quality loss. But that's it.

Finally, a lossless compression, by definition, ensures that there will be no quality loss at all (at the cost of a HUGE file), but there will be no quality improvement either...

Only way to actually improve the source is applying certain filters. And even that will only help if the source has a specific defect that can be "repaired" with the suitable filter. Blindly applying filters ("because you've heard other people do it") is probably going to make things worse! With filters the rule of thumb "the fewer the better" applies. That is: Don't use a filter, unless you have a very good reason to apply that specific filter!

mandarinka
11th February 2013, 23:44
Blindly applying filters ("because you've heard other people do it") is probably going to make things worse! With filters the rule of thumb "the fewer the better" applies. That is: Don't use filters, unless you have a very good reason to apply that specific filter!

Very true. This is one of the central encoding rules.
These words should be carved into stone with 10 meter letters everywhere...

WeWant10bit
12th February 2013, 22:12
There is no way to "magically" make your re-encode better than the source ;)

Lossy compression always introduces some quality degradation. 10-Bit encoding can help to reduce that quality loss. Using a higher bitrate (i.e. lower CRF) also helps to reduce the quality loss. But that's it.

Finally, a lossless compression, by definition, ensures that there will be no quality loss at all (at the cost of a HUGE file), but there will be no quality improvement either...

Only way to actually improve the source is applying certain filters. And even that will only help if the source has a specific defect that can be "repaired" with the suitable filter. Blindly applying filters ("because you've heard other people do it") is probably going to make things worse! With filters the rule of thumb "the fewer the better" applies. That is: Don't use a filter, unless you have a very good reason to apply that specific filter!

This sums it up then. Thank you for your explanation.

nibus
16th February 2013, 04:37
10-bit is really only worth it on animated sources. On regular live action film the bitrate savings are pretty small, and either way you lose compatibility with many software and hardware players.

0rion42
19th February 2013, 18:05
Sorry to hijack/bump this thread, but I didn't want to make a new one for my quick question, and it's related to this topic. I just was curious why encoding with 10-bit color reduces the banding artifacts, since AFAIK most monitors just output with 8-bit color. Cheers.

sneaker_ger
19th February 2013, 19:02
The output depth is not that important - important is the precision (depth) of the internal calculations of the codec, which is also higher for 10 bit. This reduces rounding error and in turns increases compression (and practically eliminates banding artifacts).

http://x264.nl/x264/10bit_01-ateme_pierre_larbier_422_10-bit.pdf
http://x264.nl/x264/10bit_02-ateme-why_does_10bit_save_bandwidth.pdf
http://x264.nl/x264/10bit_03-422_10_bit_pristine_video_quality.pdf

paradoxical
19th February 2013, 22:17
Sorry to hijack/bump this thread, but I didn't want to make a new one for my quick question, and it's related to this topic. I just was curious why encoding with 10-bit color reduces the banding artifacts, since AFAIK most monitors just output with 8-bit color. Cheers.

Because it maintains gradients better due to higher internal precision. This allows you to pass a higher quality input and a good renderer like MadVR will properly dither down to 8-bit upon playback. So even if you use an 8-bit panel the result will still be improved. Otherwise the encoder basically eats the fine gradients and you get a banded mess. To combat banding without 10-bit encoding, you need to increase bitrate and/or add noise, which decreases compressibility and increases bitrate/size, to mask help prevent visible banding.