HEVC 10-bit source vs. 8-bit when saved -> MAJOR REENCODE NEEDED

dsperber

Member
I'm playing around with the new ATSC 3.0 broadcast channels that rolled out here in Los Angeles in mid-December. I've bought a Silicon Dust HDHomeRun Flex-4K 4-tuner unit, to deliver the ATSC 3.0 OTA channels.

The HDHR DVR server supports live/recorded data to client apps for playback, with client apps available for Windows, ATV4K, NVidia Shield and other Android devices and phones, LG OLED TV, etc. The HDHR DVR server can run on Windows, or HDHR boxes with their own storage, or Android devices like NVidia Shield Pro, etc.

The problem with ATSC 3.0 is that its audio is in a new Dolby AC-4 container (holding 2.0 and 5.1 audio), rather than the old AC-3 format. This presents bitstreaming problems as no AVR's available today have AC-4 support. And asking the TV app to do the decoding using the built-in AC-4 codec in new TV's (as part of their new ATSC 3.0 tuners) unfortunately delivers PCM 2.0 audio when bitstreamed out to the AVR via ARC/eARC.

Well it turns out that there is a version of FFMPEG that supports AC-4, and it is imbedded as part of a GitHub project named VideoPlayer AC4. So if you install that player, you also now have this new FFMPEG which can decode AC-4.

And a clever user on the HDHR forum wrote a command-line to invoke FFMPEG to copy and input file to an ouptut file while transcodingo just the AC-4 audio into AC-3, while leaving the original HEVC video untouched. Unfortunately the output format was specified as MP4. That might be accepbtable for Kodi, Plex, etc., but the HDHR client apps require MPG. So I wanted to now re-package the transcoded MP4 ouptut form FFMPEG, into MPG form for use by the HDHR client/server software, using VideoRedo to do the copy.

Unfortunately the now standard ATSC 3.0 HEVC video being broadcast is 10-bit color because ATSC 3.0 supports HDR. And it appears VideoRedo only supports 8-bit color. So when I went to SAVE the video I was warned by VideoRedo about the 10-bit vs. 8-bit issue, and that the output would be 8-bit, and that a MAJOR REENCODE was needed to accomplish this.

So, my question: is this really true? Isn't VideoRedo supposed to support HEVC? But just 8-bit? Is 10-bit planned for some day?

I am still working on getting the original FFMPEG file copy to go from MPG input to MPG output directly (just transcoding the AC-4 5.1 audio to AC-3 5.1), so that there will not be a need to use VideoRedo to copy an intermediate MP4 file to final MPG form. So the current 10-bit vs. 8-bit issue is really moot assuming I can code the correct command to utilize FFMPEG to do what I want. But I'm still curious if VideoRedo plans 10-bit support for HEVC, as that is actually the new broadcast standard.

Code:
General
ID                                       : 1 (0x1)
Complete name                            : F:\WinTV\NFL Football\NFL Football_20211216_17002030.ts
Format                                   : MPEG-TS
File size                                : 474 MiB
Duration                                 : 10 min 8 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 6 535 kb/s

Video
ID                                       : 49 (0x31)
Menu ID                                  : 3 (0x3)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L4.1@Main
Codec ID                                 : 36
Duration                                 : 22 h 31 min
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 59.940 (60000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 10 bits
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio #1
ID                                       : 50 (0x32)
Menu ID                                  : 3 (0x3)
Format                                   : AC-4
Format/Info                              : Audio Coding 4
Commercial name                          : Dolby AC-4
Format version                           : Version 2
Codec ID                                 : 6
Duration                                 : 10 min 6 s
Sampling rate                            : 48.0 kHz
Frame rate                               : 25.000 FPS (1920 SPF)
Compression mode                         : Lossy
Delay relative to video                  : 1 s 966 ms
Number of presentations                  : 1
Number of substreams                     : 1
Presentation #1                          : Stereo Main (Spanish)
Presentation ID                         : 0
Dialogue normalization                  : -24.00
Language                                : Spanish
Loudness                                : Yes
  Integrated loudness (speech gated)     : -24.3 LKFS
  Integrated loudness (level gated)      : -102.4 LKFS
  Audio Loudness Standard                : ATSC A/85
  Realtime loudness corrected            : Yes
  Dialogue corrected                     : Yes
Dynamic Range Control                   : Yes
Group #s                                : 1
Group #1                                 : Main
Content classifier                      : Main
Language                                : Spanish
Channel coded                           : Yes
Number of substreams                    : 1
Substream #s                            : 1
Substream #1                             : Stereo
Channel mode                            : Stereo
Channel layout                          : L R
Preprocessing                           : Yes
  Phase 90 Filer Info 2-ch               : Not applied
Dialogue enhancement                    : Yes
  Enabled                                : Yes
  Max gain                               : 9 dB

Audio #2
ID                                       : 51 (0x33)
Menu ID                                  : 3 (0x3)
Format                                   : AC-4
Format/Info                              : Audio Coding 4
Commercial name                          : Dolby AC-4
Format version                           : Version 2
Codec ID                                 : 6
Duration                                 : 10 min 6 s
Sampling rate                            : 48.0 kHz
Frame rate                               : 25.000 FPS (1920 SPF)
Compression mode                         : Lossy
Delay relative to video                  : 1 s 979 ms
Number of presentations                  : 1
Number of substreams                     : 1
Presentation #1                          : 5.1 Main (English)
Presentation ID                         : 0
Dialogue normalization                  : -24.00
Language                                : English
Loudness                                : Yes
  Integrated loudness (speech gated)     : -22.0 LKFS
  Integrated loudness (level gated)      : -102.4 LKFS
  Audio Loudness Standard                : ATSC A/85
  Realtime loudness corrected            : Yes
  Dialogue corrected                     : Yes
Dynamic Range Control                   : Yes
Downmix                                 : Yes
  LoRo center mix gain                   : -3.0 dB
  LoRo surround mix gain                 : -3.0 dB
  LtRt center mix gain                   : -3.0 dB
  LtRt surround mix gain                 : -3.0 dB
  LFE mix gain                           : -3 dB
  Preferred downmix                      : Pro Logic II
Group #s                                : 1
Group #1                                 : Main
Content classifier                      : Main
Language                                : English
Channel coded                           : Yes
Number of substreams                    : 1
Substream #s                            : 1
Substream #1                             : 5.1
Channel mode                            : 5.1
Channel layout                          : L R C LFE Ls Rs
Dialogue enhancement                    : Yes
  Enabled                                : Yes
  Max gain                               : 9 dB

Menu
ID                                       : 48 (0x30)
Menu ID                                  : 3 (0x3)
Duration                                 : 10 min 8 s
List                                     : 49 (0x31) (HEVC) / 50 (0x32) (AC-4) / 51 (0x33) (AC-4) / 57 (0x39) ()
 

dsperber

Member
Repeating my real question...

The problem here is that now available ATSC 3.0 broadcast channels are delivering 10-bit HEVC video in potential support of future broadcasts in 2160p and HDR. When attempting to use VideoRedo to edit any current ATSC 3.0 recording file (in MPG or TS form) there is a warning about "major recode required" at SAVE time because VRD only currently supports 8-bit.

Is support for 10-bit on the horizon, such that "fast frame copy" can be accomplished as with ATSC 1.0 recordings?
 

Dan203

Senior Developer
Staff member
It is something we're working on, but dealing with HDR is a bit more complex than it seems. There are multiple standards for HDR and we have to deal with converting between them and down to non-HDR, without messing up the color, when doing a recode to a non-HDR compatible video codec or resolution. It's taking a bit more time to work out than expected.
 

musicvid

Member
I appreciate the task at hand, Dan, being a beta tester for a major NLE suite.
May I suggest for the time being, that rather than trying to embrace the entire pool of HDR standards, that you concentrate on just the two major flavors, which are HDR10 PQ ST 2084 (Youtube and others), and 2020 REC 709 4:2:0 Limited (most ATSC 3 broadcasts). Those will cover the majority of basic consumer needs for the near future. Down the road, DolbyVision is something to look at, as the majority of new iPhones now shoot it. I know first hand that jumping through Dolby's licensure hoops is daunting.
 
Last edited:

Dan203

Senior Developer
Staff member
Dolby Vision licensing is probably out of the question. It's not just the hoops, it's the expense. We *might* offer it in Pro at some point, if there is demand, but doing it for consumer is probably not going to happen.
 

musicvid

Member
Methinks it is going to be very difficult for ffmpeg to come up with a DolbyVision alternative. It's the dynamic metadata that creates a moving target when the scene lighting shifts.
 

dsperber

Member
As was stated, support for perhaps eventual content from ATSC 3.0 years from now (including theoretically supported 2160p, HDR, DV, 7.1 and 7.1.4 audio, etc.) are totally unnecessary right now and probably for the next few years.

Just basic ATSC 3.0 support is what is needed, because that's what VRD has been very much used for up until now... ATSC 1.0 and OTA broadcast TV copy-freely recordings from WMC (i.e. WTV) and NextPVR (i.e. TS) and HDHomeRun (i.e. MPG). Right now it's just HEVC 10-bit video, and AC-4 5.1 audio, which needs to be addressed in some way.

Note that beta GitHub FFMPEG at this point is (in my opinion) unusable. It appears "intentionally crippled and/or defective" by the author (who would like to be paid for his further work). While it supports decoding of AC-4 and even transcoding into AC-3, it is not processing audio frequencies >12kHz so the sound is very bass-heavy. Also, there appears to be a channel mixup going from input AC-4 to output AC-3 (or output LPCM). It is putting out 5.1 (side) audio that appears to be in the channel sequence of L, R, LS, RS, C, LFE. This is NOT the SMPTE standard of L, R, C, LFE, LS, RS.

So not only does it "sound bad" (i.e. almost no treble), but it also "sounds crazy" (because center-channel voice and dialog is coming out over your left shoulder).

I suspect free software AC-4 options may be non-existent. But I would gladly pay a reasonable price to Dolby for a usable licensed AC-4 codec product for Windows.

Note that there is right now one particular hardware-based AC-4 decoding method that produces "proper transcoded AC-3", and that is the Silicon Dust HDHR client app that runs on LG OLED TVs. LG has had built-in licensed proper AC-4 decoding for years, on all 2017 and newer models. Also, LG's 2021 and newer TVs also contain ATSC 1.0/3.0 tuners. If you configure the TV's ARC/eARC optical-HDMI output as "pass-through" then what gets sent out is not the original AC-4 (since today's AVRs don't support AC-4 decoding) but transcoded AC-3 (which is fully supported by today's AVRs).

The HDHR client app running on the LG OLED makes use of the TV's built-in AC-4 decoder in its play of both live and recorded ATSC 3.0 TV channels (via its own network-based Flex 4K ATSC tuner box), and the TV's ARC/eARC pass-through setting feeds the resulting transcoded AC-3 out over HDMI to the AVR. So you actually can listen to ATSC 3.0 channels with "real genuine 5.1 audio" via AC-3 5.1 to the AVR which is perfectly acceptable.

In theory, sending that same pass-through AC-3 out over OPTICAL to a PC sound card S/PDIF optical input for recording (as AC-3 5.1 MP4? by what software?) could theoretically allow re-muxing of the original HDHR DVR recording MPG file, substituting the complete original AC-4 audio channel with the complete replacement AC-3 MP4 recording, making it usable by today's software and hardware. It would be fantastic if VRD could accomplish this "audio track complete replacement", to swap out the original AC-4 and swap in the replacement AC-3... with whatever is needed to insure proper sync (i.e. to avoid lip-sync problem).

Then the remaining re-mux/editing problem would be support required for the 10-bit HEVC video in order to facilitate "fast frame copy" and avoid any total transcoding of video to 8-bit.

Quite the project, and not everybody owns an LG OLED TV and HDHR Flex-4K tuner and HDHR LG client app where this all starts.
 

musicvid

Member
But I would gladly pay a reasonable price to Dolby for a usable licensed AC-4 codec product for Windows.
That would be a nice wish, but the "reasonable" part isn't likely to happen. Major software developers are having their long-standing AC3 licenses pulled because they simply can't keep up with Dolby's shkreliesque practices.
 
Last edited:

Dan203

Senior Developer
Staff member
That would be a nice wish, but the "reasonable" part isn't likely to happen. Major software developers are having their long-standing AC3 licenses pulled because they simply can't keep up with Dolby's shkreliesque practices.
The patent for AC3 expired a couple years ago, so it's "free" now. DD Plus and TrueHD are still under patent though, so maybe you're thinking of those?
 

musicvid

Member
One of the software outfits I beta test for severed its ties with Dolby in 2016 I think, and went for a few years with no AC-3 import or export, much to the chagrin of its older dvd user base. It recently added the Microsoft libraries, but still no 5.1 encoding, which was called AC-3 Pro when we had it.

Thank goodness I kept my old software, which can run on Win 10, and has full AC-3 5.1 import and authoring.
They have flatly refused to consider DolbyVision, citing past contention. I actually have written a couple of custom LUTS for friends, who say they are pleased, but they are only good in stable studio lighting. Daylight is a rapidly moving target with DolbyVision. Maybe HDR10+, which I hear is quite good, will gain a market share.

Interesting to see what ffmpeg comes up with for AC-4. The anecdote that @dsperber shared actually sounds quite typical. Sorry to sound cynical.
 
Last edited:
Top Bottom