lisamelton / other_video_transcoding

Other tools to transcode videos.
MIT License
549 stars 25 forks source link

Question: 8-bits and 10-bits encoding #30

Closed nakda closed 4 years ago

nakda commented 4 years ago

Hey!

README is mentioning 8-bits and 10-bits encoding, and I would like to make sure I understand those correctly to keep a high level of compatibility for all kind of players consuming my media library.

Please let met know if any of this is wrong, but two main norms are providing HDR capabilities: HDR10 (10-bits) and Dolby Vision (12-bits). Until then, we were used to SDR which is capable of both 8-bits and 10-bits encoding. Another HDR norm called HLG seems to be compatible with both HDR and SDR, still relying on 10-bits channels.

What I would like to know is, using other_video_transcoding:

  1. Is it preserving the source color range (SDR stays SDR, and HDR content stays HDR)?
  2. What HDR norm is followed by default using HDR sources?
  3. Can I specify any manually (e.g.: Dolby Vision)?
  4. Is X-bits encoding totally independent from AVC/HEVC (e.g.: can I encode 10-bits SDR/HDR with H.264, or 8-bits with HEVC)?

Thank you!

martinpickett commented 4 years ago

Hi,

I am sure @donmelton will be around soon to provide a definitive answer, but HDR has been a recent topic of interest so I can provide you some answers.

other-transcode does a poor job with HDR content. While it is capable of encoding with 10-bits (a requirement for HDR10) it does not retain all the relevant metadata required for a HDR monitor to display the content correctly.

other-transcode will allow you to transcode a HDR10 video but you will not get a HDR10 output. In fact, you will get an SDR output with strange looking colours. I cannot recommend the experience. Further, to the best of my knowledge, other-transcode will not accept any other HDR formatted video at all.

A quick bit of background. The addition of 10-bit encoding was to improve the visual quality of SDR content. As strange as it may sound, encoding an 8-bit source into a 10-bit output provides noticeable visual improvements compared with an 8-bit output (everything else being equal). These visual improvements are predominantly found with a reduction in colour banding, particularly in dark scenes.

I hope this is helpful. As I said, @donmelton will be around later to give a definitive answer.

Martin

samhutchins commented 4 years ago

This is my favourite video to link to when it comes to why banding happens: https://www.youtube.com/watch?v=h9j89L8eQQk

10-bit SDR will look better than 8-bit SDR because it has more shades of any given colour to use, which greatly reducing banding :-)

lisamelton commented 4 years ago

@Nakda Thank you for opening this issue. These are excellent questions.

Also, my thanks to @martinpickett and @samhutchins of the HiveMindā„¢ for stepping in while I was asleep.

OK, let me try to summarize...

While other-transcode does support 10-bit encoding, it does not yet support HDR. This is because it cannot generate true HDR metadata nor convert HDR to an 8-bit colorspace.

This is only a limitation of other-transcoding because ffmpeg and the hardware encoders it leverages don't support these features yet. Nor do any non-professional, widely-available tools.

So why support 10-bit encoding? Because it's an excellent way to reduce color banding during the transcoding of 8-bit source material. And non-HDR 10-bit video is widely supported now by devices from Apple, Amazon and Roku.

Does that answer your questions?

nakda commented 4 years ago

@martinpickett @samhutchins thank you for the inputs!

@donmelton yes, thank you! other-transcoding does not support HDR, so I just need to check if my clients support 10-bits SDR or if I should stick with 8-bits.

Since you're mentioning it, I would be more interested in HDR to SDR tonemapping than HDR encoding capabilities! But it's another subject, and I believe we will have to wait for FFMPEG to sort it out first.

Closing the issue, thank you all again!

regs79 commented 4 years ago

Hey everyone, sorry to jump in on a closed issue but I've ran a few 4K HDR films through other-transcoding and the HDR seems to work fine?

I can't side by side them as I don't have a HDR monitor or two HDR TV's, but flipping between the original and transcoded versions on my TV I can't see any colour difference and it flags them correctly as HDR in my Plex.

Is it 100% for sure not working and I'm just not noticing it? šŸ˜¬

lisamelton commented 4 years ago

@regs79 It is, for certain, not working correctly. :) And it can't because ffmpeg has no facility yet with which to set the extended color mapping. But I'm glad it looks great anyway! Good to know.

regs79 commented 4 years ago

@donmelton well that's disappointing. It's imperceptible to me, I guess I'll redo them at a later date. For now if I'm desperate I can always pull the disc out.

Thanks!