Jump to content

How to retain HDR or Dolby Vision when transcoding media?


Recommended Posts

donniedarko83
Posted

Hi,

With the “Enable HEVC Video Encoding (experimental)” feature, I thought it would finally be possible to display HDR or Dolby Vision content correctly when the file is transcoded. However, this still does not seem to be the case. Is this a feature that will never work? Since my internet connection is too slow, I always have to transcode with tone mapping for HDR/DV content.

 

visproduction
Posted (edited)

I don't know the answer. I suspect you are pushing the limit of connectivity. High quality 4K still has to be broken up in TCP packets for transport to the player.  Packet sizes of around 1460 Bytes and 40 Bytes header info.  What happens when Dolby Vision on h.265 is compressed to a variable bit rate and then the stream encapsulated to TCP packets that may run into network traffic or some other hardware / software server and user playback delays? 

Using a variable bit rate means that the I-Frame will not be the same size and with 4K, the I-Frame sequence will not fit into a single TCP packet.  What happens if the packets get out of order, which is common with network traffic, particularly over many connection hops and if there is any Wifi segment.  The player will accept out of order packets up to a limit and re-request missing packets, as needed.  I've read that variable bit rates tend to cause about 15% more failures than using constant bit rate, based on a pro encoding expert comments. To make matters worse, the player cannot proceed to play video if a packet with an i-Frame is missing and it won't even play the proceeding i-Frame  to it's end, if the end data is also missing in a TCP packet. I think typical 4K I-Frames are around 7 seconds, so there you have up to 14 seconds stalled with an out of order packet that contains in i-Frame on 4K.  I have not tested this.  Anyone with test information regarding TCP packets, please feel free to dispute my summary.

The point is that bandwidth alone does not measure the task of reconstituing the video stream from TCP packets.  Some software players set a limit on missing packets.  This is a RWIN setting in the TCP stack of the OS.   I think also the player maintains only a certain amount of out of order, stranded packets in cache, or they might still dump the packets and re-request all packets starting the missing one. 4K I-Frame seqences are larger, of course than 1080P, so the allowed 4K cache would be at least 1/4 the number of video seconds of a 1080P media.  If missing TCP packets happen a lot, you will get stuttering that has not that much to do with the bandwidth.  Traffic and connection noise, packet delays along the router, especially if there are many hops all contribute to the problem.  Just declaring that the paid for bandwidth should be enough to eliminate this issue, is not really a 100% valid argument. Is the player ready to cache 14 seconds of high band width HDR 4K? What about caching 2 sequences?... If there was no encapsulation into TCP packets, then maybe you could argue that bandwidth is mostly the issue.

===

I think the combination of heavy media sizes and TCP packets, networks that have other traffic and long distant connections can contribute to stuttering and playback failures.  The fix, I think is to prep content to the maximum bandwidth size that works for the slowest network connection.  Direct playback sort of ignores all these issues.  Transcoding help because it can automatically watch out for too much bandwidth.  I think many people go by what the bandwidth they test, but that's only part of the issue.  

I do not offer 4K and convert every h.265 media to h.264  with a slow, extreme high quality pre encode at around 2400 kbps and only have AAC audio at high bitrates with HE-AAC as high as you want, but LC no higher than 128 because of a incompability bug, that may still be valid. This gives a 1080P, looking excellent but, not encoded in real time for most servers without a support encoding board.  This 1080P media collection does not stutter for most all users. 

Tech info showing Dolby Vision:
 https://dolby.my.salesforce.com/sfc/p/#700000009YuG/a/4u000000l6G4/4R18riPaaW3gxpVx7XwyQLdEITLFjB.w.Si0LoQR5j8


Bitrate Calculator for minimum bitrate for acceptable playback:
 https://bitratecalculator.org/calculators/h265-bitrate-calculator

Edited by visproduction
  • 2 weeks later...
Posted

Hi, when doing a full transcode it is currently not supported to preserve HDR, although this could be a topic of exploration for future updates. Thanks.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...