I'm working on restoring DV cam footage and dealing with overexposed (or 'overburned') white areas where details have disappeared. Robot "o1-preview" shared the guide below on how to address this issue using AviSynth and VirtualDub2. I wanted to ask: does this information look accurate and relevant to the task? Are there any other techniques or plugins I should consider?
Thanks in advance for your help!
The guide:
Restoring lost details in overexposed, or "overburned," white areas in DV cam footage can be challenging, especially if the details are clipped (i.e., the sensor data is saturated, and there's no information recorded in those areas). However, using AviSynth and VirtualDub2 (vd2), you can apply certain filters and techniques to enhance these regions and attempt to recover some details or at least improve their appearance.
Here's a step-by-step guide to help you restore details in overexposed areas using AviSynth:
1. Understand the Limitations
Before we begin, it's important to acknowledge that if the overexposed areas are completely clipped (pure white with no detail), it's impossible to recover the original details since they were never recorded. However, we can use image processing techniques to bring back some apparent detail or reduce the starkness of the overexposed regions.
2. Load Your Video in AviSynth
First, create an AviSynth script to load your DV footage:
avisynth
Copy
AVISource("path_to_your_video.avi")
ConvertToYV16() # Ensure the color space is compatible with certain plugins
3. Use Dynamic Range Compression Filters
These filters adjust the image's dynamic range, bringing down the highlights and lifting the shadows.
Option A: HDRAGC
The HDRAGC plugin performs automatic gain control to adaptively adjust brightness and contrast.
Download HDRAGC Plugin:
You can find HDRAGC here: HDRAGC Plugin
Add HDRAGC to Your Script:
avisynth
Copy
AVISource("path_to_your_video.avi")
ConvertToYV16()
HDRAGC(coef_gain=1.0, coef_sat=1.0, min_gain=1.0, max_gain=4.0, avg_lum=128)
Notes:
coef_gain: Adjusts the gain coefficient. Increase it to enhance details in highlights.
coef_sat: Adjusts color saturation during processing.
min_gain and max_gain: Set the range of gain adjustments.
avg_lum: The target average luminance.
Experiment with the parameters to see what gives the best result for your footage.
Option B: SmoothAdjust
SmoothAdjust provides smoother levels adjustments, which can be helpful for preserving gradients.
Download SmoothAdjust Plugin:
Available here: SmoothAdjust Plugin
Add SmoothAdjust to Your Script:
avisynth
Copy
AVISource("path_to_your_video.avi")
ConvertToYV16()
SmoothLevels(0, 1.0, 255, 16, 235, protect=6)
Notes:
protect: Helps to protect the highlights and shadows from clipping.
Option C: ExposureTools
ExposureTools offers advanced controls for exposure adjustments.
Download ExposureTools Plugin:
Available here: ExposureTools Plugin
Add ExposureTools to Your Script:
avisynth
Copy
AVISource("path_to_your_video.avi")
ConvertToYV16()
ExTools_HighlightRecovery(strength=0.5, threshold=230)
Notes:
strength: Controls how much adjustment is applied.
threshold: Sets the luminance level above which the filter operates.
4. Use Masking Techniques
By creating masks for the overexposed areas, you can selectively apply filters only where needed.
Creating a Highlight Mask:
avisynth
Copy
AVISource("path_to_your_video.avi")
ConvertToYV16()
# Create a mask for bright areas
bright_mask = mt_binarize(threshold=235).mt_invert()
# Apply a filter only to bright areas
filtered = last.HDRAGC(coef_gain=1.5)
Overlay(last, filtered, mask=bright_mask)
Notes:
mt_binarize: Creates a binary mask where all pixels above the threshold are white.
mt_invert: Inverts the mask so that overexposed areas become the target.
Overlay: Applies the filtered result over the original footage using the mask.
5. Fine-Tune with Levels and Curves
You can adjust the overall levels to bring back some details.
avisynth
Copy
AVISource("path_to_your_video.avi")
ConvertToYV16()
Levels(0, 0.8, 255, 0, 255, coring=false)
Notes:
The gamma parameter (second value, 0.8 in this case) adjusts the midtones.
Lowering the gamma can help to darken highlights.
6. Consider DeClip or DeBand Filters
If the overexposed areas have slight details that are just hard to see, DeClip filters can sometimes reconstruct clipped regions.
Download DeClip Plugin:
Available here: DeClip Plugin
Add DeClip to Your Script:
avisynth
Copy
AVISource("path_to_your_video.avi")
ConvertToYV16()
DeClip(level=235)
Notes:
level: Sets the clipping threshold.
7. Process in Higher Bit Depth
Processing in higher bit depth can help preserve details during adjustments.
avisynth
Copy
AVISource("path_to_your_video.avi")
ConvertBits(16) # Convert to 16-bit processing
# Apply filters here
ConvertBits(8) # Convert back to 8-bit for output
+ Reply to Thread
Results 1 to 4 of 4
-
-
You may add Retinex to your collection.
https://github.com/Asd-g/AviSynth-Retinex
+ adding a luma mask can help to improve the result.Last edited by Sharc; 15th Dec 2024 at 18:27.
-
@Selur It looks like that the concept of DeClip may have been "generated creatively". Sorry about that.
Similar Threads
-
Are Potplayer open codecs still relevant/necessary
By halserrano in forum Software PlayingReplies: 1Last Post: 4th Feb 2024, 15:24 -
Help with restoring old VHS concert broadcast TV footage
By paul92 in forum RestorationReplies: 17Last Post: 25th Jan 2024, 00:44 -
is there a way to recover overexposed footage
By marcorocchini in forum Newbie / General discussionsReplies: 3Last Post: 16th Sep 2023, 08:42 -
Restoring/ compensating overexposed, heavily clouded weather, video's
By Rockel83 in forum RestorationReplies: 35Last Post: 25th Jul 2022, 18:13 -
Sync problem restoring damaged footage
By ultradj83 in forum RestorationReplies: 3Last Post: 31st May 2020, 20:06