Forgot Password
Pentax Camera Forums Home
 

Reply
Show Printable Version Search this Thread
02-20-2016, 10:34 AM   #1
Veteran Member
Ariis's Avatar

Join Date: Nov 2014
Location: Lorraine, France
Photos: Gallery
Posts: 631
H.264 rendering in dark areas

I made a quick search over this forum but can't find any thread talking about this important issue, so I'm hoping for an answer here.

While looking and the video sequence on my PC on a quite good monitor (sRGB but calibrated), I noticed that the dark areas are way more clipped to black than when viewing the sequences in the K-3 ! How can that be ? Did you ever noticed this and how did you solved that ?

On my PC (Win7, hardware accelerated), I tried to render them in VLC, Windows MediaPlayer, QuickTime, but they render the same I then deactivated HW acceleration in VLC's preference and set the Contrast, Brillance and Saturation value to 0, and tried other H.264 profile, i.e. "main" and "baseline", it doesn't help.

Any help will be appreciated.

02-20-2016, 11:35 AM   #2
Pentaxian




Join Date: Jul 2009
Location: Pugetopolis
Posts: 11,029
Try looking at them on a different monitor. I edit my photos at home thinking I've adjusted the darks just right to flirt with the edge of black. And then I see them on my work monitor where there is more shadow detail, fewer highlights and overall lower contrast. Monitors are so variable calibrated or not I think.

Last edited by tuco; 02-20-2016 at 11:40 AM.
02-20-2016, 02:53 PM   #3
Veteran Member
Ariis's Avatar

Join Date: Nov 2014
Location: Lorraine, France
Photos: Gallery
Posts: 631
Original Poster
Thanks for the answer tuco.

I connected the K-3 to my monitor through the hdmi output, and the display was equally awfull ! And on your advice, I tried the same thing on other monitor and TV, the result were varying. On a Samsung TV, I had to select the "Natural" rendering to have something similar to the in body rendering. On a Philips TV, I had to lower down the gamma value to see the dark areas.

I extracted all the images of this rush to png files and tried to brighten it up. What I don't get is why the no more dark areas has still no details ? They should have been brought out.

Maybe that the video is gamma 1.8 encoded and gamma 2.2 decoded. Does it make sense ?
02-20-2016, 03:19 PM   #4
Pentaxian




Join Date: Jul 2009
Location: Pugetopolis
Posts: 11,029
QuoteOriginally posted by Ariis Quote
Thanks for the answer tuco.

Maybe that the video is gamma 1.8 encoded and gamma 2.2 decoded. Does it make sense ?
I doubt that. I thought we'd seen the last of that when Apple finally joined the party and made gama 2.2 their out of box configuration. But what you're saying sounds a lot like a gamma issue. Perhaps someone will have a better answer. I know only the basics about video codecs and stuff like that.


Last edited by tuco; 02-20-2016 at 03:28 PM.
02-21-2016, 02:00 PM   #5
Veteran Member
Ariis's Avatar

Join Date: Nov 2014
Location: Lorraine, France
Photos: Gallery
Posts: 631
Original Poster
For reference, I also tried to import the video sequence in Blender, and I get the same result.

I found out that it's possible to use filters and change the gamma decoding value in VLC. So I activated the "adjust" filter and set the "gamma" value to 1,40 (I guess that it apply one more gamma compensation pass than affecting the initial gamma value, but I don't really know), and I finally got similar result than the in body rendering.

This clearly makes me think that there's something wrong with the gamma encoding in the K-3 side, and/or that the in-body video player has something wrong, because of the different display whether the K-3 is displaying the video through its own monitor or on an external monitor through the HDMI port. I recall that I had to severely tweak all the display that I tested it on.

I know that the K-3 video quality is poor due to the 4:2:0 encoding and the low bit rate, but if there's a gamma encoding problem in the K-3 side that could bring some more details in the dark areas by fixing it, it should be fixed. Moreover, we know (but who had any doubt about that) by the specs of the K-1 that a flat profile is easily possible. RICOH would be very keen to fix that possible bug and add that flat profile through a firmware update for the affected bodies (i.e. including my beloved K-3 ). Their loyal users will appreciate and it's such a small addition that it won't cut them future sales if they finally sell a video oriented product (if ever).

Last edited by Ariis; 02-21-2016 at 02:07 PM. Reason: Rephrased last paragraph
02-23-2016, 11:20 AM   #6
Veteran Member




Join Date: Sep 2010
Posts: 2,799
The output mode matters too (usually you can select it in the video player). I believe Pentax makes use of the full 0-255 range, while the TV safe range is 16-239 or something like that. If it is set to the latter it will increase the contrast and clip.

IMHO it is a good thing that the camera makes use of the full range, because 8 bit video isn't much to start with, limiting it even further is a bad idea.
02-24-2016, 11:40 AM   #7
Veteran Member
Ariis's Avatar

Join Date: Nov 2014
Location: Lorraine, France
Photos: Gallery
Posts: 631
Original Poster
That's not about cutting off the extremity of the range, but a gamma problem, i.e. the whole image is darker and more saturated than the in-body display. Using the gamma factor of VLC/ffmpeg solves this, but burns the highlights . I'm actually trying to find out if there is something to circumvent this in ffmpeg's options, or a way to blend 2 differently exposed image (2 extractions of the same vids with different gamma value) in an automated way.

That's sad because decoding, merging and encoding again will result in better tonal range (well, I hope so) but with more loss of detail because of the compression. Note that I'm a beginner in video and codecs, so I hope that I'm not misleading here...

06-02-2016, 04:33 PM   #8
Veteran Member
Ariis's Avatar

Join Date: Nov 2014
Location: Lorraine, France
Photos: Gallery
Posts: 631
Original Poster
QuoteOriginally posted by kadajawi Quote
The output mode matters too (usually you can select it in the video player). I believe Pentax makes use of the full 0-255 range, while the TV safe range is 16-239 or something like that. If it is set to the latter it will increase the contrast and clip.
I'd appreciate if you could point me to where I can set this settings in VLC. I've disabled all the filters but still has this issue.

Below is a screenshot of a test case that should speak for itself. On top left is the output form VLC, top right is the same output from Microsoft Media Player. I've also checked with Apple's QuickTime, Blender and DaVinci, it looks the same.

On bottom left is the extracted frame from VLC (when on "pause" -> Video / Take a screenshot). Now what's interesting is that the extracted frame shows more details in the shadows (see the "DA" logo on the box) and looks the same than the extracted frame from the in camera player (bottom right) !

I'm quite puzzled of how all this works : why does all the player render the same dark images excepted for the in-camera player, but the extracted image from VLC is different ?

If you connect your camera to a monitor through the HDMI port, the image is rendered dark, like VLC and Media Player does. So should we conclude that the in-body player isn't compliant to the standard ? Of course, what I'd like is to get the same details and tonal range on my NLE software than in the camera

---------- Post added 03-06-16 at 01:04 ----------

I don't know where to change the range settings, but if I change the output from Direct3D (the default) to Direct2D, then the image is fine ! So the culprit is Direct3D, and my ignorance in this affaire. I still find it awkward to have a different result when connecting the camera to my LCD display through the HDMI cable.
Attached Images
 
06-03-2016, 02:51 AM   #9
Pentaxian




Join Date: Feb 2015
Photos: Gallery
Posts: 12,242
That's a problem of calibration. Every device introduce gamma and color shifts, whether it is sensing channel (camera sensor and image processing) or actuation channel (video play and monitor , or printer paper and ink for printing photographs). For video, you are lucky to have control of both the sensing channel calibration (camera) and the actuation channel (your video player and monitor), therefore you can fully calibrate your system to render exactly how it should. To do so, you just need to use a digital target (an image synthesized with known 8 bits digital value of luninance from 0 to 255) display it on your monitor, take a photo of it and display it again on the same monitor, if both images are difference, you can tune the camera processing contrast, luminance, etc... until both images are the same, then use the same jpeg processing profile for capture video and you have proper rendering of shadows when recording and playing video. But if your video is played by someoneelses monitor, your calibration efforts will be lost. The only way to perform an absolute calibration is with a standard physical color and gray target other than a lcd monitor.
06-04-2016, 01:19 PM   #10
Veteran Member
Ariis's Avatar

Join Date: Nov 2014
Location: Lorraine, France
Photos: Gallery
Posts: 631
Original Poster
Data levels

Thanks for the info biz-engineer. My monitor is calibrated, but I didn't knew the "TV" mode with narrower range you talked about in your previous post. It turns out that this is what I'm facing here. When switching to Direct3D but disabling the hardware accelerated YUV->RGB conversion, the rendering is fine now. I don't know where this behavior can be selected for HW accelerated conversion, given that my system has a core i7 CPU with HD Graphics, and a GeForce 640M gfx chipset too. I don't know which CPU is used for conversion. There's no 2D rendering options for the nVidia chipset in this stripped out version of the driver, while in the full driver there is one for sure, with selection for Data or Video mode. I also searched for a while to find the option in the Intel HD Graphics driver about the rendering options for video. I turned the "YCbCr mode" on, it is "recommended for digital televisions/monitors" and makes the blacks darker... But I don't really know what's going on and if this is compatible with my monitor profile (generated by the SpyderPro2).

When editing the video in DaVinci Resolve, I have to change the attributes of each clip and switch from Auto to Data Levels 0 - 1023 (other option is Video Levels 64 - 960).
[edit] It's possible to set Data Levels globally in the project's settings, yet the clip properties says the levels are automatic, which might not be a good thing in the first place. [/edit]

Every device and software seem to auto-select the Video levels, while when playing back the videos on the camera, it is shown with Data levels. How can a software select one or the other option ? Isn't there a special tag or attribute in the video and HDMI signal to select the proper mode (which is the Data levels) ?

Last edited by Ariis; 06-05-2016 at 02:31 AM. Reason: [edit] comment added
06-21-2016, 12:20 AM   #11
Veteran Member
PiDicus Rex's Avatar

Join Date: May 2013
Location: Melbourne, Australia
Posts: 1,381
QuoteOriginally posted by Ariis Quote
What I don't get is why the no more dark areas has still no details ?
H.264, at the stupidly low data rate of the Pentax implementation, compresses the dark areas to a point where detail is lost - you can test by shooting the same shot with different ISO levels and changing the iris (or adding ND Filters) to compensate - at the higher ISO's where there should be noise, there is blotching in the compression.
The solutions are either to record externally, which we can't because of Pentax's crappy HDMI implementation, or a high-data rate Intra-Frame CoDec, such as the Mjpeg that's in the camera for Interval Movies but not available for normal videos.

QuoteOriginally posted by Ariis Quote
On my PC (Win7, hardware accelerated), I tried to render them in VLC, Windows MediaPlayer, QuickTime, but they render the same
Try the 30day trial of Edius, or maybe LightWorks.

I have noticed and mentioned before, that one of the good things about the way Pentax handles video, is the preservation of the sensors dynamic range, via encoding video to a wider signal range then other manufacturers - Pentax encodes from -15IRE to +125, instead of the usual 0 to +100.
This is where the Pentax is actually superior in retaining the sensor range found in the stills, where the majority of DSLR's loose some range - Canon 5D cameras have 11 stops range in stills, and 9 stops range in video on a good day. Nikon have 14 stops in stills, and about 12 in video..... The K-01 has 12.9 in stills, and 12.9 in video.

What this means, is that when you pull the video in to a program like Edius, you can do more adjustment in colour correction, right up to where you run in to the limits of the h.264 CoDec.
I have noticed that Adobe apps Do Not like the wider signal range, and will clip the video to the standard range, loosing detail - the old Lightroom workaround of applying a photo profile to a video file works right up until you go to export the vision and it's clipped in rendering.

QuoteOriginally posted by Ariis Quote
Moreover, we know (but who had any doubt about that) by the specs of the K-1 that a flat profile is easily possible.
We already have a flat profile - Muted - with a couple of tweaks to the High/Low setting, you can record a very tweakable video, again taking advantage of the preserved dynamic range.

Overall, what I think you're seeing in the different gamma behaviour, is a reflection of the way the basic editing apps handle the wider signal range, as compared to Edius or Resolve.
IIRC, the K-3 records it's sound at 48kHz, so it shouldn't be rejected by DaVinci Resolve in the same way as the K-01 files are.
Try downloading the free 'lite' version of Resolve 12.5 and seeing how that deals with the vision, it should allow much greater adjustment, and with the Waveform Monitor display, allow you to make sure the video you're rendering is exported within the standard 0 to 100% IRE levels.

Edit:
Ahh, reading further you've got it in to Resolve. Yes, it's a P.I.T.A. to get your head around how it works, and expect it to crash out routinely.

Last edited by PiDicus Rex; 06-21-2016 at 12:27 AM.
Reply

Bookmarks
  • Submit Thread to Facebook Facebook
  • Submit Thread to Twitter Twitter
  • Submit Thread to Digg Digg
Tags - Make this thread easier to find by adding keywords to it!
camera, change, frame, h.264, hdslr, help, image, output, pc, player, profile, range, rendering, video

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pentax Da 18-135mm 264.99 grzesiek Pentax Price Watch 6 11-27-2015 02:48 PM
Question Pentax Users in certain geographic areas jselph Site Suggestions and Help 4 03-06-2012 10:33 AM
Pentax Q with 1080p30 H.264 video ! jogiba Video Recording and Processing 7 07-05-2011 08:32 AM
Color Rendering in RAW--DCU4 vs. LR 3.2 lectrolink Digital Processing, Software, and Printing 3 10-13-2010 02:09 AM
[K200D newbie] Sparklies in LCD Playback rendering ymot Troubleshooting and Beginner Help 4 08-13-2008 06:28 AM



All times are GMT -7. The time now is 08:15 AM. | See also: NikonForums.com, CanonForums.com part of our network of photo forums!
  • Red (Default)
  • Green
  • Gray
  • Dark
  • Dark Yellow
  • Dark Blue
  • Old Red
  • Old Green
  • Old Gray
  • Dial-Up Style
Hello! It's great to see you back on the forum! Have you considered joining the community?
register
Creating a FREE ACCOUNT takes under a minute, removes ads, and lets you post! [Dismiss]
Top