Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 17th December 2008, 18:31   #1  |  Link
juhok
Registered User
 
juhok's Avatar
 
Join Date: Dec 2005
Posts: 110
Finding and fixing green fields from capture

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)

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).
juhok is offline   Reply With Quote
Old 18th December 2008, 06:52   #2  |  Link
MadRat
Registered User
 
MadRat's Avatar
 
Join Date: Jan 2008
Posts: 110
I suppose you could use FreezeFrame. It works like this FreezeFrame(firstframenumber, lastframenumber, sourceframenumber). So like you could do

Quote:
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 is offline   Reply With Quote
Old 18th December 2008, 06:53   #3  |  Link
MadRat
Registered User
 
MadRat's Avatar
 
Join Date: Jan 2008
Posts: 110
uh... sorry take the # off of the freezeframe, that's a comment command
MadRat is offline   Reply With Quote
Old 18th December 2008, 07:06   #4  |  Link
thetoof
Sleepy overworked fellow
 
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
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?
__________________
AnimeIVTC() - v2.00
-http://boinc.berkeley.edu/-
Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p)
thetoof is offline   Reply With Quote
Old 18th December 2008, 07:09   #5  |  Link
juhok
Registered User
 
juhok's Avatar
 
Join Date: Dec 2005
Posts: 110
@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
Code:
#
# 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 is offline   Reply With Quote
Old 18th December 2008, 07:16   #6  |  Link
juhok
Registered User
 
juhok's Avatar
 
Join Date: Dec 2005
Posts: 110
Quote:
Originally Posted by thetoof View Post
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.
juhok is offline   Reply With Quote
Old 19th December 2008, 00:41   #7  |  Link
juhok
Registered User
 
juhok's Avatar
 
Join Date: Dec 2005
Posts: 110
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).

Code:
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.
juhok is offline   Reply With Quote
Old 19th December 2008, 16:57   #8  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,407
Quote:
Originally Posted by juhok View Post
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.
Replace it by Loop(2, 0, 0) to get the effect you want (ie to repeat previous frame).
Gavino is offline   Reply With Quote
Old 19th December 2008, 17:48   #9  |  Link
juhok
Registered User
 
juhok's Avatar
 
Join Date: Dec 2005
Posts: 110
Works like a charm. Thanks!
juhok is offline   Reply With Quote
Reply

Tags
analog, capture, error, field, green

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 14:00.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.