Understanding Log-Format Recording

31Share

Once touted as a headlining feature on only the highest grade digital video/cinema cameras, such as the Sony CineAlta line, log (logarithmic) recording has become a mainstay on more affordable professional products, such as the Canon EOS-C series, and more accessible through prosumer products like the Sony α-series mirrorless cameras. One of the reasons log recording has become so prevalent is that it is often associated with the idea of better image quality. In a nutshell, recording using a log picture profile or curve preserves more of your image’s dynamic range and tonality by redistributing the digital exposure value representations over the entire value set using a preset logarithmic function. If you understood that sentence and the implications, you probably don’t need to read the rest of this article. So, for the rest of us who aren’t as familiar with the geek language I just spewed forth, what does this mean in plain English? Let’s have a deeper look.

The Basics

"The problem arises with the realization that the exposure values with which we measure light are not linear."

To understand log recording, we have to observe how video information is traditionally encoded on most common camcorders, DSLRs, mirrorless cameras, and even cell phones. Light is focused by your camera’s lens onto your camera’s image sensor. The sensor then translates the amount of light hitting every individual pixel into an electric voltage. More light equals higher voltage output from the sensor. The camera’s A/D (analog to digital) converters translate those voltages into digital exposure values, which get encoded and compressed into the video file that’s recorded onto the camera’s memory. Now here’s where things can get a little complicated, so bear with me. (For the sake of simplicity, I won’t be discussing raw video recording and the debayering process here, since it has its own logarithmic properties.) If your video—like most video—is not recorded using a log picture profile, chances are the exposure is being recorded in a linear fashion. Video that is recorded or encoded this way looks nice on your average computer monitor/television and will have a good amount of visible contrast from the blacks to whites. This means that with little or no processing, that video will look reasonably good on almost any display device, provided that the exposure and white balance settings were correct while recording was taking place.

Who Cares About Log?

So, if your video already works for almost any screen with no extra effort involved, who cares about log? Well, recording video using a linear picture profile is fine for many situations; however, it is not without some serious limitations. To understand these limitations, let’s refer back to the camera imaging process I discussed above, particularly the last bit regarding the A/D conversion of the voltage coming from the sensor. It is in this crucial step that a picture profile—also known as an exposure curve—can be applied. A linear recording is called linear because no exposure curve is applied at all. The problem arises with the realization that the exposure values with which we measure light are not linear. An exposure “stop” represents a doubling or halving of the actual light level, not an increase by some arbitrary linear value on a scale. You could, in fact, say exposure values are themselves logarithmic!

An Even Closer Look

If the dichotomy has not yet presented itself, let’s delve a little further. In an 8-bit binary video file, like those recorded by most consumer and prosumer gear, there are 256 (28) possible exposure representations available across the entire spectrum, starting from absolute black to super white. Pixels that are absolute black (no exposure recorded) are given the lowest value of 0. Super-white pixels (think blown-out highlights) are given the highest value of 255. Everything else occupies the 254 values in between. So, working backward, using the camera example: in a linear recording, the voltages coming from each pixel off the camera’s sensor are assigned one of those 256 values, based on voltage level, which is determined by the actual exposure level of the image focused by the lens. Now, since exposure values are logarithmic, the voltage levels being output by the sensor to the A/D converter reflect that. And when those voltages arrive at the A/D converter, it records them using a linear function. The downside is that this method top-loads the 256 values, and the dynamic range won’t be equally represented across the 8 bits. It’s a little easier to understand visually, so take a look at the graph below.

The X axis shows a hypothetical image’s entire exposure range split into 8 values. For the sake of simplicity, let’s refer to this image as having 8 stops of dynamic range (regardless of the dynamic range of your camera, this principle should remain the same). The Y axis shows the assigned value of a given brightness relative to each of the 8 bits; hence, the values are expressed as binary exponents. With a linear recording, the points showing where each of the stops is represented on this scale form a straight line, going from 0 all the way to 255. But wait. Look at the numerical difference between stops 7 and 8. That one stop gets a whole 128 bits of representation, half of the entire bit depth of the image! The stop below that gets 64 bits, and the stop below that is rationed just 32 bits, and so forth. This leaves the lower four stops (half) of the exposure range, where all the shadow information in your images lies, with just a sixteenth of the entire bit depth of your image. What if you want to recover or boost your shadows during grading? Good luck. It will just become a mess. The problem is twofold, because if you overexpose your image to compensate for this top-loading and get details in those shadow areas, almost half of your bit depth is being dedicated toward highlights that are getting blown out. Log recording aims to solve all of this.

The Solution

Log recording to the rescue! Now that we understand standard linear recording, it will be easier to understand how log recording works. Going back, yet again, to your camera’s A/D conversion—instead of the A/D converter linearly assigning values, thus giving the previous graph a straight line, it applies a curve to the exposure before the image is compressed and recorded. This curve shifts the lower and middle parts of the dynamic range into the upper part of the dynamic range, where most of the bit depth is dedicated. If a log image were to be plotted on a graph, it would look something like this.

This shift has the obvious side effect of washing out the image when viewed on a conventional monitor. Have a look at these frame grabs below.

Linear low image S-log2 image

Both of these frame grabs are from files recorded by my Sony α7S. Both were recorded at the same time of day using the Zeiss Loxia 35mm f/2 set to f/22. The image on the left was recorded with a linear picture style at ISO 400, and the image on the right was recorded using the S-Log2 exposure curve, set to the lowest ISO possible, 3200. I used the zebras to ensure that the images were just short of clipping in the highlights. Notice how much flatter the S-Log2 image is. Unfortunately, it was a relatively flat day out, so the effect is not quite as pronounced as I would have liked it to be. Regardless, the linear image has almost no shadow information. Looking under the deck, the linear recording is basically black, and you can barely make out the wood patterns and the wheelbarrow.  The S-Log2 recording has clearly defined the wood patterns, as well as the wheelbarrow. Now that you have that detail to work with, you can create an image with superior gradation and details in the shadows, all without clipping your highlights. But to do this, you need to add the extra step of color grading. So I went into my NLE and I graded the S-Log2 file. Compare images again. This time, the image on the right is a roughly graded S-Log2. The image on the left is identical to the left image above.

 

Linear low image Graded S-Log2 image

 

The graded S-Log2 image has far superior gradation in the shadows when compared to the linear image, courtesy of the redistributed exposure values. Now, grading log footage takes practice, and while I have had some experience shooting in various forms of log, I am by no means a professional colorist. Someone who does color correction and grading for a living can really take log-encoded images and work some serious magic with them. Perhaps, ironically, the process done in post production, in effect, hammers out the curve in the log footage to make it more linear.

Back to Reality

While log recording grants more flexibility, it is not without any caveats. Yes, log footage is flexible, but that fact does not endow you with the freedom to be lazy and not check your exposure. On the contrary, you have to be even more careful with your exposure, especially if you’re checking it on an uncorrected monitor. Some monitors can use what are called LUTs (Lookup Tables) to compensate for the log curve and present a linear-like image that’s not washed out. Many colorists also use LUTs as a starting point for grading log footage. A monitor that supports LUTs, like the SmallHD 500 and 700 series monitors, can be invaluable on set when shooting log footage. Not only will it keep your exposures consistent, but it will keep your client from wondering why your image looks so washed out. Monitors with scopes—i.e., waveforms and histograms—are also handy in these situations, allowing you to accurately assess clipping highlights and proper exposure. Since every different type of log has its own curve, separate LUTs are needed for each brand of log with which you wish to shoot.

While we touched on the subject to a degree, it doesn’t hurt to reiterate that anything recorded in log will require a grading step for the footage to be presentable. If you want to get to know your way around grading log footage, try out Blackmagic Design’s DaVinci Resolve software (which is also a swell editing system). The standard version, which has most of the functionality of the full Resolve Studio, is available for free from the Blackmagic Design Website. It doesn’t get much better than that, but color grading plug-ins, such as Red Giant’s Magic Bullet Suite and FilmConvert (a personal favorite of mine) are other options that work inside most other NLEs like Adobe Premiere, Avid Media Composer, and Final Cut Pro X, are also on the rise. They are easy to use, and can achieve great results without round-tripping your footage to separate grading software. In the end, it’s up to you. Log footage is flexible, so it’s all about how you want to process it.

Choices down the Line

Now, to bring it all home. It’s easy to understand why log was initially only implemented on the top cameras such as the Sony F35 and ARRI ALEXA. It’s a professional tool that has slowly trickled down into prosumer gear. This is a major boon for us filmmakers because it grants the flexibility we require to put the best possible images into our motion pictures. Even provided that most of our cameras record to heavily compressed codecs like H.264, log helps us maximize the data that is recorded. Sure, it requires a little more effort during production and in post production, but hey, sometimes a little extra effort gets you that much closer to the art form that you are practicing and makes it much more your own. Log is all about choices down the line, so go ahead, grab your camera and give log recording a whirl.

31 Comments

Thanks, that’s a very nice article !!

 

Thanks for your comment, Ron. We're glad you enjoyed the article!

I wonder why log profiles are not used in photography instead of just picture profiles or RAW. They would have some of the benefits of RAW but with the file size of JPG. However, maybe a file format with higher bit depth would probably be needed to prevent 8-bit issues when color correcting such as banding and other artifacts.

When should I record in LOG format? What is the difference in SLOg and others? I watch a lot of filmaking tutorials and they all say LOG is the best, so why not constantly record in LOG format?

LOG format is when you intend to go back and do extensive color grading to the footage.  Different cameras have different log profiles, SLog being the kind of LOG in Sony Cameras.  It is not always used because some people don't want to do extensive color correcting.  They would rather get a good look in camera that is ready to go.

Thanks!

Thanks for the article, i use the sony a6000 and as you know they don't have slog...Some youtuber have tutorial about fake flat picture profile, they use neutral ( Contrast -3,  Saturation -1, Sharpness -1). Do you think it useful to get more dynamic range?

Hey! When we are shooting on LOG we need expose our footage to at +2?

 

 

That will depend on the camera and log setting you are using, but in general it is suggested to over expose a bit when shooting in a log setting.
Thanks!

Hi David,

Thanks for the very informative article. There is something I don't quite understand however. You wrote and I quote:

"But wait. Look at the numerical difference between stops 7 and 8. That one stop gets a whole 128 bits of representation, half of the entire bit depth of the image!"

As far as I understand it, a stop represents either doubling or halving the amount of light entering the camera, i.e. the brightness level. At the top end of the exposure values, doubling the stops between 7 and 8 would represent the greatest difference between absolute brightness values, much greater than between stops 1 and 2.

In fact, if I understand it correctly, the difference between stops 7 and 8 should represent the whole upper half of the possible brightness values the sensor is capable of capturing. If my understanding is not mistaken, shouldn't it therefore be natural to allocate half the bit depth of the image to half the possible brightness values of the sensor? What am I missing?

In this formula 2 to the 7th power equals 128, while 2 the 8th equals 256.  That is why a 1 stop difference equals a difference of 128 bits.

Thanks!

You are comparing a painfully obviously underexposed image to a graded log image? Come on, guys, that's just dishonest. I pulled your images into IrfanView (yeah, not a pro editor, just good old basic IrfanView) and was able to grade the underexposed JPEG to a much better-looking image than the graded log image, confirmed by someone sitting next to me through a full-screen A/B test with no context given. Shooting log or flat requires high bit depth to be practical at all and the results are often less than stellar in all but the most experienced hands. I have written numerous articles and made several videos with comparisons and examples showing why flat and log picture profiles are generally not suitable for normal human beings. They have their place: extremely high-contrast scenes being shot with high bit depth cameras and post-porduced by people that are good with advanced color correction and grading...but that's pretty much the only situation where the mathematical trickery of log helps out. Getting it right in-camera is the only acceptable way to go for the vast majority of users, if for no other reason than avoiding the extra workflow, skill, and computer time requirements. I have done numerous tests with (8-bit MPEG-4 H.264 AVC compressed) log profile images and videos as well as Panasonic's Cinelike-D/V clips and every time, without fail, the log footage is inferior in post-production flexibility and falls apart much quicker than footage shot with a more standard gamma curve. It is extremely important to give the correct advice to the correct audience; someone with an 8-bit Sony body that shoots in an S-Log profile is all but guaranteed to have color problems in post. The end result, invariably, is that the colors are made to "pop" so that the problems caused by inappropriate use of a log (or flat, which is log's ugly sibling) profile appear to be an artistic choice rather than a mistake. I agree that log profiles are useful in very limited scenarios and with appropriate hardware, but the vast majority of people who would be reading B&H Explora for technical advice have no business bothering with "X-log9000" until they can get everything right in Standard and own a GH5 or better (for the 10-bit 4:2:2 it offers).

Where may we read your articles and watch your videos on the topic, please?

Great article. I wonder if you would comment on the differences in recording in LOG vs HDR10. Specifically in the LG phones, in previous models as the V30 they had an option in manual to record in Cine LOG, making possible many of the color grading options you discussed below. Their recent phones such as the V40 and V50 have added an option to record in HDR10 while discontinuing the Cine LOG. Is recording in HDR10 going to allow the same degree of color grading options that Cine LOG allowed previously. Thanks in advance for any "light" you can shed. 

Hi Joseph!

I don't know much about the log curve implemented in phones, but, HDR works in a similar way. Instead of a camera manufacturer creating their own gamma curve, broadcast companies created their own gamma curves and both camera and screen manufacturers implemented them according to those HDR standards, such as HDR10. In the end, the advantage of HDR and log picture profiles are mostly in line with each other, which is to provide a way to record and display a wider dynamic range with more subtle exposure gradations. You can even use HDR10 in editing for SDR by grading the image and retain a greater dynamic range than SDR picture profiles, potentially.

Hope I was able to sufficiently answer your question, and provide the insight into log and HDR. Happy shooting!

Hi David, thanks for the article!

i have a question regarding ISO values when shooting LOG. Is it necessary to use high values ISO when shooting LOG? according to the article when you used the linear exposure you had ISO 400 but when you used the LOG you had the minimum ISO 3200. does it means the A/D uses the analog implification (ISO) of lower stops bits resulting with actual LOG exposure profile? i hope the question is clear:) 

Hi Tomer!

One of the quirks of the Sony a7S camera, which was used for the images above, is that the lowest ISO you're permitted to shoot with while using the S-Log2 picture profile is ISO 3200. While that sounds really high, it's only 3 stops greater than ISO 400. I don't fully understand the reasoning for this minimum ISO figure, but I can surmise that the exposure is gauged at this higher ISO because the overall exposure is higher, however, the highlight values are shifted down, creating a somewhat equivalent exposure to the ISO 400 image shot without S-Log2 if you expose for the highlights. it does make some sense. If you think about it, one way to look at it would be that you're adding 3 extra stops of dynamic range to your shadows to achieve smoother gradations in this case.

To answer the second part of your question (if I understand correctly), every camera works differently with Log. From my experience, I've gotten the best results shooting with the camera's native or suggested ISO. In the case of the a7S, that ISO is 3200. In the case of the C300 (mark 1) the native ISO is 800, but the suggested ISO, as per the manual, is ISO 850. Sometimes using a different ISO rating will work better, depending on how you want your scene exposed. I know that with RED cameras, some cinematographers prefer to expose for lower than the camera's native ISO. Go out and experiment a little with whatever camera you're shooting with, and see which exposure settings work best for your workflow.

I hope that I was able to adequately answer your questions. Happy shooting!

Love this article... I'm a college professor, and my students really benefit from such a clear, concise explanation like this. I tell them all to use B&H - and for a while slew of reasons... this is now just one more.

A question: Isn't the lower four stops of the exposure range only 1/16 of the entire bit depth (not 1/4)? The first stop has 2 (0-2), the second 2 as well (2-4), the third has four (4-8), and the fourth has eight (8-16), which totals 16, and that's 1/16 of 256. Am I missing something?

Hi Bob! I really appreciate the feedback, and I'm glad you've made such great use of this article. As it turns out, you're correct, I did my logarithmic arithmetic wrong. I'll have the Explora team correct this ASAP.

Isn't it wonderful when the feedback loop actually works?

Thanks again for your praise and the correction, and keep up the good work!

Interesting reading. Thanks for putting together this article.

I personaly would find it interesting to see a "normal" still photo from the sony, to compare and get an idea of what the scene "really" looked like though

 

So where do Cine like profiles fit in with all this? I have scoured google and youtube for a technical description of cine profiles. Is it also a type of log format? I cant seem to find the answer.

Hi Steven, thanks for reading and commenting! This may be a bit of an oversimplification, but cine profiles (as I understand them) are designed to fit, sort of, between REC 709 and Log profiles. Cine profiles will usually give you a little more room in the highlights and shadows during recording, but not really shift the dynamic range enough to give difficulty grading. Generally speaking, with cine profiles, only minimal adjustment in post would be required to get a really nice image that retains more of the camera's dynamic range than REC 709 while maintaining proper exposure. Cine profiles work really well with cameras that make it difficult to judge exposure when using Log profiles. This is why I actually switched to shooting with a Cine profile from S-Log2 on my a7S II for the majority of shoots that I do; especially the ones that require quicker turnarounds. Additionally, I can shoot at lower ISOs (the lowest ISO on the a7S II when shooting S-Log2 is 1600). S-Log2 will still grant greater control over the look of the image in post, but the Cine profile lets me have a good dynamic range, good enough highlight retention, and a great image right out of camera, all at once.

To sum up, Cine profiles are a good compromise between the ready-to-use out-of-camera footage of REC 709 and the dynamic range and control of S-Log2. It still needs some tweaking in post, but the image quality payoff is worth the small adjustments. Hope this helps!

Just a quick clarification that I didn't cover above. Cine profiles don't apply a logarithmic function to the exposure curve, so no, Cine profiles are not another kind of Log.

Some apps on iOS and Android claim to do Log recording whereas the fact is devs do not have any real access to sensor data, or apply a gamma curve of their choice in A2D stage. Is there a real merit in remapping linear buffers from the sensor to Log before sending to H.264 encoder (this is what they seem to be doing)? 

Hi, thanks for reading! I don't personally know what app developers do and don't have access to on a technical level (though later model iPhones do seem to have some degree of low-level access to camera sensor data, as apps like Lightroom can take legit DNG raw photos). That said, even if the devs did have access to the direct sensor data, the effectiveness of a log exposure curve has a lot to do with the sensor itself and how much dynamic range it can handle, as well as the level of compression being used. I've never recorded using a log curve on my phone, but Matt Allard at NewsShooter has a pretty comprehensive article with footage showing the possible benefits and downsides of using the FiLMiC Pro iOS app's log function (link: https://bit.ly/2r0nsRr). Based on what I can see, there's little benefit to log exposure curves in this situation, in my opinion. FiLMiC Pro is pretty open about their log implementation and published a white paper that details said implementation (link: http://filmicpro.com/FilmicLogWhitePaper.pdf). Hope you find this helpful, and happy filming!

Great artcile!  Clearly laid out and neatly jumps that gap from what was perhas vague intuition for many of us, to a clear and simple numeric understanding of a Log recording schemes.

Thanks, but what's the difference between S-log and V-log?  I feel completely lost in all of this because I never went to film school.  I'm an old video guy who majored in broadcasting, and started out in a much simpler era of video, when it was just shoulder-mounted Betacams, and you just white balanced and started shooting!

Hi Dale, thanks for reading! Firstly, I apologize for not seeing this comment when it came through, hence my very delayed response. The answer is actually pretty simple, at least on a superficial level. S-log and V-log are Sony's and Panasonic's implementation of log gamma curves, respectively. While both S and V-log curves serve essentially the same purpose, their respective creators tweak the curve to fit the sensor used in their cameras and the desired recorded results. As for the naming, I've heard, anecdotally, that S-log stands for "Sony Log" and V-log stands for "Varicam Log". Hope this helps, if you haven't found your answer already! All the best.

Thanks Roberto.

I appreciate the feedback!

Great article! I have been getting more and more into doing short videos over the past couple of years. I am looking to upgrade some of my gear, but really don't know what I need. This article just took something that is way above my understanding and made it simple and tangible for me. This has been a great help!

Hey Lee,

Thanks for reading! It was not too long ago that I was in the same boat as you. Log recording really is a valuable asset for filmmakers. And as it trickles down and becomes more available to those of us who don't have cameras in the 5-figure price bracket, it's good to be able to simplify the concept to the benefit of everyone. Glad I could help you!

Happy filmmaking!