Spikes in histogram?
1 Attachment(s)
Following a PAL VHS capture using VDub 1.9.11 to a Lagarith Avi file I am using AviSynth to slightly adjust Levels and noticed in the histogram some spikes in the luma.
Are these spikes a tell tale sign of something not right in the capture? |
Probably the infamous auto gain control (AGC) kicking in ? whatever card/ dvd recorder you are using try to disable it, always capture "flat".
|
My hardware is VCR -> composite -> ES10 -> SVideo -> Diamond VC500USB. I have been careful to capture within legal range. The only setting I adjusted before capture was to nudge the Brightness value up (after temporarily cropping and viewing the histogram in VDub), on the ProcAmp tab.
On the ES10 I have Comb Filter On, DNR Off. |
What OS?
It's unusual for VC500 to limit the output to 16-235 for NTSC, but maybe this is normal for PAL? Been a long time since I've looked at people's PAL samples from one. Histogram spikes typically happen when one adjusts the driver Proc Amp (aka VDub Levels) controls from default, but again I don't recall this being an issue with my own VC500... |
1 Attachment(s)
The spiky histograms happen when you change (decrease) the brightness/contrast with procamp or at default procamp settings when the AGC is "playing" with them.
We had a log discussion here: https://forum.videohelp.com/threads/...-if-it-s-right. Some example here (watch output.mp4 video): http://www.digitalfaq.com/forum/vide...am-levels.html It is not really a problem, any basic post-processing remove the pattern (GamMac in this sample): https://forum.videohelp.com/threads/...It#post2615773 Attachment 15074 Quote:
|
I am using Windows 10.
Lollo I was reading another long thread in these forums "My 2nd captures: Luminance levels, distortion?", where you advised never to expand the range using the software Proc Amp. I have just done another test capture with default Proc Amp, but still getting the spikes. However, calling Histogram("levels") after QTGMC or TemporalDegrain2 appears to smooth out the Histogram. I'm not sure if that is only hiding the 'defect' and I should be obtaining a capture without spikes? Or if these filters should genuinely be used to resolve the spikes. My VC500USB does occasionally limit capture to >16 in the VDub Histogram (and appears to affect the captured file), but this can be fixed by restarting the PC/unplugging and re-connecting it. |
Quote:
Quote:
Quote:
Quote:
Quote:
|
I have unplugged and reconnected the VC500 to allow it to capture within it's full range. My earlier attempt was done when the VC500 played up and created a hard border at Y=16. Someone else in these forums has mentioned this happens occassionally with their VC500.
Knowing now that there are gaps/spikes in the Histogram, even if leaving the VDub Proc Amp at default settings, I decided I would rather have correct (legal) levels as much as possible but without 'expanding' them for the capture. I have only adjusted the Brightness in the Proc Amp tab to shift the levels towards the right in the VDub histogram (with a slight overspill into the red at the left). Having just recaptured the tape and checking in AviSynth using ColorYUV(analyze=true) it is showing min and max luma between 10 and 244 (after cropping 20 pixels off all borders). The Loose Min and Loose Max are around 20 to 230. Is this the correct way to use Levels to increase the range:- Code:
Levels(20, 1.0, 230, 16, 235, coring=false, dither=true) |
Quote:
Quote:
Quote:
Code:
Levels(10, 1.0, 244, 16, 235, coring=false, dither=true)
|
Quote:
Histogram having "spikes" is something that happens on many capture devices, not just this one. It's someting to do with how brightness/contrast settings are handled by the card as noted. |
Quote:
Code:
ConvertToRGB(matrix="PC.601") |
Yes, also possible ;)
Edit: Levels add you the option to adjust the "look" on the fly if needed, although sometimes is better to do the brightness/contrast/color adjustemens after the filtering |
2 Attachment(s)
I should mention my final delivery is always H.264 in an MP4 container, produced using command line ffmpeg. I have a small PC connected to my Smart TV and use VLC to play all files. So I think I should always be aiming for broadcast levels 16 to 235 for my final output.
I have used the Minimum and Maximum luma values (10 and 245) in the Levels filter and things are looking better, but were still looking a bit compressed/'lacking in height' when viewing the Histogram("levels"). So I used Tweak to adjust the brightness and contrast to occupy more 'height' in the Histogram. The scene in the screenshots attached is difficult because of the window in the background, but do my Histograms look healthy here? Is it best practice to play with brightness and contrast until the levels are touching the floor and the ceiling in the classic histogram (waveform?) whilst ensuring no obvious clipping is occuring? This approach seems to bring out a richer picture. From my understanding of the Levels filter I just need to insert the Minimum and the Maximum luma values obtained from analyzing the captured clip, leave gamma at 1.0, always use 16 and 235 for Output Minimum and Output Maximum respectively, always use coring=false and dither=true. Also from my limited understanding of the Levels filter it would only affect the chroma if processing in RGB or altering the gamma value? My source is YUY2 and I am not making any conversions to RGB (as far as I can tell). No processing is done in VDub either. Lollo thanks for the script but I could not understand how to use it AviSynth. My script is this now, although I have to say I am not seeing any noticeable benefit of calling TemporalDegrain2 and LSFmod on this video, especially given the additional rendering time it will add. I have left them there in case you ca advise me if I have all fliters being called in the correct sequence. Code:
SetFilterMTMode("QTGMC", 2) My ffmpeg line is now Code:
ffmpeg64 -i "VHS.avs" -c:v libx264 -preset slower -crf 18 -colorspace bt470bg -color_primaries bt470bg -color_trc gamma28 -aspect 4:3 -c:a aac -b:a 128k "VHS.mp4" |
Quote:
Quote:
Quote:
Quote:
Just remove the unnecessary ConvertToYUY2(interlaced=false) at the end. Experiment also a Tweak() at the end instead at the beginning. And check the levels with an Histogram after the processing. They should be now 0-255 (because QTGMC). Experiment if moving them back to 16-235 improves or not the display on your SmartTV Not sure that the colors parameters are necessary in your ffmpeg command line, otherwise ok |
I cannot call Ylevels (I am using AviSynth+ if that matters). I downloaded Ylevels from the AviSynth External Filters page, placed the file as Ylevels.avsi into the plugins+ and plugins64+ directories, but AviSynth+ displays an error.
Also, Lollo I don't know how to run your scripts and LevelsLumaOnly mentioned in post#9. Can you guide me on how to install those please. At the end of my script I had used ConvertToYUY2(interlaced=false) because earlier I had used TemporalDegrain2 and LSFmod which required a conversion to YV12 from my YUY2 source. I included (interlaced=false) because QTGMC would have deinterlaced the file by this point. I have Histogram("classic") orientated horizontally and positioned above the video. It would be usfeul if I could display at the same time the Histogram("classic") to the right. I tried but failed with this:- Code:
TurnRight().Histogram("classic").TurnLeft() Finally, I added those colour parameters to the ffmpeg line to ensure the video is tagged with the BT.609 in Media Info. If you know much about this then ideally I want to tag it as colour system "I" not "B/G". That is probably only a minor difference, but for accuracy it would be good to know if that is possible. |
Quote:
Code:
function Levels_mod(clip c, int "input_low", float "gamma", int "input_high", int "output_low", int "output_high", bool "coring", bool "dither") Quote:
Code:
# Classic Histogram and Levels Histogram |
1 Attachment(s)
Thanks Lollo, it is really useful to see both the Classic and Levels Histograms simultaneously.
I had to add ConvertToYV12 just before calling ClassicAndLevelsHistogram(), but your script is working a treat. I am not familiar with Functions in AviSynth......do Functions need to be placed at the beginning of the script, and then called where required? If I placed a function within the sequence of scripts it did not run when I called it. I will do some more reading on this. I have learned plenty over this weekend, thanks to your help!. Certainly I will be able to proceed with capturing more tapes in confidence with the settings I am making and now have a better understanding of how to carry out basic filtering correctly. |
Did some testing with my "VC500CXT" model on Win10 today.
Can confirm:
Quote:
Quote:
Quote:
|
That's interesting the Contrast setting at 5928 eliminates the spikes in the capture Histogram. As the spikes don't seem to affect the captured file and are easily removed with simple filtering I leave Contrast, Saturation and Hue at default (4992), Sharpness at 0 and only adjust Brightness to centre the capture histogram.
I did 3 tests with the Brightness setting adjusted for lower, higher and then centralised levels in the capture histogram. Checking the captured files in AviSynth my VC500 is capturing from 0 to 254. As a routine now, before temporary cropping and capture Histogram check, I always make sure the VC500 is not clipping at <16. |
Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.