View Full Version : Finding and fixing green fields from capture
juhok
17th December 2008, 18:31
Hi,
I have some videos with a lot of green fields caused by errors in the capture (bad tape), some are consecutive but most just 1 field at a time. Sample (Huffyuv, YV12) (http://www.siluriformes.net/mm/green_field.avi)
I've ordered external TBC long time ago but still haven't got it and I have to cap these before xmas (even if TBC would help).
Only thing that bothers me is the green color. I wouldn't mind if it was black or previous field repeated. Flashing green just isn't nice. :(
I've found some old scripts that might help. But I'm not 100% there yet. So if someone has/had similar problems, could you please share your solution(s). :thanks:
MadRat
18th December 2008, 06:52
I suppose you could use FreezeFrame. It works like this FreezeFrame(firstframenumber, lastframenumber, sourceframenumber). So like you could do
AVISource("green_field.avi")
#freezeframe(2,3,1)
#freezeframe(4,4,5)
There would be a little twitch in the video as it paused for a 30th of a second, but it would look better than a couple of badly messed up green frames and finding and replacing all those frames might be a lot of work.
MadRat
18th December 2008, 06:53
uh... sorry take the # off of the freezeframe, that's a comment command :rolleyes:
thetoof
18th December 2008, 07:06
For some reason your clip crashes vdub (I guess it's a problem on my side), but until I fix it, could you upload the same sample in Lagarith?
juhok
18th December 2008, 07:09
@MadRat; Yeah, but there's slight problem.. I'd need to do this in an automated fashion. :)
So far I've used Fudoh's script (http://forum.doom9.org/showthread.php?p=837106#post837106)#
# dropout.avs
#
# settings
global dir = "d:\temp\"
global infile = dir + "Capture_20060605-134049.avi"
global logfile = dir + "test.log"
# code
clip = AviSource(infile).ConvertToYV12
WriteFileIf(clip, logfile, "(UDifferenceFromPrevious>20)", "current_frame", """ ":" """, "UDifferenceFromPrevious")
WriteFileStart(logfile, """ "Start" """, append = false)
WriteFileEnd(logfile, """ "End" """) + trimmaker. But this aproach still requires a lot of human interaction.
juhok
18th December 2008, 07:16
For some reason your clip crashes vdub (I guess it's a problem on my side), but until I fix it, could you upload the same sample in Lagarith?Are you using old Huffyuv standalone? Mine is "ffdshow one" and they don't always work together well. Here's lagarith version. (http://www.siluriformes.net/mm/green_field_lagarith.avi)
juhok
19th December 2008, 00:41
Well, I managed to do this after a lot of trial and error (yeah I suck at scripting, this is almost identical to the example in the manual).
AssumeTFF()
SeparateFields()
Crop(12,0,-12,-10)
ConditionalFilter(last, last.Levels(0,1,255,0,0), last, "AverageChromaU()", "==", "7", false) # Chroma U / V are constant 7
AddBorders(12,4,12,6)
Weave()
I'd like to replace that Levels(0,1,255,0,0) with FreezeFrame(current, current, current-1) .. but haven't figured out how, yet.:scared:
Gavino
19th December 2008, 16:57
I'd like to replace that Levels(0,1,255,0,0) with FreezeFrame(current, current, current-1) .. but haven't figured out how, yet.:scared:
Replace it by Loop(2, 0, 0) to get the effect you want (ie to repeat previous frame).
juhok
19th December 2008, 17:48
Works like a charm. Thanks!
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.