Quantcast Avisynth: Decomb 2.5.1 and Hybrid Clips - digitalFAQ.com Forums [Archives]
  #1  
07-29-2004, 04:56 PM
J-Wo J-Wo is offline
Free Member
 
Join Date: Nov 2002
Location: Toronto, Canada
Posts: 454
Thanks: 0
Thanked 0 Times in 0 Posts
Hey guys. I'm trying to encode the Babylon 5 region 1 NTSC dvd. DVD2AVI shows the film is NTSC Interlaced. Problem is, it's a hybrid film wth a mix of interlaced CG video material and film clips. I found the latest version of Decomb (2.5.1) with some very helpful documentation. I was able to follow it to get a good Telecide line, which is:
Code:
Telecide(order=1,guide=1,post=2,vthresh=23)
However I'm having a more difficult time choosing Decimate. Reading the documentation, I decided that the movie is mostly film, with only some of each episode with video CG scenes. So my choice is to decimate the film footage as usual and employ a blending on dropped frames for the video portion. The line suggested is:
Code:
Decimate(mode=3,threshold=1.0)
Problem is, some of the film portions have blending added. The parameter I can't seem to tweak is Threshold. The documentation doesn't seem to help me on this one. Can anyone here provide me with some tips? Thanks!
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
07-29-2004, 05:27 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Decimate's threshold parameter shouldn't be important in this case, because it'll use the hints set by Telecide (guide=1). It should just know which frames to pull out without running any analyses on the frames.

I might be wrong, but I think you can take out the threshold parameter in this instance. If you're getting blending, try adjusting your Telecide parameters.
Reply With Quote
  #3  
07-29-2004, 06:00 PM
J-Wo J-Wo is offline
Free Member
 
Join Date: Nov 2002
Location: Toronto, Canada
Posts: 454
Thanks: 0
Thanked 0 Times in 0 Posts
Sansgrip,

But it's the Decimate(mode=3) that is *causing* the blending. Without it I get 29.970 fps perfectly deinterlaced. But what I want is to be able to decimate it down to 23.976. Being a hybrid clip, the film portions have duplicate frames that can be dropped but the video sections do not. Deimate(mode=3) is supposed to detect which are film portions so it can decimate as needed, but add some blended frames in the video sections so it doesn't look choppy. Problem is that I'm seeing some blending in the film sections. The decomb manual says tweaking of threshold parameter may be required, and you can add the arguement show=true to decimate to help you. However the metrics that are displayed make no sense to me. The manual does a great job of explaining the metrics for Telecide(show=true) but not for decimate. Hoping someone can help me!
Reply With Quote
  #4  
07-29-2004, 08:00 PM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Hmm, I've never used mode=3. I'll check the docs and get back to you.
Reply With Quote
  #5  
07-29-2004, 09:06 PM
J-Wo J-Wo is offline
Free Member
 
Join Date: Nov 2002
Location: Toronto, Canada
Posts: 454
Thanks: 0
Thanked 0 Times in 0 Posts
I think mode=3 is new, perhaps for decomb 2.5.1. While mode=1 is intended for mostly video hybrid sources, mode=3 is for mostly film hybrid sources. I did a test with both parameters and while mode=3 did a pretty good job of smoothing out the video portions, I could still see unnecessary blending in the film parts. But I think I liked the result of mode=1 better. I preserved the 29.97 fps of the video portions, making the CG scenes extremely smooth. And for some reason, the blending of the repeated frames in the film section was not noticeable at all. Perhaps this has to do with the final encode being in 29.97 fps, and not pulldown 23.976? Anyway I'll take the performance hit of encoding in a higher framerate if the result means a smoother image.

Interestingly enough, I came across a couple links talking about using mode=1, and both sites mentioned the Babylon 5 DVD as an example! I'd still like to find some proper documentation on how to alter the Threshold param in decimate. Here are the links:

http://www.inmatrix.com/articles/ivtcsynth1.shtml
http://www.animemusicvideos.org/guid...deogetb3a.html
Reply With Quote
  #6  
07-30-2004, 12:22 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
Encoding hybrid content is usually a no-win situation. If you're going for DVD, encode as interlaced at 29.97fps, otherwise, choose the situation that looks best in your eyes.
Reply With Quote
  #7  
07-30-2004, 09:34 AM
J-Wo J-Wo is offline
Free Member
 
Join Date: Nov 2002
Location: Toronto, Canada
Posts: 454
Thanks: 0
Thanked 0 Times in 0 Posts
I found another filter for hybrid clips called SmartDecimate. It claims to do a better job that decomb at making video sequences smooth (without blended frames) when decimated down to 23.976 fps. They're right, the result may be better than decomb but a slight jerkiness can be seen during fast video motion or camera pans. I think the verdict for me is to stick with decomb mode=1 and encode at 29.97.

Boulder, I think I might have read some previous posts by you about encoding at 29.970 interlaced. Can you explain this again for me? Wouldn't the interlaced/combing artifacts be very visible in the result? And wouldn't those artifacts have a very negative impact on compression?
Reply With Quote
  #8  
07-30-2004, 09:47 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
If you watch the result on a TV, you won't notice any combing provided that you have set the correct field order. The motion will be as smooth as it is in the source. Interlaced encoding does require a higher bitrate but IMO it is usually worth it. Personally I can't watch originally pure interlaced video streams that have been deinterlaced because the motion is so jerky compared to the original.

Filtering interlaced sources is not complex, you'll just have to add some items to the script. This is what I use myself, encoding in CCE as interlaced (my captures are always top field first):

Code:
MPEG2Source("c:\temp\captures\pet.d2v",idct=7)
#Trim here
AssumeTFF() # AssumeBFF() for bottom field first streams
KernelBob(7)
#Crop,filter and resize as you normally would
#Add the borders here
SeparateFields()
SelectEvery(4,1,2) # SelectEvery(4,0,3) for bottom field first
Weave()
ConverttoYUY2(interlaced=true) # for CCE

function kernelbob(clip a, int th)
{	ord = getparity(a) ? 1 : 0
	f=a.kerneldeint(order=ord, sharp=true, twoway=false, threshold=th) 
	e=a.separatefields().trim(1,0).weave().kerneldeint(order=1-ord, sharp=true, twoway=false, threshold=th)
	interleave(f,e).assumeframebased()
}
I'm quite sure the pure interlaced video parts are TFF but test them in the normal assumetff().separatefields() fashion.

NOTE THE EDIT, THE BORDERS WERE IN THE WRONG PLACE IN THE FIRST VERSION!
Reply With Quote
  #9  
07-30-2004, 11:39 AM
SansGrip SansGrip is offline
Free Member
 
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
I think that depends on the source. I believe DV standardized on BFF, for whatever reason.
Reply With Quote
  #10  
07-30-2004, 12:06 PM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by SansGrip
I think that depends on the source.
It does, and usually DVDs are TFF. A quick check is always in place, however

I edited my script, the borders were added in the wrong place.
Reply With Quote
  #11  
07-30-2004, 01:46 PM
J-Wo J-Wo is offline
Free Member
 
Join Date: Nov 2002
Location: Toronto, Canada
Posts: 454
Thanks: 0
Thanked 0 Times in 0 Posts
Boulder:

What kind of filtering would you recommend for DVD sources? The BAbylon 5 dvd has very clean video portions but the film sections are riddled with specks of film dust/dirt. Currently the only filters I use for dvd sources are:

Code:
#Crop and resize
Undot()
Deen()
DCTFilter(1,1,1,1,1,1,0.5,0)
#addborders
Edit:Hmmm, okay Boulder I tried out your script and I'm not totally convinced that it's better. The film sequences look fine, but some combing artifacts are quite visible during the video sequences (I can see it in CG scenes with bright light, either an explosion or artificial lens flare). I think I'm going to stick with decomb mode=1 because it gives better compression and is a bit faster too.
Reply With Quote
  #12  
07-30-2004, 01:57 PM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
I've recently discovered RemoveGrain and RemoveDirt.

I'd try

Code:
#Crop and resize 
RemoveGrain(mode=8) 
RemoveDirt()
DCTFilter(1,1,1,1,1,1,0.5,0) 
#addborders
http://forum.doom9.org/showthread.php?s=&threadid=70856
http://forum.doom9.org/showthread.php?s=&threadid=79751
Reply With Quote
  #13  
07-30-2004, 02:40 PM
J-Wo J-Wo is offline
Free Member
 
Join Date: Nov 2002
Location: Toronto, Canada
Posts: 454
Thanks: 0
Thanked 0 Times in 0 Posts
WOW Boulder, *excellent* find! RemoveDirt did an excellent job of removing the film garbage. I then fiddled around a bit with the settings in RemoveGrain. Just like the documentation, mode=1 is comparable to Undot() except in my test, it compressed better. Mode=8 did have very good compression, but the result looked a little too soft on my computer screen. But when I compared the clips on my standalone, I could hardly tell a difference. I'll have to verify on the 53" widescreen in a sec tho .

While the combination of Undot() and Deen() certainly didn't do a good job in getting rid of the film dust, it did a better job of compression that RemoveGrain(mode= and RemoveDirt() alone. Do you think there's any point in adding Deen, perhaps between RemoveDirt and DCTFilter?
Reply With Quote
  #14  
07-30-2004, 02:45 PM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
I wouldn't do that, it would probably start removing details. Try a slight TemporalSoften after RemoveDirt(), I've sometimes used TemporalSoften(2,4,6,6,2) , or TemporalCleaner(3,12).
Reply With Quote
  #15  
07-30-2004, 03:19 PM
Dano Dano is offline
Free Member
 
Join Date: Apr 2003
Location: Brockton, MA
Posts: 134
Thanks: 0
Thanked 0 Times in 0 Posts
This gave good results on my last few TV Caps.

STMedianfilter(8,32,0,0)
ReduceFluctuations(limit=5)##included in latest removedirt.dll
__________________
-Dano
Reply With Quote
  #16  
07-30-2004, 04:08 PM
J-Wo J-Wo is offline
Free Member
 
Join Date: Nov 2002
Location: Toronto, Canada
Posts: 454
Thanks: 0
Thanked 0 Times in 0 Posts
boulder: just looking at my avisynth docs. Have you read about the new mode parameter for temporalsoften?

Quote:
Starting from v2.50: An optional mode=2 parameter: It has a new and better way of blending frame and provides better quality. It is also much faster. Requires ISSE. mode=1 is default operation, and works as always.
Dano: I've never tried those filters before. Are you recommending them in this case, in addition to teh Removegrain, Removedirt, and dctfilter?
Reply With Quote
  #17  
07-30-2004, 07:13 PM
Dano Dano is offline
Free Member
 
Join Date: Apr 2003
Location: Brockton, MA
Posts: 134
Thanks: 0
Thanked 0 Times in 0 Posts
Probably not, I am just really interested in the potential of RemoveDirt and wanted to mention what I was using it for since Boulder brought it up.
__________________
-Dano
Reply With Quote
  #18  
07-31-2004, 01:47 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by J-Wo
boulder: just looking at my avisynth docs. Have you read about the new mode parameter for temporalsoften?

Quote:
Starting from v2.50: An optional mode=2 parameter: It has a new and better way of blending frame and provides better quality. It is also much faster. Requires ISSE. mode=1 is default operation, and works as always.
That mode is already used in TemporalSoften(2,4,6,6,2)
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth: Decomb Plugin for Avisynth Tutorial nicksteel Avisynth Scripting 2 02-22-2005 09:48 AM
Avisynth: Multiple Clips to one mpeg file? the viking Avisynth Scripting 5 01-06-2005 12:08 PM
Avisynth: New to decomb bigggt Avisynth Scripting 13 02-16-2004 08:20 PM
Recording Video: To decomb or not to decomb interlacing? nicksteel Video Capturing / Recording 2 03-18-2003 05:01 AM
decomb.dll is not an avisynth 1.0 plugin? Adder Avisynth Scripting 2 02-19-2003 06:09 PM

Thread Tools



 
All times are GMT -5. The time now is 05:53 AM  —  vBulletin Jelsoft Enterprises Ltd