SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Github Development
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-06-2016, 09:59 PM
trk2 trk2 is offline
Sage Aficionado
 
Join Date: Jan 2006
Location: Maine
Posts: 499
V9 and RGB Range

I just installed a new V9 test server on my windows 10 desktop. I noticed that the video output of Sage is using the incorrect RGB range with both the default Microsoft DTV-DVD H.264 decoder or ffdshow. Right now I am using ffdshow to correct the range. Is there a way to set the output RGB range within Sage so I can use other decoders than ffdshow?
Reply With Quote
  #2  
Old 07-07-2016, 12:08 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
I think that's usually done in the video drivers.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #3  
Old 07-07-2016, 02:50 PM
trk2 trk2 is offline
Sage Aficionado
 
Join Date: Jan 2006
Location: Maine
Posts: 499
That's correct but my video card drivers are set properly and it's easy to verify against a black level test image. Here's what I've determined:

Sage, apparently by default, outputs 16-235 RGB range which is the TV standard. This would work fine for someone who does NOT have their video card drivers set properly when connected to an HDTV. In this example, Sage video would look great, but everything else would have crushed blacks and whites.

However by setting the video card properly for an HDTV the video card converts 0-255 to 16-235. But since Sage is already outputting 16-235 the video card converts this to 32-219 (very washed out image).

I'm wondering if this is some legacy HTPC issue from the days before video card drivers allowed you easily set the RGB range.
Reply With Quote
  #4  
Old 07-07-2016, 09:03 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by trk2 View Post
That's correct but my video card drivers are set properly and it's easy to verify against a black level test image. Here's what I've determined:

Sage, apparently by default, outputs 16-235 RGB range which is the TV standard. This would work fine for someone who does NOT have their video card drivers set properly when connected to an HDTV. In this example, Sage video would look great, but everything else would have crushed blacks and whites.

However by setting the video card properly for an HDTV the video card converts 0-255 to 16-235. But since Sage is already outputting 16-235 the video card converts this to 32-219 (very washed out image).

I'm wondering if this is some legacy HTPC issue from the days before video card drivers allowed you easily set the RGB range.
Okay, so that's not really Sage doing it, it's whatever video decoders you are using - so without knowing what you are using, I'm not sure what to suggest. Sage simply tells directshow to play back the file - it doesn't really configure that type of settings in the playback.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #5  
Old 07-07-2016, 10:32 PM
trk2 trk2 is offline
Sage Aficionado
 
Join Date: Jan 2006
Location: Maine
Posts: 499
Quote:
Originally Posted by Fuzzy View Post
Okay, so that's not really Sage doing it, it's whatever video decoders you are using - so without knowing what you are using, I'm not sure what to suggest. Sage simply tells directshow to play back the file - it doesn't really configure that type of settings in the playback.
That's what I thought as well except I've tested all the "standard" codecs (Microsoft, ffdshow, lav filters) and they are all behaving the same way, at least in Win 10. I can correct the problem in ffdshow by scaling it back to 0-255 (before the video card scales it again to 16-235). Lav filters supposedly can do this as well, but it doesn't work for some reason. Also, if I use the lav or MS decoders with media player classic everything displays correctly without any additional configuring other then selecting the external filter. Unless I am a unique circumstance, this behavior seems wrong.

My point is that my computer is a pretty average gaming desktop (i7 3770, Radeon HD 7800) and probably similar to what a new user would use to try Sage. And if all the decoders normally recommended are outputting the wrong level by default, then the first thing a new user going to see is a washed out video image and the V7 ui. Not the best first impression. Even if this is not a Sage problem, it seems like it is a problem for Sage.

Last edited by trk2; 07-07-2016 at 10:34 PM.
Reply With Quote
  #6  
Old 07-07-2016, 11:19 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Windows decoders are going to assume that the output device is a computer monitor, not a TV, unless you configure them differently.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #7  
Old 07-08-2016, 09:30 AM
trk2 trk2 is offline
Sage Aficionado
 
Join Date: Jan 2006
Location: Maine
Posts: 499
Thanks Fuzzy, I've determined the issue is caused by the EVR renderer. VMR9 outputs the correct RGB range with all the usual codecs with no adjustments needed. Using the EVR renderer seems to always output the incorrect RGB range. I've verified this behavior on multiple computers connected to both HDTV (16-325) and monitors (0-255).

So the conclusion I've reached is that EVR in Sage seems to always output 16-235. VMR9 outputs the correct 0-255. EVR in media player classic behaves correctly. Perhaps someone else can test their results when switching between EVR and VMR?
Reply With Quote
  #8  
Old 07-08-2016, 02:30 PM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,188
16-235 is the "correct" output, it's the way video is encoded, and the way video monitors generally expect video to be input.

If you look at a standalone Blu-ray player, it will output video as 16-235.

Things just get tricky with PCs. PC desktops are 0-255, so you can't generally have both video and PC desktop calibrated correctly at the same time. This is where the video driver settings come in, they can be normal (0-255) or you can set them to video (16-235), however the second can result in a double conversion video expanded to PC levels and compressed back, which can introduce banding and clips BTB and WTW, but is sometimes preferable for usability reasons.

If you don't do anything else critical on the PC, I'd just use EVR with Sage and the video drivers set to 0-255, which will result in the correct video output without clipping or extra banding.

Are you sure you don't have any 16-235 to 0-255 pixel shaders enabled in MPC-HC?

Last edited by stanger89; 07-08-2016 at 02:34 PM.
Reply With Quote
  #9  
Old 07-08-2016, 04:21 PM
trk2 trk2 is offline
Sage Aficionado
 
Join Date: Jan 2006
Location: Maine
Posts: 499
Hey stanger, thanks for the response. I understand what you're saying and I understand the choice comes down to either scale the video twice or live with the wrong color range for the UI/OS. But let me suggest it is incorrect to have a media server display video in a different color range than its UI by default. The only way that everything will ever look correct is to have decoders output 0-255 otherwise the UI/images/everything but video will be displayed incorrectly.

Regarding MPC, I'm sure I don't have any shaders enabled. I only used it as an example of a video player that uses lav filters where the default is to output in 0-255 (like Sage does with VMR9).
Reply With Quote
  #10  
Old 07-09-2016, 09:14 AM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,188
You can use LAV filters in Sage and set them to 0-255 output too.
Reply With Quote
  #11  
Old 04-13-2021, 12:42 AM
jughead's Avatar
jughead jughead is offline
Sage Advanced User
 
Join Date: Jul 2004
Posts: 114
Sorry to revive an old thread bit I finally found the solution and also want to document it for my future self, if I reinstall

I'll bet MANY people who THINK they are outputting RGB Full from Sage/EVR/LAV have this mismatch in their Sage setups without knowing it.

EVR+LAV only outputs 16-235 even if you set LAV to output 0-255. I was very surprised by this.

If you want Sage+LAV with EVR to output 0-255, you MUST also add this DWORD in the registry and set to 1.

\Frey Technologies\SageTV\DirectX9\

DWORD
EVR0To255Range=1

If set to (1), then EVR outputs 0-255 color range
If left default (0) 16-235 will be used

Last edited by jughead; 04-13-2021 at 04:03 PM. Reason: DWORD clarity
Reply With Quote
  #12  
Old 04-13-2021, 07:44 AM
trk2 trk2 is offline
Sage Aficionado
 
Join Date: Jan 2006
Location: Maine
Posts: 499
This is amazing, thank you! Obviously I have been working around this issue for a long time and I was never able to get the Sage community past step 1 - recognizing there was a problem. I agree that many users using the windows client probably have this mismatch and have never noticed that Sage is giving them an incorrect RGB range.
Reply With Quote
  #13  
Old 04-13-2021, 12:43 PM
CptKirk CptKirk is offline
Sage Aficionado
 
Join Date: Sep 2010
Posts: 268
Sorry, may be clear to others, but I want to make sure...

So the default for the dword is 0. So, create the dword with the default 0, or create it and set it to 1?
__________________
SageTV running on: Win10 21H2
SageTV 9.2.6.976 (64 bit)
Java 1.8.0 311 (64 bit)
OpenDCT 0.5.32 (64 bit)
Clients: HD300 (x2)
HDHR3-CC Prime 20220822 (Comcast CableCard) - 3 Tuners
HDFX-4K Flex 20220822 (OTA) - 4 Tuners
Reply With Quote
  #14  
Old 04-13-2021, 03:49 PM
jughead's Avatar
jughead jughead is offline
Sage Advanced User
 
Join Date: Jul 2004
Posts: 114
Quote:
Originally Posted by trk2 View Post
This is amazing, thank you! Obviously I have been working around this issue for a long time and I was never able to get the Sage community past step 1 - recognizing there was a problem. I agree that many users using the windows client probably have this mismatch and have never noticed that Sage is giving them an incorrect RGB range.
You're welcome! I'm glad you saw my post! I'd had it set incorrectly for YEARS and once I realized it was a problem, I finally dove in, to see if I could figure out what was going on. Your post gave me the idea to check VMR9 and it was correctly outputting 0-255, meaning the issue was not with my LAV settings, etc. but with EVR.

It was easy to test once I downloaded the AVS Grayscale Steps video, added it to my Sage library and compared it to the same video in MPC-BE, on Youtube in my browser, and on Shield TV. Sage with EVR was always wrong but with VMR9 was correct.

FYI my Roku outputs only Limited but reports itself to my projector as Full, so the Auto setting would never work. I replaced it with the Shield TV which lets you set the RGB range manually and supports Sage Miniclient too. A worthwhile upgrade Double check if you have a Roku for this similar problem!

Eventually I stumbled upon this, which has some more registry settings you may find useful: http://download.sage.tv/SageTVRegistrySettings.txt

imho this DWORD should be added as a video output option in Sage Settings to let us choose Limited or Full

Quote:
Sorry, may be clear to others, but I want to make sure...

So the default for the dword is 0. So, create the dword with the default 0, or create it and set it to 1?
Create and set to 1

Sorry for the confusion, I copy pasted that part from the above link. If it doesn't work, there may be multiple entries in the registry so add it to the next one too until it does

Quote:
The base path to Windows registry settings for SageTV is:
HKLM\Software\Frey Technologies\

For Windows Vista 64 and Windows 7 64, the base path is:
HKLM\Software\Wow6432Node\Frey Technologies\

On Windows Vista and Windows 7, if UAC is enabled the registry keys may also be under:
HKEY_USERS\<user id token>\Software\Classes\VirtualStore\MACHINE\SOFTWARE\Frey Technologies\
HKEY_USERS\<user id token>\Software\Classes\VirtualStore\MACHINE\SOFTWARE\Wow6432Node\Frey Technologies\

Last edited by jughead; 04-13-2021 at 03:57 PM.
Reply With Quote
  #15  
Old 04-13-2021, 07:26 PM
wnjj wnjj is online now
Sage Icon
 
Join Date: Jan 2009
Posts: 1,514
The instructions need a minor tweak since we now have 64-bit SageTV:

Quote:
The base path to Windows registry settings for SageTV is:
HKLM\Software\Frey Technologies\

For Windows Vista 64 and Windows 7 64 running 32-bit SageTV, the base path is:
HKLM\Software\Wow6432Node\Frey Technologies\

On Windows Vista and Windows 7, if UAC is enabled the registry keys may also be under:
HKEY_USERS\<user id token>\Software\Classes\VirtualStore\MACHINE\SOFTWARE\Frey Technologies\
HKEY_USERS\<user id token>\Software\Classes\VirtualStore\MACHINE\SOFTWARE\Wow6432Node\Frey Technologies
__________________
Windows Installer
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Frequency out of range when tuning DVB-S echoes SageTV Github Development 2 09-05-2017 08:47 AM
Time range for recordings limiter SageTV Software 0 03-08-2010 10:20 PM
Frequency out of range messages in log jonno SageTV Linux 3 09-01-2008 01:16 PM
MVP IR Range limitation dbfresh23 Hardware Support 0 03-27-2006 12:39 PM
USB-UIRT Range? edbmdave SageTV Software 2 05-15-2004 11:20 PM


All times are GMT -6. The time now is 11:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.