Tag Archives: HDR

Choosing the appropriate gamma for your video project

The previous post on the technical nature of V-LOG has stirred up quite a bit of unset among those people that advocate the use of it as a preferred gamma for video capture. In this post I will show some data point to help you make an informed decision based on what you are planning to shoot in your video project.

Basics of Display Gamma and Dynamic Range

First of all a bit of background on gamma curves. The standard video gamma is based on a correction factor of 0.45 as screen decode it with the reciprocal value 2.22.

Cinema gamma is historically based on a value of 1/2.6 as projectors decode with a gamma of 2.6.

Today most of our content is consumed on phones, monitors or Tv screens as well as of course cinemas but for the purpose of this post I will assume we do not have a real ambition to project in cinemas.

To give some ideas of the dynamic range of the display consider those values

Phone (HDR)9+
Computer Monitor10
Tv (1886 HDTV)11
HDR Tv13+
Projector16+
Typical Display Dynamic Range

It is important to understand how the content we produce will be consumed when we capture our source material as otherwise our video pipeline may be suboptimal.

Mobile phones and tablets are now the predominant platform to consume content and looking at the table above this means that in terms of dynamic range there is not a high requirement. In addition phones and computer monitors may also not be particularly accurate in terms of colour rendition.

HDR content, due to lack of widespread compatibility, is growing on mobile phones but remains a product for high end platforms such as HDR TVs and Projectors.

It follows that content that will be displayed at the best quality on the most common platforms has pretty limited requirements in terms of dynamic range and other qualities are perhaps more important such as sharpness, low amount of noise, colour rendition and delivery of what looks high contrast on a limited contrast medium.

A further obvious consideration is that standard rec709/sRGB video is limited to 10 stops of dynamic range in the display (contrast ratio 1000:1) while new TV sets aligned to BT.1886 can display 11 stops )(Contrast ratio 2000:1). So no matter how you acquire if you end up in rec709 the dynamic range is limited and it becomes more important to accurately capture tones and colors.

Gamma Curves for Capture

As explained capture gamma is the reciprocal of display gamma and therefore majority of cameras capture a standard video gamma (0.45) or in some cases an HDR gamma (logarithmic). I do not want this post to become a deep dive on HDR video of which I have written enough however to stay on course I want to compare traditional gamma (non linear) and log gamma.

In the following graph you see the bit codes output vs input of a standard video gamma (1/2.2) a cine gamma (1/2.6) and a log gamma (v-log).

Bit code mapping for 14 bits linear sensor data

In broad terms you can see that a video gamma produces an output of 3865 vs 16383 bits, a cinema gamma sets at 3166, while a Log gamma can take all 14 bits of data and still be within bit value 960.

It follows that to store the whole set of values read at 14 bits into a 10 bits container a standard gamma needs to do some scaling while a log gamma does not need scaling to fit into a 10 bits container. This also explains why exposure values in log are 2 stops higher than standard video for a 14 bit range, while for a 12 bit range the offset is one stop. As the meter is using a standard RGB gamma all values are rescaled back.

You notice that at no point here I have made references to dynamic range. The camera dynamic range is solely related to the maximum well capacity vs the read noise and it does not relate to the gamma curve being used, however the different compression of the gamma curve have an effect on how tones are mapped and on the perceived dynamic range.

Camera Dynamic Range vs Display Dynamic Range

The overall camera dynamic range influences what you can do with your content and if it is worthwhile to produce an HDR version or not.

If we compare the previous table of display dynamic range vs camera dynamic range and we focus on nominal values (SNR=1) and photographic (SNR=20) we can see what device we need for our purpose.

Camera TypeDRPDR (SNR=20)
Compact 12.99.8
MFT12.310.3
APSC1411.1
Full Frame1412.2
Dynamic Range by Sensor Type

We can see that if all we need to do is to output on a mobile device or a computer monitor smaller sensor are adequate, however for HDR production larger format are preferred. Obviously we can stretch SNR to lower values and this will upgrade the above table of 1 stops or so but not change our reasoning substantially.

Gamma curves vs Bit codes mapping

The various gamma curves have a different distribution of tones (bit values), in this table I compare a video gamma vs cinema a reduced 12 stops log and a full Vlog for a full frame sensor camera.

For the purpose of this comparison blacks are bit codes in the lowest 10%, Shadows are up to 18%, midtones up to 75%, highlights up to 90% and whites above. Blacks and whites do not have color information but just brightness while shadows, midtones and highlights contain respectively dark, medium and light hues.

Distribution of tones vs Gamma

A standard video gamma has over 45% of midtones, those are the colors and tones with intermediate values so produce softer tones. Shadows are just above 35% with highlights under 10% and blacks and whites around 5%.

If we look at a cinema gamma we can see that shadows are now predominant and very close to the midtones, highlights, whites and blacks are compressed.

V-LogL (12 stops DR 12 bit implementation) has the largest range in shadows, midtones are compressed around 50% compared to a video gamma, blacks are subtantially more than a video gamma, and while highlights are compressed, whites are super whites are greatly expanded.

Full VLog is dominated by whites that make 38% of the bit values, Shadows are at 32% with midtones now under 20% and highlights compressed. Blacks remain expanded.

Choosing a Gamma Curve for your Video Project

Our decision tree starts from the content which determines the device we need. Once we have a device capable of a given dynamic range we can make appropriate choices in terms of gamma curve.

Broadly speaking compact cameras and micro four thirds do not have enough device dynamic range at sufficient level of SNR to justify a high dynamic range gamma. There are some very specific exception where this may be worth it (Panasonic GH5s) but in general terms a standard MFT camera for photography should be limited to video or cinema gamma for optimal results as the dynamic range is limited and compression is not required.

If you own an MFT camera your choice is between a video gamma and a cinema gamma. Depending on the look you want to achieve you may choose one or the other. Video gamma has generally more contrast (more blacks and highlights and whites) while Cine gamma has a balance between midtones and shadows but not strong blacks and whites giving overall a softer look.

If you own a full frame or apsc camera you have more options which means you need to think more about the gamma curve to be used. HDR content requires a log curve you can then decide to use a cinema or video gamma if you do not want to output HDR or want to achieve a different look. It is important to note that log gamma have lots of bit values in whites and super whites and those do not exist in many typical scenes.

Scene vs Dynamic Range

While the current effort of camera manufacturers is to promote high dynamic range the reality is that in most cinematography situation you use devices that reduce contrast and therefore dynamic range (think about pro mist filters).

The DR of a scene can be evaluated looking at the histogram. This is of course influenced by the gamma curve so it is important to do this evaluation taking a photograph not video.

The following are example of scenes with the underlying histogram.

High Dynamic Range scene note the shape of the histogram with peaks on darks and lights
indoor scene with mostly midtones
Low contrast portrait despite the light background
Underwater landscape that does not have as much DR as you would think
Moth image predominant in midtones
Outdoor image with low dynamic range
Typical indoor party scene with flash does not have significant dynamic range
The same portrait with a cine gamma sees enhanced shadows and lighter overall image but with bright tones subdued

It may be useful to see the effect of LOG using the LUTs in photoshop on the raw data

Original image
Vlog image
Vlog + LUT back to Rec709

The example above shows that a significant number of midtones have been lost in the conversion with no DR benefit as the scene essentially lacked it.

Conclusion

For underwater video purposes as the water reduces contrast and smooths highlights I would not recommend shooting log or HDR with the exception of very specific scenarios. Likewise if I am shooting a v(ideo)log or an interview there is no requirement for extra dynamic range and log compression is not required.

Outdoor scenes especially in bright conditions, snow, are appropriate for HDR and should be shot with a log format assuming of course the luminance of the scene is not being reduced with ND filters or similar.

Events like weddings can have challenging conditions with a mix of low contrast indoor and bright outdoors with the bride typically dressed in white so in effect those can be very demanding on the equipment but you need to bear in mind that if your delivery format is just HD video the benefit of log gamma are greatly reduced and extensive work may be required to bring colours back in check, always account for the limitations of your equipment as well.

do you need raw video?

We are finally there. Thanks to smaller companies that are keen to get a share of the market we now have at least two cameras with MFT sensor that are able to produce RAW video.

RAW Video and RED

It has been RED to patent the original algorithm to compress raw video data straight out of the sensor before the demosaicing process. Apple tried to circumvent the patent with their ProRes RAW but lost in court the legal battle and now has to pay licenses to Red. Coverage is here.

So RED is the only company that has this science, to avoid paying royalties Blackmagic Design developed an algorithm that uses data taken from a step of the video pipeline after demosaic for their BRAW.

I do not want to discuss if BRAW is better than RedCode or ProRes RAW however with a background in photography I only consider RAW what is straight out of the sensor Analag Digital Converter so for me RAW is RedCode or ProRes RAW and not BMRAW.

How big is RAW Video

If you are a photographer you know that a RAW image data file is roughly the same size in megabytes than the megapixels of your camera.

How is that possible I have a 20 Megapixel camera and the RAW file is only a bit more than 20 megabytes? My Panasonic RW2 files are 24.2 MB without fail out of 20.89 Megapixels so on average 9.26 bits per pixel. Why don’t we have the full 12 bits per pixel and therefore a 31 MB file? Well cameras are made of a grid of pixels that are monochromatic so each pixel is either red, green or blue. In each 2×2 matrix there are 2 green pixels, 1 red and 1 blue pixel. Through a series of steps of which on is to decode this mosaic into an image (demosaic) we rebuild an RGB image for display.

Each one of our camera pixels will not have the full 4096 possible tones, measures from DxoMark suggest that the Sony IMX272AQK only resolves 24 bits colours in total and 9 bits of grey tones. So this is why a lossless raw files is only 24.2 MB. This means that an 8K frame video in RAW would be 9.25 MB and therefore a 24 fps RAW video stream would be 222 MB/s or 1,776 Mb/s if we had equivalent compression efficiency. After chroma subsampling to 422 this would become 1184 Mb/s.

Cameras like the ZCam E2 or the BMPCC4K that can record ProRes 422 HQ approach those bitrates and can be considered virtually lossless.

But now we have ProRes RAW so what changes? The CEO of ZCAM has posted an example of a 50 fps ProRes RAW HQ files and this has a bitrate of 2255 Mb/s if this was 24 fps it would be 1082 Mb/s so we can see how my maths are actually stacking up nicely.

Those bit rates are out of reach of almost all memory card so an SSD drive support is required and this is where Atomos comes into the picture.

Atomos have decided to adopt ProRes RAW and currently offer support for Nikon, Panasonic and Zcam selected model.

ProRes RAW workflow

So with the ProRes RAW file at hand I wanted to test the workflow in Final Cut Pro X. Being an Apple codec all works very well however we encounter a number of issues that photographers have resolved a long time ago.

The first one is that RAW has more dynamic range than your SDR delivery space, this also happens with photos however programs work in larger RGB spaces like ProPhotoRGB at 16 bits and using tone mapping you can edit your images and then bring them back to an 8 bit jpeg that is not as good as the RAW file but is in most cases fine for everyone.

Video NLE are not in the same league of photo raw editors and usually deal with a signal that is already video is not raw data. So the moment you drop your ProRes RAW clip on a SDR timeline it clips as you would expect. A lot of work is required to bring back clips into an SDR space and this is not the purpose of this post.

To avoid big issues I decided to work on an HDR timeline in PQ so that with a super wide gamut and gamma there were no clipping issues. The footage drops perfectly into the timeline without any work required to confirm which is brilliant. So RAW for HDR is definitely the way forward.

ProRes RAW vs LOG

My camera does not have ProRes RAW so I wanted to understand what is lost going through LOG compression? For cameras that have an analog gain on sensor there is no concept of base ISO fixed like it happens on Red or ARRI cameras. Our little cameras have a programmable gain amplifier and as gain goes up DR drops. So the first bad news is that by using LOG you will lose DR from RAW sensors.

This graph shows that on the Panasonic GH5 there is a loss of 1 Ev from ISO 100 to 400 but still we have our 11.3 Ev minimum to play with. I am not interested in the whole DR but I just want to confirm that for those cameras that have more DR than their ADC allows you will have a loss with LOG as this needs gain and gain means clipping sooner.

Panasonic GH5 full resolution 20.9 MPixels DR

What is very interesting is that net of this the ProRes RAW file allowed me to test how good is LOG compression. So in this clip I have :

  1. RAW video unprocessed
  2. RAW video processed using Panasonic LOG
  3. RAW video processed using Canon LOG
  4. RAW video processed using Sony LOG

In this example the ZCAM E2 has a maximum dynamic range of 11.9 Ev (log2(3895)) from Sony IMX299CJK datasheet. As the camera has less DR than the maximum limit of the ADC there is likely to be no loss.

We can see that there are no visible differences between the various log processing options. This confirms that log footage is an effective way to compress dynamic range in a smaller bit depth space (12->10 bits) for MFT sensors.

The same ProRes RAW files processed using log from Panasonic, Canon and Sony shows no visual difference

Final Cut Pro gives you the option to go directly to RAW or go through LOG, this is because all your log based workflow and LUT would continue to work. I can confirm this approach is sound as there is no deterioration that I can see.

Is ProRes RAW worth it?

Now that we know that log compression is effective the question is do I need it? And the answer is it depends…

Going back to our ProRes RAW 1082 Mb/s once 422 subsampling is applied this drops to 721 Mb/s this is pretty much identical to ProRes 422 HQ nominal bit rate of 707 Mb/s. So if you have a Zcam and record ProRes RAW or ProRes 422 HQ you should not be able to see any difference. I can confirm that I have compressed such footage in ProRes 422 HQ and I could not see any difference at all.

However typically with photos a RAW files can hold heavy modifications while a JPEG cannot. We are used processing ProRes and there is no doubt that ProRes 422 HQ can take a lot of beating. In my empirical tests I can see that Final Cut Pro X is very efficient manipulating ProRes RAW files and in terms of holding modifications I cannot see that this codec provides a benefit but this may be due to the lack of capability of FCPX.

For reference Panasonic AVC Intra 422 is identical in terms of quality to ProRes 422 HQ though harder to process, and much harder to process than ProRes RAW.

Conclusion

If you have already a high quality output from your camera such as ProRes 422 HQ or Panasonic AVCI 400 Mbps with the tools at our disposal there is not a lot of difference at least for an MFT sensor. This may have to do with the fact that the sensor DR and colour depth is anyway limited and therefore log compression is effective to the point that ProRes RAW does not appear to make a difference, however there is no doubt that if you have a more capable camera, there is more valuable data there and this may be well worth it.

I am currently looking for Panasonic S1H ProRes RAW files. Atomos only supports 12 bits so the DR of the camera will be capped as RAW is linearly encoded. However SNR will he higher and the camera will have more tones and colors resulting in superior overall image quality, someone calls this incorrectly usable DR but is just image quality. it will be interesting to see if AVCI 10 bits and log is more effective than ProRes RAW 12 bits.

The definitive guide to hdr with the panasonic gh5/s1 in final cut pro x

First of all the requirements for HDR at home are:

  1. Log or HLG footage
  2. Final Cut Pro X 10.4.8
  3. Mac OS Catalina 10.15.4
  4. HDR-10 Monitor with 10 bit gamut

It is possible to work with a non HDR-10 monitor using scopes but is not ideal and only acceptable for HLG and in any case 10 bits is a must.

Recommended reading: https://images.apple.com/final-cut-pro/docs/Working_with_Wide_Color_Gamut_and_High_Dynamic_Range_in_Final_Cut_Pro_X.pdf

HDR Footage

In order to product HDR clips you need HDR footage. This comes in two forms:

  1. Log footage
  2. HLG

Cameras have been shooting HDR since years the issue has been that no consumer operating system or display were capable of displaying it. The situation has changed as Windows 10 and Mac Os now have HDR-10 support. This is limited for example on Mac Os there is no browser support but the Tv app is supported, while on windows you can watch HDR-10 videos on YouTube.

You need to have in mind your target format because Log and HLG are not actually interchangeable. HLG today is really only Tv sets and some smartphones, HDR-10 instead is growing in computer support and is more widely supported. Both are royalty free. This post is not about what is the best standard is just about producing some HDR content.

The process is almost identical but there are some significant differences downstream.

Let me explain why this graph produced using the outstanding online application LutCalc show the output input relationship of V-LOG against a standard display gamma for rec709.

V-LOG -> PQ

Stop diagram V-LOG vs Rec709

Looking at the stop diagram we can appreciate that the curves are not only different but a lot of values differ substantially and this is why we need to use a LUT.

Once we apply a LUT the relationship between V-LOG and Rec709 is clearly not linear and only a small parts of bits fit into the target space.

Output vs Input diagram for V-LOG and Rec709

We can see that V-Log fills Rec709 with just a bit more than 60% IRE so there will need to be a lot of squeezing to be done to fit it back in and this is the reason why many people struggle with V-Log and the reason why I do not use V-Log for SDR content.

However the situation changes if we use V-Log for HDR specifically PQ.

Stop Table V-Log to PQ

You can see that net of an offset the curves are almost identical in shape.

This is more apparent looking at the LUT in / out.

LUT in/Out V-Log to Rec2100 PQ

With the exception of the initial part that for V-Log is linear while PQ is fully logarithmic the curve is almost a straight line. As PQ is a larger space than that V-Log can produce on a consumer camera we do not have issues of squeezing bits in as PQ accommodates all bits just fine.

HLG

Similar to V-LOG HLG does not have a great fit into an SDR space.

Stop Table HLG to Rec709

The situation becomes apparent looking at the In/Out Lutted values.

HLG to Rec709

We can see that as HLG is also a log gamma with a different ramp up 100% is achieved with even less bits that V-Log.

So really in pure mathematical terms the fit of log spaces into Rec709 is not a great idea and should be avoided. Note with the arrival of RAW video we still lack editors capable to work in 16 bit depth space like photo editors do and currently all processes go through LOG because they need to fit into a 10/12 bits working space.

It is also a bad idea to use V-Log for HLG due to the difference of the log curves.

V-Log vs HLG

And the graph demonstrates what I said at the beginning. You need to decide at the outset your output and stick to a compatible format.

Importing Footage in Final Cut Pro X 10.4.8

Once we have HLG or LOG footage we need to import it into a Wide Gamut Library, make sure you check this because SDR is default in FCPX.

Library Settings

HLG footage will not require any processing, but LUTs have to be applied to V-LOG as this is different from any Rec2100 target spaces.

The most convenient way is to go into Organise workspace select all clips than press the i button and select General. Apply the Panasonic V-Log LUT to all clips.

Organise View the LUT option is not available in the Basic view so make sure you select General

Creating a Project

Once all files have been handled as required we create our HDR-10 project which in final cut means Rec2020 PQ.

For HLG project change colour space to HLG

The following screenshots demonstrate the effect of the LUT on footage on a PQ timeline.

LUT not applied footage looks dim as values are limited to 80%

With the LUT applied the V-LOG is expanded in the PQ space and the colours and tones come back.

LUTed clip on PQ timeline

We can see the brightness of the scene is approaching 1000 nits and looks exactly we we experienced it.

Once all edits are finished and just as last step we add the HDR Tools to limit peak brightness to 1000 Nits which is a requirement of YouTube and most consumer displays. The Scope flex slightly with an automatic highlight roll-off.

Exporting the Project

I have been using Panasonic AVCI 400 mbps so I will export a master file using ProRes422 HQ if you use a lower bitrate ProRes 422 may be sufficient but don’t go lower as it won’t be HDR anymore.

Export in ProRes 422 HQ

YouTube and other devices use default settings for HDR-10 metadata so do not fill the mastering display nor content information it is not required and you would not know how to fill it correctly with exception of peak brightness.

Converting for YouTube

I use the free program handbrake and YouTube guidelines for upload to produce a compatible files. It is ESSENTIAL to produce an mp4 file otherwise your TV and YouTube may not be able to display HDR correctly avoid any other format at all costs.

The finished product can be seen here

Home HDR Video HDR-10
HLG Documentary style footage

SDR version from HDR master

There are residual issues with this process one is the production of an SDR version. This currently works much better for HLG than HDR-10 which is interesting because HLG is unsupported on any computer so if you produce HDR HLG you are effectively giving something decent to both audiences.

For HDR-10 YouTube applies their own one fits all LUT and the results can be really bad. You may experience oversaturated colours in some cases, dark footage in others, and some clips may look totally fine.

At professional level you would produce a separate SDR grade however it is possible to improve the quality of YouTube conversion using specific techniques I will cover in a separate post.

Final Remarks

Grading in HDR is not widely supported the only tools available are scopes and Tone Mapping of your display. There is no concept of correct exposure for skin tones, in one scene those have a certain brightness and in another this changes again because this is not a 0-100% relative scale but goes with absolute values.

If you invested in a series of cinema LUT you will find none of them work and compresses the signal to under 100 nits. So there is less headroom for looks. There are other things you can do to give some vintage look like adding grain but you need to be careful as the incredible brightness of the footage and the details of 10 bits means if you push it up too much it looks a mess. Currently I am avoiding adding film grain and if I add it I blend it to 10%-20%.

One thing that is interesting is that Log footage in PQ does have a nice feel to it despite the incredible contrast. After all Log is a way to emulate film specifically Cineon, this is true for almost all log formats. Then you would have the different characteristics of each film stock, this is now our camera sensor and because most of them are made by Sony or Canon the clips tend to look very similar to each other nowadays. So if you want to have something different you need to step in the world of Red or ARRI but this is not in the scope of what I am writing here and what you my readers are interested in.

Am keeping a playlist with all my HDR experiments here and I will keep adding to it.

YouTube HDR Playlist

If you find this useful please donate using the button on the side and I will have a drink on you…Cheers!

HDR or SDR with the Panasonic GH5

As you have read, I have been at the forefront of HDR use at home. I have a total of 5 devices with HDR certification of which 2 supporting all standards all the way to Dolby Vision and 3 supporting at least HLG and HDR-10. The consumption of content is composed for most of Netflix or Amazon originals and occasional BBC HLG broadcasts that are streamed concurrently to live programs. So, it is fair to say I have some practical experience on the subject and two years ago I started writing about shooting HLG with the GH5. This was mostly limited by lack of editing capabilities on the display side, but recently Mac OS 10.15.4 has brought HDR-10 support that means you can see HDR signal on a compatible HDMI or DisplayPort device. This is not HLG but there are ways around it as I wrote in a recent post. This post makes some considerations on the issues of shooting HDR and why as of 2020 shooting SDR Rec709 with your Panasonic GH5 is still my preferred option for underwater video and not.

Real vs Theoretical Dynamic Range

You will recall the schematic of a digital camera from a previous post.

This was presented to discuss dual gain circuits but if you ignore the two gain circuits it remains valid. In this post we will focus on the ADC which stands for Analog to Digital Converter. Contemporary cameras have 12- and 14-bits ADC, typically 14 bits ADC are a prerogative of DSLR cameras or high-end cameras. If we want to simplify to the extremes the signal arriving to the ADC will be digitalised on a 12- or 14-bits scale. In the case of the GH5 we have a 12-bits ADC, it is unclear if the GH5s has a 14-bits ADC despite producing 14-bits RAW, for the purpose of this post I will ignore this possibility and focus on 12-bits ADC.

12-bits means you have 4096 levels of signal for each RGB channel this effectively means the dynamic range limit of the camera is 12 Ev as this is defined as Log10(4096)/Log10(2)=12. Stop wait a minute how is that possible? I have references that the Panasonic GH5 dynamic range is 13 Ev how did this become 12?

Firstly, we need to ignore the effect of oversampling and focus on 1:1 pixel ratio and therefore look at the Screen diagram that shows just a bit more than 12 Ev. We then have to look at how DxOMark measures dynamic range this is explained here. In real life we will not be shooting a grey scale but a coloured scene, so unless you are taking pictures of the moon you will not get much more than 12 stops in any scenarios as the colours will eat the data.

This was for what concerns RAW sensor data before de-mosaicing and digital signal processing that will further deteriorate DR when the signal is converted down to 10-bits even if a nonlinear gamma curve is put in place. We do not know what is really the useable DR of the GH5 but Panasonic statement when V-LOG was announced referenced 12 stops dynamic range using a logarithmic curve so we can safely conclude that the best case is 12 stops when a log curve is used and 10 for a gamma curve with a constant correction factor. Again, it is worth stressing that the 12 stops DR is the absolute maximum at the camera setting with 0 gain applied aka base or native ISO which for the GH5 is 200 corresponding to 400 in log modes.

Shooting HLG vs SDR

Shooting HLG with the GH5 or any other prosumer device is not easy.

The first key issue in shooting HLG is the lack of monitoring capabilities on the internal LCD and on external monitors. Let’s start with the internal monitor that is not capable to display HLG signals and relies on two modes:

  • Mode 1 : priorities the highlights wherever they are
  • Mode 2 prioritise the subject i.e. center of the frame

In essence you are not able to see what you get during the shot. Furthermore, when you set zebra to 90% the camera will be rarely reaching this value. You need to rely on the waveform, that is not user friendly in an underwater scene, or on the exposure meter. If you have a monitor you will find if you are carefully in the spec that the screens are rec709 so will not display the HLG gamma while they will correctly record the colour gamut. https://www.atomos.com/ninjav : if you read under HDR monitoring gamma you see BT.2020 that is not HDR is SDR. So you encounter the same issues albeit on a much brighter 1000 nits display that you have on the LCD and you need to either adapt to the different values of the waveform or trust the exposure meter and zebra that as we have said are not very useful as it take a lot to clip. On the other hand if you shoot an SDR format the LCD and external monitor will show exactly what you are going to get except you shoot in V-LOG, in this case the waveform and the zebra will need to be adjusted to consider that VLOG absolute max is 80% and 90% white is 60%. Once you apply a monitor LUT however, you will see exactly what you are going to get on the internal or external display.

Editing HLG vs SDR

In the editing phase you will be faced with similar challenges although as we have seen there are workarounds to edit HLG if you wish so. A practical consideration is around contrast ratio. Despite all claims that SDR is just 6 stops I have actually dug out the BT.709, BT.1886, BT.2100 recommendations and I this is what I have found.

 Contrast RatioMax BrightnessMin BrightnessAnalog DR
BT.70910001000.19.97
BT.188620001000.0510.97
BT.210020000010000.00517.61
Specifications of ITU display standards

In essence Rec709 has a contrast ratio of 1000 which means 9.97 Stops of DR and already allows for 8- and 10-bits colour. BT.1886 was issued to consider CRT screens no longer exist and this means that the DR goes to 10.97 stops. BT.2100 has a contrast ratio of 200000:1 or 17.61 stops of DR.

StandardContrast RatioMax BrightnessMin BrightnessAnalog DR
HDR40010004000.49.97
HDR50050005000.112.29
HDR60060006000.112.55
HDR10002000010000.0514.29
HDR14007000014000.0216.10
400 TB8000004000.000519.61
500 TB10000005000.000519.93
DisplayHDR Performance Standards

Looking at HDR monitors you see that, with the exception of OLED screens, no consumer devices can meet BT.2100 standards; so even if you have an HDR monitor in most cases is falling short of BT.2100 recommendation.

Our GH5 is capable of a maximum 12 stops DR in V-Log and maybe a bit more in HLG however those values are far below BT.2100 recommendations and more in line with BT.1886 recommendation. If we look at DxOMark DR charts we see that at ISO 1600 nominal that is in effect just above 800 the DR has fallen below 10 Ev. Consider that this is engineering DR practically speaking you are getting your 12 stops just at ISO 200 and your real HDR range is limited to 200-400 ISO range this makes sense as those are the bright scenes. Consider that log photo styles start at ISO 400 but this really translates to ISO 200 on this chart as well as exposure values. Unless you are shooting at low ISO you will get limited DR improvement. Underwater is quite easy to be at higher ISO than 200 and even when you are at 200 unless you are shooting the surface the scene has limited DR anyway. Generally, 10 stops are more than adequate as this is what we get when we produce a Jpeg from a RAW file.

Viewing HDR

I think the final nail in the coffin arrives when we look where the content will be consumed.

StandardContrast RatioMax BrightnessMin BrightnessAnalog DR
IPS/Phones10003500.359.97
LED Tv40004000.111.97
OLED60000006000.000122.52
Typical Devices Performance

Phones have IPS screen with some exceptions and contrast ratio below 1000:1 and so do computer screens. If you share on YouTube you will know phones and computer constitute around 85% of playback devices. Tv are around 10% and a small part of those will be HDR. So other than your own home you will not find many HDR devices out there to give justice to your content.

10-bits vs 8 bits

It is best practice to shoot 10 bits and both SDR and HDR support 10 bits colour depth. For compatibility purposes SDR is delivered with 8 bits colour and HDR on 10 bits colour.

Looking at tonal range for RAW files on 8 Megapixels we see that the camera has 24 bits depth over RGB this means 8 bits per channel and 9 bits tonal range. Tonal range are grey levels so in short, the camera will not produce 10 bits colour bit will have more than 8 bits of grey tones which are helpful to counter banding but only at low ISO, so more useful for blue skies than for blue water. Considering that image for photo competitions are JPEGs and that nobody has felt the need for something more we can conclude that as long as we shot at high bitrate something as close to a raw format 8 bit for delivery are adequate.

Cases for HDR and Decision Tree

There are cases where shooting HLG can be meaningful those include snorkelling at the surface on bright days. You will not be going at depth so the footage will look good straight off the camera, likewise, for bright shots in the sun on the surface. But generally, the benefit will drop when the scene has limited DR or at higher ISO values where DR drops anyway.

What follows is my decision tree to choose between SDR and HDR and 10 bits vs 8 bits formats. I like my pictures and my videos to look better than life and I think editing adds value to the imaging although this is not an excuse for poor capture. There are circumstances where editing is less important, namely when the scene is amazing by itself and requires no extra help, or when I am looking at fast paced, documentary style scenes that do not benefit from editing. For the rest my preference remains for editing friendly formats and high bit rate 10 bits codec all intra. Recently  I have purchased the V-Log upgrade and I have not found difficult to use or expose so I have included this here as possible option.

The future of HDR

Except a cinema like setting with dark surrounding and low ambient light HDR mass consumption remains challenging. Yes, you can have high peak brightness but not high contrast ratio and this can be obtained with SDR for most already. There is a lot of noise in the cinema community at present because the PQ curve is hard to manage and the work in post processing is multiplied, clearly PQ is not a way forward for broadcasting and HLG will prevail thanks to the pioneering efforts of the BBC but the lack of monitoring and editing devices means HLG is not going to fit cine like scenarios and little productions. It could be a good fit for a zero-edit shooter someone that like to see the scene as it was.

Conclusion

When marketing myths and incorrect information is netted out we realise that our prosumer devices are very far away from what would be required to shoot, edit and consume HDR. Like many other things in digital imaging is much more important to focus on shooting techniques and how to make the most of what we have, instead of engaging on a quest for theoretical benefits that may not exist.

Producing and grading HDR content with the Panasonic GH5 in Final Cut Pro X

It has been almost two years from my first posts on HLG capture with the GH5 https://interceptor121.com/2018/06/15/setting-up-your-gh5-for-hlg-hdr-capture/ and last week Apple released Catalina 10.15.4 that now supports HDR-10 with compatible devices. Apple and in general computer are still not supporting HLG and it is unlikely this is ever going to happen as the gaming industry is following VESA DisplayHDR standard that is aligned to HDR-10.

After some initial experiments with GH5 and HLG HDR things have gone quiet and this is for two reasons:

  1. There are no affordable monitors that support HLG
  2. There has been lack of software support

While on the surface it looks like there is still no solution to those issues, in this post I will explain how to grade HLG footage in Final Cut Pro should you wish to do so. The situation is not that different on Windows and DaVinci Resolve that also only support HDR-10 monitors but I leave it to Resolve users to figure out. This tutorial is about final cut pro.

A word about Vlog

It is possible to use Vlog to create HDR content however VLOG is recorded as rec709 10 bits. Panasonic LUT and any other LUT are only mapping the VLOG gamma curve to Rec709 so your luminance and colours will be off.  It would be appropriate to have a VLOG to PQ LUT however I am not aware this exists. Surely Panasonic can create that but the VLOG LUT that comes with the camera is only for processing in Rec709. So, from our perspective we will ignore VLOG for HDR until such time we have a fully working LUT and clarity about the process.

Why is a bad idea to grade directly in HLG

There is a belief that HLG is a delivery format and it is not edit ready. While that may be true, the primary issue with HLG is that no consumer screens support BT.2020 colour space and the HLG gamma curve. Most display are plain sRGB and others support partially or fully DCI-P3 or the computer version Display P3. Although the white point is the same for all those colour spaces there is a different definition of what red, green and blue and therefore without taking into this into account, if you change a hue, the results will not be as expected. You may still white balance or match colours in HLG but you should not attempt anything more.

What do you need for grading HDR?

In order to successfully and correctly grade HDR footage on your computer you need the following:

  • HDR HLG footage
  • Editing software compatible with HDR-10 (Final Cut or DaVinci)
  • An HDR-10 10 bits monitor

If you want to produce and edit HDR content you must have compatible monitor let’s see how we identify one.

Finding an HDR-10 Monitor

HDR is highly unregulated when it comes to monitors, TVs have Ultra HD Premium Alliance and recently Vesa has introduced DisplayHDR standards https://displayhdr.org/ that are dedicated to display devices. So far, the Display HDR certification has been a prerogative of gaming monitors that have quick response time, high contrast but not necessarily high colour accuracy. We can use the certified list of monitors to find a consumer grade device that may be fit for our purpose: https://displayhdr.org/certified-products/

A DisplayHDR 1000 certified is equivalent to a PQ grading device as it has peak brightness of 1000 nits and minimum of 0.005 this is ideally what you want, but you can get by with an HDR-400 certified display as long as it supports wide colour gamut. In HDR terms wide gamut means covering the DCI-P3 colour space at least for 90% so we can use Vesa list to find a monitor that is HDR-10 compatible and has a decent colour accuracy. Even inside the HDR-400 category there are displays that are fit for purpose and reasonably priced. If you prefer a brand more orientated to professional design or imaging look for the usual suspects Eizo, Benq, and others but here it will be harder to find HDR support as usually those manufacturers are focussed on colour accuracy, so you may find a display covering 95% DCI-P3 but not necessarily producing a high brightness. As long as the device supports HDR-10 you are good to go.

I have a Benq PD2720U that is HDR-10 certified, has a maximum brightness of 350 nits and a minimum of 0.35, it covers 100% sRGB and REC709 and 95% DCI-P3, so is adequate for the task. It is worth nothing that a typical monitor with 350-400 nits brightness offers 10 stops of dynamic range.

In summary any of this will work if you do not have a professional grade monitor:

  • Look into Vesa list https://displayhdr.org/certified-products/ and identify a device that supports at least 90% DCI-P3, ideally HDR-1000 but less is ok too
  • Search professional display specifications for HDR-10 compatibility and 10 bits wide gamut > 90% DCI-P3

 

Final Cut Pro Steps

The easy way to have HDR ready content with the GH5 is to shoot with the HLG Photo Style. This produces clips that when analysed have the following characteristics with AVCI coded.

MediaInfo Details HLG 400 Mbps clip

Limited means that it is not using the full 10 bits range for brightness you do not need to worry about that.

With your material ready create a new library in Final Cut Pro that has a Wide Gamut and import your footage.

As we know Apple does not support HLG so when you look at the Luma scope you will see a traditional Rec709 IRE diagram. In addition, the ‘Tone Mapping Functionality’ will not work so you do not have a real idea of colour and brightness accuracy.

At this stage you have two options:

  1. Proceed in HLG and avoid grading
  2. Convert your material in PQ so that you can edit it

We will go on option 2 as we want to grade our footage.

Create a project with PQ gamut and enter your display information in the project properties. In my case the display has a minimum brightness of 0.35 nits and max of 350 and it has P3 primaries with a standard D65 white point. It is important to know those parameters to have a good editing experience otherwise the colours will be off. If you do not know your display parameters do some research. I have a Benq monitor that comes with a calibration certificate the information is right there. Apple screens are typically also P3 with D65 white point and you can find the maximum brightness in the specs. Usually around 500 nits for apple with minimum of 0.5 nits. Do not enter Rec2020 in the monitor information unless your monitor has native primaries in that space (there are almost none). Apple documentation tells you that if you do not know those values you can leave them blank, final cut pro will use the display information from colour sync and try a best match but this is far from ideal.

Monitor Metadata in the Project Properties

For the purpose of grading we will convert HLG to PQ using the HDR tools. The two variants of HDR have a different way to manage brightness so a conversion is required however the colour information is consistent between the two.

Please note that the maximum brightness value is typically 1000 Nits however there are not many displays out there that support this level of brightness, for the purpose of what we are going to do this is irrelevant so DO NOT change this value. Activate tone mapping accessible under the view pull down in the playback window this will adapt the footage to your display according to the parameters of the project without capping the scopes in the project.

Use HDR Tools to convert HLG to PQ

Finalising your project

When you have finished with your editing  you have two options:

  • Stay in PQ and produce an HDR-10 master
  • Delete all HDR tools HLG to PQ conversions and change back the project to HLG

If you produce an HDR-10 master you will need to edit twice for SDR: duplicate the project and apply the HDR tool from HLG to SDR or other LUT of your choice.

If you stay in HLG you will produce a single file but is likely that HDR will only be displayed on a narrower range of devices due to the lack of support of HLG in computers. The HLG clip will have correct grading as the corrections performed when the project was in PQ with tone mapping will survive the editing as HLG and PQ share the same colour mapping. The important thing is that you were able to see the effects of your grade.

Project back in HLG you can see how the RGB parade and the scope are back to IRE but all is exactly the same as with PQ

In my case I have an HLG TV so I produce only one file as I can’t be bothered doing the exercise two times.

The steps to produce your master file are identical to any other projects, I recommend creating a ProRes 422 HQ master and from there other formats using handbrake. If you change your project back to HLG you will get a warning about the master display you can ignore it.

Panasonic GH5 the gateway to 4K HDR Video

It has been a while I have been busy with some personal stuff and to be frank not much has been happening the Underwater Video or Still scene that was of interest to me until pretty much September 2017 when Panasonic released the 2.0 version of the DC-GH5 firmware.

The link to the firmware updates is here and here is link to the full PDF

The section we are interested is this one

4K HDR video recording

– [HLG] (Hybrid Log Gamma) is added to [Photo Style]. HDR (High Dynamic Range) is a mode to reproduce both bright part and dark part in an image, making it look just as human eyes see. The camera records video with a designated gamma curve compatible with ITU-R BT.2100, and you can now choose Hybrid Log Gamma (HLG) in [Photo Style].
– A low-bit-rate recording mode 4K HEVC for HLG was added. This enables playback on AV equipment compatible with the HEVC compression format, such as Panasonic 4K HDR TVs.

 

In the PDF we read this additional information

Recording of HDR (High Dynamic Range) motion pictures in HLG (Hybrid Log Gamma) format is now supported. With this format, you can record bright images susceptible to overexposure with more natural colors than is possible with conventional formats.
• “HLG” is a standardized HDR video format that converts and expands the dynamic range of

compressed high-luminance image data on a supported device.
• The monitor and viewfinder of the camera are not capable of displaying images in HLG format. • HDR images appear darker on devices that do not support the HLG format.

If you have headache to understand what is HLG and how it differs from other HDR formats search on the internet the following short document from BBC may help.

 

Why does HDR matter and what can I do to record HDR?

HDR matters because the human eye is more sensible to contrast and colours than resolution. In majority of cases if you do a blind test of UHD 4K footage to anyone sitting at the recommended seating distance for cinema at home (look up SMPTE seating distance) nobody can actually see differences between HD and UHD and this is because the ability of the human eye to resolve pixels is limited by our visual acuity. So why does a YouTube video in 4K looks better than HD? Simply because the bitrate is higher and this means the quality is higher but if you look at your own 4K footage at home and scale it down to HD with good quality you are not able to tell the difference.

However try now some HDR material if you have Amazon or Netflix or even on YouTube and have a compatible Tv set the difference to normal content is staggering. This is because a normal REC709 (the standard for HDTV) display has 6 stops of dynamic range. There are no official figures of how many stops is REC2020 for HDR but good Tv sets are capable of around 10 stops. Now that is a big difference especially on the bright part of the image which is where the HDR displays really excel.

So HDR does matter more than 4K UHD in fact Sony has just produced an HD set HDR capable not sure there will be many of those but this gives an idea.

So how do I record HDR and why there are no HDR certified cameras but only certified displays? The answer is pretty easy you need a camera that offers more than 10 stops dynamic range in video and that is where our Panasonic DC-GH5 comes into the picture.

The camera is capable of 13 stops dynamic range but what is more important it can produce around 8 eV even at ISO 12800 so in essence the camera is well above what is required for REC709 and it can get to around ISO 3200 and still produce nearly 10 stops which is great. So if you have a Panasonic GH5 you have a sensor that is capable of producing the required dynamic range.

However this is not sufficient the camera needs to be able to product at least 10 bit colour depth, an image resolution of 3840×2160 and a colour palette aligned to BT.2020 specifications (wide colour gamut) and finally have the appropriate transfer function to deliver the signal. Majority of commercial cameras are not capable to deliver 10 bit colour depth and do not have a compatible transfer function. The GH4 predecessor of the GH5 was already capable of delivering 10 bit colour to an external recorder using the HDMI output now the GH5 makes this available in camera for recording on SD card at bit rate of 150 mbps IPB and 400 mbps all intra H.264.

HLG vs VLOG and why it matters

Before the firmware 2.0 the only way to produce HDR out of the GH5 was to buy the VLOG upgrade and then attempt to use the recording feature of the camera or an external recorder with Prores 422 or 422 HQ and then take a trip into grading. The reality is that once you crammed the VLOG dynamic range into a REC709 format you essentially limit yourself to 6 stops and therefore waste majority of your effort. So in order to extract real dynamic range you need to output in HDR that is possible but not so easy to do. In practical terms unless you are producing a documentary you will soon give up using vlog underwater because it is just too much work. Here now comes HLG so what is good about HLG and why this can make a real difference here my list:

  1. It is free you don’t need to pay for an upgrade
  2. It is backward compatible with standard dynamic range
  3. Requires a less intensive workflow compared to Vlog
  4. You can produce a decent file recording in camera without external recorders
  5. If you do have an HDR capable external recorder than it shows things are they are and not the washed out version of vlog

This is just my personal list of reasons there may be more.

How to set the Panasonic GH5 to record in HLG and UHD

There are 3 settings that give you the possibility to record HLG HDR compatible files, two are available in MP4 (LPCM) and MOV and one in MP4 (HEVC).

MP4 (LPCM) and MOV

P1040940
400 mbps ALL Intra

P1040941
150 Mbps LongGOP

There are not many cards that can work at 400 mbps and they are expensive. In any case do not assume that 400 mbps ALL-intra is better than longGOP as longGOP is fairly efficient and if you look into the various YouTube videos you will see it is very hard to see any difference unless you do pixel peeping.

MP4 (HEVC)

There is also a convenient low bit rate format available that uses HEVC in camera you can access it selecting MP4 (HEVC) in the REC FORMAT menu

P1040942

You then have this option available

P1040943

Tests show that when done real time HEVC produces files 50% of H.264 so the bitrate makes sense however unless you want to play the files directly on your Tv this is not such a good choice as the files are too hard to edit with any computer as there are no H265 hardware accelerated display widely available.

So the format of choice is as follows:

REC FORMAT: MP4 (LPCM)

REC QUALITY 422/10 bit/LongGOP 150 mbps

Please note the format at 50/60p does not give HLG in camera only the HDMI output is HLG compatible this is because the output is 10 bit as required by HLG. 8 bit colour does NOT qualify for UHD HDR so if you use this format in camera the HLG photo style will be greyed out.

How to convert 150 mbps HLG LongGOP files

At time of writing only programs like VLC play the H264 10 bit files produced by the GH5 and on my computer they play badly. So when you will go and edit those files your NLE program will most likely convert them into a format that is easier to digest and still supports 422 10 bit colour, this format is Apple Prores.

Unfortunately unless you have a paid software the files will only be unreadable if you use DaVinci Resolve or iMovie. However you can use a command line encoder like ffmpeg and convert all those files for free.

The command once you have the executable and you have the files in the right directory is something like this:

ffmpeg -i GH5file.mp4  -c:v prores -c:a copy GH5file.mov

This tells ffmpeg to transcode the video to prores 422 and to just copy the file as is (prores uses linear PCM for audio) here you notice that the source file has mp4 and the destination mov that is the default for prores and the reason to set your GH5 to record mp4 and not mov.

I have developed an automator script that is able to convert all selected files in the memory card and place them in a location of choice on the hard disk or else.

automator

Ffmpeg will convert using prores 422 that in my case bumped the files from 150mps to 474 mbps as prores is an all intra codec this is reasonable and there is no reason to use higher version like 422 HQ starting from a 150 mbps longGOP. Obviously if you use an external recorder feel free to use the higher bitrate available.

How to produce your HDR video clip for free

DaVinci Resolve is able to use your prores files converted from the GH5 and produce HDR compatible files.

You need to go into project settings and select colour management and change your settings as shown here

DaVinciProjectSettings

Colour Space Rec.2020 and Gamma Rec.2100 HLG will produce a file that on a compatible Tv will trigger HDR.

Now the bad news if you don’t have an HDR monitor it is very hard to grade properly on a standard monitor although you can look at luminance curves and chroma curves to see if you have situation of bad exposure or saturation this can be tricky with underwater footage so the trick is to try and get it right in camera.

Of particular interest is the HLG View Assist setting on the GH5: as the screen of the camera is not HDR this should help exposing the scene properly but I have to yet determine what is the setting that I prefer.

Well that is all for now…!