VideoHelp Forum
+ Reply to Thread
Results 1 to 25 of 25
Thread
  1. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    My camera records videos in the range of 16-255.
    MPC recognizes this video as limited (16-235).
    Can I add a shader to MPC that will convert the image to the range of 0-255 or even 16-235?

    I found something that looks adaptable:
    https://github.com/svn2github/MPC-BE/blob/master/distrib/Shaders/16-235%20to%200-255%2...D%5BHD%5D.hlsl
    Quote Quote  
  2. You can turn the proc amp contrast setting down to -8. Keep in mind that everything else you watch will have the white level too low.
    Quote Quote  
  3. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by jagabo View Post
    You can turn the proc amp contrast setting down to -8. Keep in mind that everything else you watch will have the white level too low.
    Thanks.
    Yes, I know. I plan to associate MPC-BE with mts files only, and MPC-HC with the rest.
    Quote Quote  
  4. I don't know about MPC-BE, but for MPC-HC those shaders come with the player and you can create presets for them.
    I may have renamed the shaders themselves (I can't remember).

    Image
    [Attachment 67233 - Click to enlarge]


    The right click menu.

    Image
    [Attachment 67234 - Click to enlarge]


    Don't forget you can use MPC-HC as a portable version in a different folder, or as many times as you like.
    I have it "installed" with the usual file associations and I've put shortcuts to portable versions with different settings in the Windows SendTo folder.
    To make that work you need to make sure MPC-HC is saving it's settings to an ini file and not the the registry (except for one version, if you prefer).

    Image
    [Attachment 67235 - Click to enlarge]
    Quote Quote  
  5. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by hello_hello View Post
    I don't know about MPC-BE, but for MPC-HC those shaders come with the player and you can create presets for them.
    I may have renamed the shaders themselves (I can't remember).
    I know this shader but I need 16-255(!) -> 0-255.
    Quote Quote  
  6. Can you please upload a short sample file straight from your camera? I am curious about the videofile specs. Doesn't matter what is in the video of course, just a 15 seconds clip.
    Quote Quote  
  7. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Code:
    Ogólne
    ID                                      : 0 (0x0)
    Pełna ścieżka                           : C:\Users\Właściciel\Desktop\projekty video\2022-2\2022-05-14xx (GEM - mecz CLJ U15 Śląsk-Beniaminek)\2022_05_14 16_27_52.mts
    Format                                  : BDAV
    Format/Informacja                       : Blu-ray Video
    Rozmiar pliku                           : 54,8 MiB
    Czas trwania                            : 17s 455 ms
    Rodzaj całkowitej przepływności bitów   : Zmienna
    Całkowita przepływność bitów            : 26,3 Mb/s
    Maksymalna całkowita przepływność bitów : 28,0 Mb/s
    Data nagrania                           : 2022-05-14 16:27:52+02:00
    Aplikacja zapisująca                    : Sony DSC-HX90V
    
    Wideo
    ID                                      : 4113 (0x1011)
    ID menu                                 : 1 (0x1)
    Format                                  : AVC
    Format/Informacja                       : Advanced Video Codec
    Profil formatu                          : High@L4.2
    Ustawienia formatu                      : CABAC / 2 Ref Frames
    Ustawienia formatu, CABAC               : Tak
    Ustawienia formatu, poklatkowy          : 2 klatki
    Format settings, GOP                    : M=1, N=15
    ID kodeka                               : 27
    Czas trwania                            : 17s 517 ms
    Rodzaj przepływności                    : Zmienna
    Przepływność bitów                      : 25,0 Mb/s
    Przepływność maksymalna                 : 26,0 Mb/s
    Szerokość                               : 1.920 pikseli
    Wysokość                                : 1.080 pikseli
    Proporcje obrazu                        : 16:9
    Szybkość wyświetlania klatek            : 59,940 (60000/1001) kl/s
    Color space                             : YUV
    Chroma subsampling                      : 4:2:0
    Bit depth                               : 8 bitów
    Rodzaj skanu                            : Progresywny
    bity/(piksele*ramki)                    : 0.201
    Rozmiar strumienia                      : 52,3 MiB (95%)
    IrisFNumber                             : 6.300000
    
    Audio
    ID                                      : 4352 (0x1100)
    ID menu                                 : 1 (0x1)
    Format                                  : AC-3
    Format/Informacja                       : Audio Coding 3
    Commercial name                         : Dolby Digital
    ID kodeka                               : 129
    Czas trwania                            : 17s 536 ms
    Rodzaj przepływności                    : Stała
    Przepływność bitów                      : 256 kb/s
    Kanały                                  : 2 kanały
    Channel layout                          : L R
    Częstotliwość próbkowania               : 48,0 kHz
    Szybkość wyświetlania klatek            : 31,250 kl/s (1536 SPF)
    Compression mode                        : Lossy
    Rozmiar strumienia                      : 548 KiB (1%)
    Service kind                            : Complete Main
    
    Tekst
    ID                                      : 4608 (0x1200)
    ID menu                                 : 1 (0x1)
    Format                                  : PGS
    ID kodeka                               : 144
    Czas trwania                            : 16s 952 ms
    (Screenshot after manually changing the color range from limited to full)
    Image Attached Thumbnails Click image for larger version

Name:	sony.png
Views:	31
Size:	93.3 KB
ID:	67265  

    Last edited by rgr; 17th Oct 2022 at 10:06.
    Quote Quote  
  8. Originally Posted by rgr View Post
    I know this shader but I need 16-255(!) -> 0-255.
    Attached is a shader for that. The trick is getting the rest of the system not to clamp the range first. And then everything else displays with the wrong levels.
    Image Attached Files
    Quote Quote  
  9. Originally Posted by rgr View Post
    I know this shader but I need 16-255(!) -> 0-255.
    I missed that.

    Does the camera support xvYCC? It uses the 1-15 and 241-254 range.
    https://web.archive.org/web/20091209052016/http://www.sony.net/SonyInfo/technology/tec.../xvycc_01.html

    Not that I know much about xvYCC and I don't think my video card supports it and I don't know how it's supposed to work when it isn't supported.

    I downloaded a sample video from a site reviewing the camera, and aside from what appears to be god-awful dynamic contrast, the levels are as you described.

    Original

    Image
    [Attachment 67267 - Click to enlarge]


    Reducing the whites to TV range looks better, but there's still clipping. I don't know if this video is typical though.
    Levels(0,1.0,255,0,235, coring=false)

    Image
    [Attachment 67268 - Click to enlarge]


    I wonder if a full PC range to TV range conversion should be applied. For this video I think it looks better.
    Levels(0,1.0,255,16,235, coring=false)

    Image
    [Attachment 67269 - Click to enlarge]
    Quote Quote  
  10. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by jagabo View Post
    Originally Posted by rgr View Post
    I know this shader but I need 16-255(!) -> 0-255.
    Attached is a shader for that. The trick is getting the rest of the system not to clamp the range first. And then everything else displays with the wrong levels.
    Thanks. I will try.
    Quote Quote  
  11. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by hello_hello View Post
    Originally Posted by rgr View Post
    I know this shader but I need 16-255(!) -> 0-255.
    I missed that.

    Does the camera support xvYCC? It uses the 1-15 and 241-254 range.
    No, I don't think so.
    Quote Quote  
  12. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by rgr View Post
    Originally Posted by hello_hello View Post
    Originally Posted by rgr View Post
    I know this shader but I need 16-255(!) -> 0-255.
    I missed that.

    Does the camera support xvYCC? It uses the 1-15 and 241-254 range.
    No, I don't think so.
    But I found such information on the website.
    https://www-sony-jp.translate.goog/cyber-shot/products/DSC-HX90V/spec.html?_x_tr_sl=au..._x_tr_pto=wapp
    "A model that supports wide color gamut recording of still images/videos and HDMI wide color gamut transmission. Wide color gamut color space refers to still images: sRGB standard (color gamut sYCC), AdobeRGB standard, video: xvYCC standard."
    Quote Quote  
  13. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by rgr View Post
    video: xvYCC standard[/B]."
    But I also found that "It is also supported by some cameras, like Sony HDR-CX405, that does actually tag the video as xvYCC with BT.709 inside Sony's XAVC".

    But I don't record in XAVC.
    Quote Quote  
  14. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by rgr View Post
    Originally Posted by jagabo View Post
    Originally Posted by rgr View Post
    I know this shader but I need 16-255(!) -> 0-255.
    Attached is a shader for that. The trick is getting the rest of the system not to clamp the range first. And then everything else displays with the wrong levels.
    Thanks. I will try.
    Unfortunately, it doesn't work as it should.

    File: should-be - This is what it should look like.
    File: filter-on - this is what it looks like after the shader
    File: filter-off - range 16-235 - superbrights (235-255) removed

    Shader installed as DX11 after scaling.
    Image Attached Images      
    Quote Quote  
  15. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Histogram:
    Image Attached Images      
    Quote Quote  
  16. Originally Posted by rgr View Post
    Originally Posted by rgr View Post
    Originally Posted by jagabo View Post
    Originally Posted by rgr View Post
    I know this shader but I need 16-255(!) -> 0-255.
    Attached is a shader for that. The trick is getting the rest of the system not to clamp the range first. And then everything else displays with the wrong levels.
    Thanks. I will try.
    Unfortunately, it doesn't work as it should.
    Actually, it does. The problem is the rest of MPCHC and the graphics card driver has to be set up correctly or the levels are clamped even before the shader gets the video. I don't remember exactly what I had to do but I think I had to set (in a few places) the output range to 16-235, or the input range to 0-255. But as I pointed out, if you do that all your other videos will play with the wrong levels.
    Last edited by jagabo; 11th Nov 2022 at 11:32.
    Quote Quote  
  17. Originally Posted by flashandpan007 View Post
    Can you please upload a short sample file straight from your camera? I am curious about the videofile specs. Doesn't matter what is in the video of course, just a 15 seconds clip.
    Again, need sample file
    Quote Quote  
  18. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by jagabo View Post
    Actually, it does. The problem is the rest of MPCHC and the graphics card driver has to be set up correctly or the levels are clamped even before the shader gets the video. I don't remember exactly what I had to do but I think I had to set (in a few places) the output range to 16-235, or the input range to 0-255. But as I pointed out, if you do that all your other videos will play with the wrong levels.
    I don't see a way to set the player's input range to 0-255 (MPC-HC, MPC-BE).
    Quote Quote  
  19. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by flashandpan007 View Post
    Originally Posted by flashandpan007 View Post
    Can you please upload a short sample file straight from your camera? I am curious about the videofile specs. Doesn't matter what is in the video of course, just a 15 seconds clip.
    Again, need sample file
    https://files.fm/u/h56e6pvjy
    Quote Quote  
  20. Originally Posted by rgr View Post
    Originally Posted by jagabo View Post
    Actually, it does. The problem is the rest of MPCHC and the graphics card driver has to be set up correctly or the levels are clamped even before the shader gets the video. I don't remember exactly what I had to do but I think I had to set (in a few places) the output range to 16-235, or the input range to 0-255. But as I pointed out, if you do that all your other videos will play with the wrong levels.
    I don't see a way to set the player's input range to 0-255 (MPC-HC, MPC-BE).
    Unfortunately, not all programs/drivers use the same terminology. Limited, Full, 0-255, 16-235, and they may be referring to the source or the output.

    I'm using the integrated graphics built into my Intel CPU. For its driver he setting is here:

    Image
    [Attachment 67572 - Click to enlarge]


    Note there are different controls for the Desktop vs. Video -- I'm changing settings on the video tab here. I normally use the "Limited" setting because virtually all sources are limited range (DVD, BD, streaming services, etc.). I had to change it to the "Full" setting to prevent the levels being changed before the Shader in MPCHC. This may also depend on what output device you are using and whether or not you are using GPU decoding.

    Here's the shader in action:

    Image
    [Attachment 67573 - Click to enlarge]


    The numbers in the chart refer to the Y values before being converted to RGB for display. You can see that all values at and below 16 are full black (R=G=B=0). But at the bright end of the scale you can differentiate the bars above Y=235. Actually, the picture at the high end is a little too bright. You may need to adjust the values a bit.

    Sample video attached.
    Image Attached Files
    Last edited by jagabo; 11th Nov 2022 at 17:53.
    Quote Quote  
  21. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Unfortunately, there is no such option in the Radeon application.
    But I was hoping something like this could be done at the application/decoder level.
    Quote Quote  
  22. Originally Posted by rgr View Post
    Unfortunately, there is no such option in the Radeon application.
    Are you running the full driver/applet from AMD/ATI? Microsoft's drivers are often minimalist.

    Originally Posted by rgr View Post
    But I was hoping something like this could be done at the application/decoder level.
    I already gave you one in my first reply in this thread.
    Last edited by jagabo; 14th Nov 2022 at 08:10.
    Quote Quote  
  23. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by jagabo View Post
    Originally Posted by rgr View Post
    But I was hoping something like this could be done at the application/decoder level.
    I already gave you one in my first reply in this thread.
    Yes, I know. But it doesn't work as it should, because the 235-255 range is removed first, and then the brightness is corrected. I get grayish instead of white.
    Quote Quote  
  24. It works for me:

    Image
    [Attachment 67627 - Click to enlarge]


    Maybe you need to change some other setting in the program.
    Quote Quote  
  25. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Ah, it works. I was mistakenly changing brightness instead of contrast.
    The image is a bit brighter overall (luma 115* vs 117), but it is enough for viewing.
    Thanks.

    (I changed the contrast to -9 and it's a bit better now - luma 115 vs 114.6).

    * - I made a pattern with the ffmpeg filter curves=master='0.0625/0 1/1'
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!