VideoHelp Forum
+ Reply to Thread
Results 1 to 17 of 17
Thread
  1. Hi,

    Is there a way to determine what the Luminance levels are set to a particular video file? I would like to know if it's set to 16-235 or 0-255. I tried MediaInfo but didn't see it listed.

    Thanks!
    Quote Quote  
  2. You can use Histogram() or VideoScope() in an AviSynth script. Sony Vegas has a waveform monitor.
    Quote Quote  
  3. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    Even if such information was imbedded explicitly in a video file, that's no assurance that the creator adhered to the standard range. Most people don't. They aren't even aware that such standards exist.
    Last edited by sanlyn; 19th Mar 2014 at 11:46.
    Quote Quote  
  4. Originally Posted by jagabo View Post
    You can use Histogram() or VideoScope() in an AviSynth script. Sony Vegas has a waveform monitor.
    I use both AviSynth script and sony vegas pro 10, and will take a look at the waveform monitor.

    Thanks jagabo!
    Quote Quote  
  5. Originally Posted by sanlyn View Post
    Even if such information was imbedded explicitly in a video, that's no assurance that the creator adhered to the standard. Most people don't. They aren't even aware that such standards exist.
    This is one of the things I'm trying to learn. When should 16-235 or 0-255 be set in video? In the past I've always taken the default.

    Thanks!
    Quote Quote  
  6. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    I think you're under the impression that there's some sort of autocolor or autogain limiters involved in video encoding. Luma and chroma levels are elements that you have to check and adjust yourself in your own processing. I have seen some software that specifies a colorspace (such as BT609, etc.), but that still doesn't mean that the actual values used in the video will comply with those ranges.

    The published standard is RGB 16-230 (luma) and RGB 16-240 (chroma) for what is called "broadcast standard" video used in commercial broadcasting and DVD/BD production, or RGB 0-255 for PC-only display. Regardless of which final display criteria you're after, you have to insure that your output doesn't have crushed darks and clipped brights that lie outside those specs. Neither the encoder nor the display device decoders will correct for haywire luma or chroma values.
    Last edited by sanlyn; 19th Mar 2014 at 11:47.
    Quote Quote  
  7. Video should almost always be Y=16-235. If you want a traditional horizontal waveform monitor with Histogram() use:

    Code:
    TurnRight().Histogram().TurnLeft()
    Click image for larger version

Name:	hist.png
Views:	716
Size:	73.2 KB
ID:	21561

    I usually prefer VideoScope() but Histogram does mark the illegal luma areas (Y<16, Y>235) with yellow bars.
    Quote Quote  
  8. would be interesting to know if there's an automated option to do the identification (maybe using ffmpeg or something similar,..)

    I remembered something, how about calling: (with the path adjusted)
    Code:
    ffplay -i "PATH TO SOURCE"  -vf "split[a][b];[a]format=gray,histogram=mode=waveform:waveform_mode=column,vflip,split[c][d];[b]pad=iw:ih+256[padded];[c]geq=g=1:b=1[red];[d]geq=r=1:b=1,crop=in_w:220:0:16[mid];[red][mid]overlay=0:16[wave];[padded][wave]overlay=0:H-h"
    source: https://trac.ffmpeg.org/wiki/FancyFilteringExamples#waveform
    this should show a colored histrogram in waveform.
    green = colors are inside TV scale (15-235)
    red = colors are inside PC scale (0-255)

    this isn't automatic but it's may be more intuitive,...
    (does anyone know a way to output the histogram to the command line?)
    Image Attached Thumbnails Click image for larger version

Name:	colorDetect.png
Views:	623
Size:	257.8 KB
ID:	21562  

    Last edited by Selur; 3rd Dec 2013 at 09:41.
    Quote Quote  
  9. Originally Posted by Selur View Post
    would be interesting to know if there's an automated option to do the identification (maybe using ffmpeg or something similar,..)
    I don' t think there is an "automated" solution that scans the entire file.

    The waveform monitors only measure at a single point in time . So if you measure at time "x" there might be 16-235 Y' data, but at time "x+1" there might be 0-255 Y' data



    ffmpeg has -vf histogram , so you can use ffplay to see the chart in realtime . Unfortunately there are no markings . There is also a vectorscope mode, and a levels mode (like histogram("Levels") in avisynth)

    http://ffmpeg.org/ffmpeg-filters.html#histogram

    e.g
    Code:
    ffplay -i "input.ext" -vf "histogram='mode=waveform':'waveform_mode=column'"
    Or you can "print" it out using ffmpeg to a still image

    Most NLE's don't use a 0-255 scale, they measure by a 0-100 IRE scale



    EDIT: I didn't see your edit selur, that's a nice way to do it below the image
    Image Attached Thumbnails Click image for larger version

Name:	vf histogram waveform.png
Views:	765
Size:	11.6 KB
ID:	21564  

    Click image for larger version

Name:	vf histogram levels.png
Views:	584
Size:	4.6 KB
ID:	21565  

    Image Attached Images  
    Quote Quote  
  10. like I wrote in my post before (edited it before you had posted your post ), question is:

    Is there a way to output the histogram to the stdut or to a file?
    Quote Quote  
  11. Originally Posted by Selur View Post
    like I wrote in my post before (edited it before you had posted your post ), question is:

    Is there a way to output the histogram to the stdut or to a file?

    Just use ffmpeg (instead of ffplay) to output an image sequence . Is that what you're asking ?
    Quote Quote  
  12. No, I want the histogram values not images.
    *gig* I thought about this before: https://forum.videohelp.com/threads/355566-Histogram-TV-PC-range-min-max

    If I got the values in a file or a command line I could write a small tool which:
    a. calls ffmpeg/ffplay/... to analyse the source and output the data
    b. take the data and output if the source is probably TV or PC scale

    Cu Selur
    Quote Quote  
  13. I see, as a text file or spreadsheet

    Maybe avisynth's coloryuv(analyze=true) with writefile() ? coloryuv(analyze=true) shows min/max/avg values . Maybe YPlane Min / Max with conditionalfilter() and writefile() ?

    Not sure if this will help
    http://forum.doom9.org/showthread.php?t=154414
    Quote Quote  
  14. Maybe avisynth's coloryuv(analyze=true) with writefile() ? coloryuv(analyze=true) shows min/max/avg values . Maybe YPlane Min / Max with conditionalfilter() and writefile() ?
    might work, but would prefer ffmpeg since that can be used cross platform
    Quote Quote  
  15. Personally, I wouldn't trust an automated solution that looks for high and low luma values. Too many 16-235 videos have overshoots that would make that unreliable. Even with ColorYUV's "loose" values.
    Quote Quote  
  16. Sure you would use some heuristic based on the number of luma values which are in PC and not TV range, but first thing would be to have some data to analyse.
    Quote Quote  
  17. Originally Posted by Selur View Post
    Sure you would use some heuristic based on the number of luma values which are in PC and not TV range, but first thing would be to have some data to analyse.
    Perhaps:
    https://ffmpeg.org/ffprobe-all.html#signalstats-1

    Code:
    @ffmpeg -v 32 -stats -i "%1" -vf:? "signalstats,metadata=print:file='v.%~n1.txt'" -af:? "astats=metadata=1:reset=1,ametadata=print:file='a.%~n1.txt'" -f null - > "av.%~n1.txt" 2>&1
    Last edited by pandy; 8th Nov 2018 at 12:01.
    Quote Quote  



Similar Threads

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