Quantcast Unable to weave fileds back together after applying DeFreq - digitalFAQ Forum
Go Back    Forum > Digital Video > Video Project Help > Restore, Filter, Improve Quality

Reply
 
LinkBack Thread Tools
  #1  
07-03-2022, 08:09 PM
bmichaelb bmichaelb is online now
Free Member
 
Join Date: Jun 2022
Location: Vancouver
Posts: 13
Thanked 3 Times in 3 Posts
I came across a thread about using DeFreq, and the scripts being shown had the source having the fields separated first, then applying DeFreq, then weaving back together, then run through QTGMC for deinterlacing. But if I try that, the fields stay separated. If I comment out the defreq(), they weave back together. But if I enable defreq, they stay separated.

Code:
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\FFT3DFilter.dll")
AviSource("E:\Day 1\Daytime\Day 1-02.avi")
AssumeTFF()
SeparateFields()
Return DeFreq(fx=10,fy=-11.7,show=0,info=false)
Weave()
QTGMC(Preset="Slower", SourceMatch=3, Lossless=2, MatchEnhance=0.75, TR2=1, Sharpness=0.1)
What am I doing wrong? Is it ok to deinterlace first, then apply defreq?
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
07-04-2022, 12:13 AM
keaton keaton is offline
Premium Member
 
Join Date: Jan 2017
Location: USA
Posts: 160
Thanked 77 Times in 54 Posts
Remove the Return keyword from your script. When you use the return statement, you are saying to exit the script and return the result of what is placed on the same line after the return keyword. So, it does not execute Weave or QTGMC. If you move the return to after Weave, you'd see the full frame result of DeFreq but before QTGMC. If you remove it altogether, you'll see the result of DeFreq and QTGMC combined. return can be handy for debugging a script to see what things look like at a certain point in a script. But ultimately, you don't want a return statement in your finished script. It is generally used when you define functions, where you would place a return statement at the end of the function.
Reply With Quote
The following users thank keaton for this useful post: bmichaelb (07-04-2022), RobustReviews (07-04-2022)
  #3  
07-04-2022, 01:41 AM
bmichaelb bmichaelb is online now
Free Member
 
Join Date: Jun 2022
Location: Vancouver
Posts: 13
Thanked 3 Times in 3 Posts
Quote:
Originally Posted by keaton View Post
Remove the Return keyword from your script. When you use the return statement, you are saying to exit the script and return the result of what is placed on the same line after the return keyword. So, it does not execute Weave or QTGMC. If you move the return to after Weave, you'd see the full frame result of DeFreq but before QTGMC. If you remove it altogether, you'll see the result of DeFreq and QTGMC combined. return can be handy for debugging a script to see what things look like at a certain point in a script. But ultimately, you don't want a return statement in your finished script. It is generally used when you define functions, where you would place a return statement at the end of the function.
That did it, thank you very much. Looking back at the example scripts, and I seemed to have combined 2 of them. The first had the Return DeFreq, but also had Weave commented out, but a second script with Weave uncommented, didn't have the Return.

Does defreq need to be applied before deinterlacing though, or can I run QTGMC then apply defreq afterwords?
Reply With Quote
  #4  
07-04-2022, 10:54 AM
lollo2 lollo2 is online now
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 516
Thanked 154 Times in 134 Posts
Quote:
Does defreq need to be applied before deinterlacing though, or can I run QTGMC then apply defreq afterwords?
Defreq is a spatial only filter, but is designed for a progressive frame, so it must be applied on a "deinterlaced" video.

If you do not want your final video to be deinterlaced you do:
Code:
AssumeTFF()
SeparateFields()
DeFreq(fx=10,fy=-11.7,show=0,info=false)
Weave()
or better (the filter will work with double the data, acting on the full frame rather than on the fields)
Code:
AssumeTFF()
QTGMC(lossless=1)
DeFreq(fx=10,fy=-11.7,show=0,info=false)
AssumeTFF()
SeparateFields()
SelectEvery(4,0,3)
Weave()
If you want your final video to be deinterlaced you simply do:
Code:
AssumeTFF()
QTGMC()
DeFreq(fx=10,fy=-11.7,show=0,info=false)
Reply With Quote
The following users thank lollo2 for this useful post: bmichaelb (07-04-2022)
  #5  
07-04-2022, 11:20 AM
bmichaelb bmichaelb is online now
Free Member
 
Join Date: Jun 2022
Location: Vancouver
Posts: 13
Thanked 3 Times in 3 Posts
Thanks lollo2. I run deinterlacing overnight, then test with filtering after that, so this way helps a lot. Cheers.
Reply With Quote
  #6  
07-10-2022, 04:38 AM
lollo2 lollo2 is online now
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 516
Thanked 154 Times in 134 Posts
As you are going to experiment, I would also try something like the following. It may be more effective because QTGMC() will fix the common problems of deinterlacing and it may be confused by the wrong patterns inside the video because the embedded defect requiring DeFreq(). So we first fix the defect, using a "frame" approach with Defreq, and then we deinterlace. The best solution really depends on the specific case.

Code:
AssumeTFF()
QTGMC(lossless=1) # lossless deinterlacing to build original frame
DeFreq(fx=10,fy=-11.7,show=0,info=false)
AssumeTFF()
SeparateFields()
SelectEvery(4,0,3)
Weave() # back to interlaced video after fixing the defect with DeFreq()
QTGMC() # deinterlacing
Reply With Quote
The following users thank lollo2 for this useful post: bmichaelb (07-10-2022)
  #7  
07-10-2022, 05:39 AM
bmichaelb bmichaelb is online now
Free Member
 
Join Date: Jun 2022
Location: Vancouver
Posts: 13
Thanked 3 Times in 3 Posts
Thanks lollo2. The electrical interference lines are rolling upwards in the frame, but are at a slight angle, not perfectly horizontal. NeatVideo can remove them, but I found it to lose too much detail in the process, but it was the demo version, and I haven't played around with the settings yet. My project is my copy of Woodstock '99, spanning 30 tapes, for a total of 60 hours of coverage... live during the day, as well as the overnights. So my goal is to capture a few tapes during the day, then deinterlace while I sleep. Once everything's digitized and deinterlaced, I'll then start tackling the filtering. I have 10 more tapes to capture, and I'm only 5 tapes into deinterlacing. Once I've finished the captures, I can deinterlace during the day as well as overnight, so I'm hoping another 2 weeks... or so. :-p I did find that 2 of my tapes have intermittent tearing at the top of the frame, and after inspection, it's the bottom field that's messed up. I then found a script that interpolated the full frame from the good field, then uses qtgmc to reinterlace, so I can then use qtgmc again to deinterlace into 60fps to match the rest of the sources. It actually looks indistinguishable from the original. :-)

Edit: forgot to mention... the interference is only present on 2 tapes. I had 4 Toshiba vcrs going, using 160min tapes, with 15min overlaps, all connected to a 4-way splitter. Unfortunately, I didn't ground the splitter, and the interference was from my roommate vacuuming when I was at work. :-p I'll try your script once I've finished capturing. Cheers.

Last edited by bmichaelb; 07-10-2022 at 06:03 AM.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
VirtualDub is unable to see my ATI 600 USB capture card? stevevid Capture, Record, Transfer 8 09-12-2018 01:03 PM
Applying different filters to different parts of the video in VirtualDub naripeddi Restore, Filter, Improve Quality 2 03-13-2013 03:22 AM
Unfolding fields before applying Virtualdub filters unclescoob Restore, Filter, Improve Quality 10 10-02-2011 09:18 PM
VirtualDubMPEG - applying different filters to different sections, color correction unclescoob Restore, Filter, Improve Quality 10 09-28-2011 10:05 AM
Unable to get Flash vid to display in transparemt mode vidweb Encode, Convert for streaming 5 03-04-2011 04:56 PM

Thread Tools



 
All times are GMT -5. The time now is 02:53 AM