Lyris
5th February 2014, 01:20
Hi forum,
I shot an interview last week which was nearly a disaster (thanks to memory card trouble!) - saved by hooking up an external HDMI recorder to my camera's output and recording that way.
One problem: the "white peaking" feature was left on. That's the feature which flashes any near-peak-white areas of the image black every few frames to draw attention to possible overexposure - and it's recorded that way since I was going from the HDMI output.
So, any whites that are near the clipping point flash black. Mercifully, these are not zebra bars like on some cameras, but fully black areas which flash on and off. And, they have totally clean edges and are not blurred. Mercifully also, most of the video is not near the clipping point, so only a small number of highlight pixels are affected.
As a result, I'm thinking it should be possible to use AviSynth to mask out pixels that are 100% black and invert them back. It doesn't matter if it wrecks the background; I can mask that out. Similarly, that peak highlight in the defocused background, for the most part, can just be painted over with white. The main challenge is getting rid of the black flashes around the glasses.
Sample file (Lagarith): http://www.mediafire.com/watch/zyl7cywc1dxapbx/zebra.avi
So far I have this, which has gone some of the way, but I'm not familiar with mt_lut or how to instruct it:
#AVIsource goes at the top
separatefields
unfiltered=last
inverted=unfiltered.invert.DeSaltPepper(opt="salt", tol=-5).DeSaltPepper(opt="salt", tol=-5)
#####################################
#Mask generation
#####################################
g_mask=mt_lut("x 3 >= 255 x 16 <= 0 x 16 - 255 * 255 / ? ?").mt_invert()
#####################################
# Do the actual luma keying
#####################################
mt_merge(unfiltered, inverted, g_mask)
#return g_mask #Debug view
weave
Has anyone run into this problem before?
I shot an interview last week which was nearly a disaster (thanks to memory card trouble!) - saved by hooking up an external HDMI recorder to my camera's output and recording that way.
One problem: the "white peaking" feature was left on. That's the feature which flashes any near-peak-white areas of the image black every few frames to draw attention to possible overexposure - and it's recorded that way since I was going from the HDMI output.
So, any whites that are near the clipping point flash black. Mercifully, these are not zebra bars like on some cameras, but fully black areas which flash on and off. And, they have totally clean edges and are not blurred. Mercifully also, most of the video is not near the clipping point, so only a small number of highlight pixels are affected.
As a result, I'm thinking it should be possible to use AviSynth to mask out pixels that are 100% black and invert them back. It doesn't matter if it wrecks the background; I can mask that out. Similarly, that peak highlight in the defocused background, for the most part, can just be painted over with white. The main challenge is getting rid of the black flashes around the glasses.
Sample file (Lagarith): http://www.mediafire.com/watch/zyl7cywc1dxapbx/zebra.avi
So far I have this, which has gone some of the way, but I'm not familiar with mt_lut or how to instruct it:
#AVIsource goes at the top
separatefields
unfiltered=last
inverted=unfiltered.invert.DeSaltPepper(opt="salt", tol=-5).DeSaltPepper(opt="salt", tol=-5)
#####################################
#Mask generation
#####################################
g_mask=mt_lut("x 3 >= 255 x 16 <= 0 x 16 - 255 * 255 / ? ?").mt_invert()
#####################################
# Do the actual luma keying
#####################################
mt_merge(unfiltered, inverted, g_mask)
#return g_mask #Debug view
weave
Has anyone run into this problem before?