Skip to content

Commit

Permalink
enable detecting information output
Browse files Browse the repository at this point in the history
  • Loading branch information
gnaggnoyil committed Jun 7, 2013
1 parent ace1323 commit 70bcc3d
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions VAutoDeint.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,22 @@ def __get_field_type(self,field_dataB,field_dataT):
return "FieldOrder_BFF"
return "FieldOrder_UNKNOWN"

def autoDeintDetect(self,clip):
def autoDeintDetect(self,clip,info=False,infoOutput=sys.stderr):
tot_frames=clip.num_frames
diff=self.deintconf.PlaneDifferenceFromPrevious(clip,0,prop="YPlaneDifference")
IsCombedTIVTCClip=self.deintconf.IsCombedTIVTC(clip);
IsCombedTIVTCClip=self.deintconf.IsCombedTIVTC(clip)
motion_data=[]
comb_data=[]
for i in range(tot_frames):
motion_data.append((diff.get_frame(i).props.YPlaneDifference[0]>=1.0))
comb_data.append(bool(IsCombedTIVTCClip.get_frame(i).props._IsCombedTIVTC[0]))
if info:
for i in range(tot_frames):
motion_data.append((diff.get_frame(i).props.YPlaneDifference[0]>=1.0))
comb_data.append(bool(IsCombedTIVTCClip.get_frame(i).props._IsCombedTIVTC[0]))
print("\rcollecting motion and comb data...%d of %d completed." %(i,tot_frames),end="",file=infoOutput)
print(file=infoOutput)
else:
for i in range(tot_frames):
motion_data.append((diff.get_frame(i).props.YPlaneDifference[0]>=1.0))
comb_data.append(bool(IsCombedTIVTCClip.get_frame(i).props._IsCombedTIVTC[0]))
"""check for interlace type"""
sectionLength=self.SECTION_LENGTH
numSections=tot_frames//sectionLength
Expand Down Expand Up @@ -222,13 +229,25 @@ def maxandmax(list):
tot_frames=abff.num_frames
field_dataB=[]
diff=self.deintconf.PlaneDifferenceFromPrevious(abff,0,prop="YDifferencePrevious")
for i in range(tot_frames):
field_dataB.append(diff.get_frame(i).props.YDifferencePrevious[0]);
if info:
for i in range(tot_frames):
field_dataB.append(diff.get_frame(i).props.YDifferencePrevious[0])
print("\rcollecting bff field difference data...%d of %d completed." %(i,tot_frames),end="",file=infoOutput)
print(file=infoOutput)
else:
for i in range(tot_frames):
field_dataB.append(diff.get_frame(i).props.YDifferencePrevious[0])
atff=self.std.SeparateFields(clip,tff=True)
field_dataT=[]
diff=self.deintconf.PlaneDifferenceFromPrevious(atff,0,prop="YDifferencePrevious")
for i in range(tot_frames):
field_dataT.append(diff.get_frame(i).props.YDifferencePrevious[0]);
if info:
for i in range(tot_frames):
field_dataT.append(diff.get_frame(i).props.YDifferencePrevious[0])
print("\rcollecting tff field difference data...%d of %d completed." %(i,tot_frames),end="",file=infoOutput)
print(file=infoOutput)
else:
for i in range(tot_frames):
field_dataT.append(diff.get_frame(i).props.YDifferencePrevious[0])
num_field_sections=tot_frames//self.FIELD_SECTION_LENGTH
new_field_section_length=num_field_sections*self.FIELD_SECTION_LENGTH
all_field_section_type=[self.__get_field_type(field_dataB[i:(i+self.FIELD_SECTION_LENGTH)],field_dataT[i:(i+self.FIELD_SECTION_LENGTH)]) for i in range(0,new_field_section_length,self.FIELD_SECTION_LENGTH)]
Expand Down

0 comments on commit 70bcc3d

Please sign in to comment.