Audit for 0 vs 16 levels

Former user wrote on 9/3/2014, 5:28 PM
We are having our bimonthly discussion on color space in another thread, but I was curious about a plugin or script that might help with this issue.

Say I have a camera that shoots 16-235 space. Normally, I would put a black track on the bottom at 16 so that any fades would still be within this color space. But I find sometimes transitions may default to a 0 black. (like fade to color) and I might miss it or I might have a still that has full range. Other than using a filter on the whole project, is there a script or plugin that will audit the project and tell me I have some elements that might be out of the 16-235 colorspace? Can one be developed?

Comments

johnmeyer wrote on 9/3/2014, 5:48 PM
... is there a script or plugin that will audit the project and tell me I have some elements that might be out of the 16-235 colorspace? Can one be developed? It would be fairly trivial to create a script, using AVISynth and the RT_Stats plugins, that would scan all frames in a project and look for luma values that are beyond a certain number. I could do this in a few minutes.

However ...

The real challenge is deciding what you would really want this script to do. For instance, do you want to look for ALL out of gamut pixels, or are you only worried if a large block goes beyond the threshold(s)? When something is out of line, do you simply want to create markers that you can use to point to the problem area, or do you want some sort of automatic modification of the video itself?

To give you some idea of the power in this RT_Stats package, this following is a restoration (I've showed this before) where I had to keep track of the average luma on each and every scan line, and then make adjustments when a series of scan lines had an average luma brighter than the lines above it:



Two of the functions in the package give you pretty much what you are asking for: what is the maximum luma of all pixels in a frame, and what is the minimum luma for all pixels in the frame. All that is required is an "if...then" statement which says "if the luma is above or below the thresholds, output the frame number into a text file." You would then load this text file into the Edit Details window, and this would create markers at these points. You could then go investigate the problem areas.


Marco. wrote on 9/3/2014, 5:53 PM
See -> here.
Former user wrote on 9/3/2014, 6:28 PM
Johnmeyer, I know you are strong advocate of AVISynth. I have never used it so am not sure of its power or ease of use.

My idea for the script would be:

1) I enter the limits for Black and White. Say I want to know all points where black goes below 16 or whites go above 235.

2) Project would be scanned and a report generated showing me at what timecodes (or event names) this parameters were met.

3) This report would be at the event level, since generally it would be a camera shot or graphic that would be out of range (or even a gap in the timeline if, for instance, my 16 black track did not go long enough)

then this would allow me to determine if I should treat them on an event level or project level. I would not want an automatic fix. Don't think it would be necessary in this particular case.

But for ease of use, my preference would be a script run within Vegas that does not make me go to the command line structure of AVISynth.

Of course, this is my ideal situation. I do not write scripts and as I said do not know AVISynth so I don't know how trivial this is.
Former user wrote on 9/3/2014, 6:30 PM
Marco,

I remember that thread and your contribution, but as I understand to use the zebra system you created, I would need to do a visual check of the entire project. I am seeking an audit system similar to how some apps are determining gaps in the timeline or repeated scenes.
NormanPCN wrote on 9/3/2014, 7:09 PM
I think you will have to do a scan of the rendered file to truly catch all problems. Like the AviSynth suggestion.

To use your example, one can catch a fade to color parameter out of range in an audit script/extension. OFX plug-ins should be accessible. Effects and transitions are computations and can result in something out of 16-235 range. An audit script/extension cannot catch these problems.
Former user wrote on 9/3/2014, 7:23 PM
Norman, I understood Johnmeyers to say it would scan a project. Maybe I misunderstood. Effects and transitions would still contain events, which is what the script would be looking at.
johnmeyer wrote on 9/3/2014, 7:24 PM
But for ease of use, my preference would be a script run within Vegas that does not make me go to the command line structure of AVISynth.It might be possible to do something similar to what I did years ago for the Deshaker script. That script actually consisted of quite a few moving parts, but once everything was installed and working, you just selected the events you wanted to evaluate, clicked on a button to invoke the script, and everything else happened automatically, without further user interaction.

I could re-use some of that code, but this time have it feed the frameserver video (I think I can script this) into an AVISynth script that would then be opened and run by VirtualDub. The script would then output a text file containing the beginning and end markers for regions where there is a problem. Actually, I could probably figure out a way to simply have it define regions. You would then manually have to import these regions by copy/pasting from the text file (I don't think the Edit Details dialog is scriptable).

Of course, as pointed out in that earlier thread, you can simply use the Secondary Color Corrector to create some sort of "zebra" equivalent, and you can then fast forward through the project looking for problems. I just tried that out, and it took less than fifteen seconds to set up (I applied it to the track). Here are the settings I used:



It would easy to add another one for the low range.

Having done this, I think I prefer to have this sort of display because there are lots of places, at least in the outdoor wedding video I used for testing, where small parts of the white gown go out of gamut, and I might be tempted to leave it alone. Then there are other places where some surgery is required. I don't know how to make a gamut alarm smart enough to capture all the tradeoffs that might make you want to leave some of the problems alone.
Former user wrote on 9/3/2014, 8:28 PM
Johnmeyer,

What you describe in your script would be what I want. I understand using the Secondary Color corrector, but if you have a show of long length, you would have to scrub through for visual and possibly miss something.

My not having an automatic adjustment, the editor could use their own judgment if the event is flagged.

anyway, just my ideas.