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. |
![]() |
#1 | Link |
brainless
Join Date: Mar 2003
Location: Germany
Posts: 3,650
|
Fighting against fieldblends (constant pattern)
Worried about fieldblends on old or new movies?
There could be a possible solution, if there is a CONSTANT blending pattern present in your video. use this function for testing: Code:
function unblendpattern(clip clip, int offset, float fps, bool refitfps, bool debug) { a = (debug == true) ? clip.ShowFrameNumber() : clip b = changefps(trim(a,0,-1),framerate(a)*100).assumefps(framerate(a)) out = (offset == 0) ? changefps(a, fps) : changefps((b.trim(0, -offset) + a), fps) out = out.trim(int(offset / (framerate(a)/fps)) , 0) out = (refitfps == true) ? out.assumefps(framerate(a)/2, true).resampleaudio(audiorate(a)) : out return out } At first, you have to deinterlace your Video with a Fullframreate-deinterlacer, like dgbob(). Code:
xxxsource("yourblendedvideo.xx") dgbob(order=?) position where movement and blends are very good visible. Now go frame by frame through your video and write down the Framenumbers of the UNBLENDED (normal) frames then do a count, how many good frames (if two identical frames are not blended, do only count one) you have per second of Video (50 frames). This will be the orignial Framerate of the source. your sequence may look like this: Code:
blend : 0,2,4,6,8,9 ,11,13,15,17,19,21,23,25,27,29,31,33,34,36,38,40,42,44,46,48,50,,,,,,,,,,, normal : 1,3,5,7, ,10,12,14,16,18,20,22,24,26,28,30,32, ,35,37,39,41,43,45,47,49,,,,,,,,,,, now add my function to your script (I assume 24fps from now on) Code:
xxxsource("yourblendedvideo.xx") dgbob(order=?) unblendpattern(0,24,false,true) until unblendpattern only returns the normal frames. If this is done, examine your whole video. if the blending pattern slowly slides away, just change the fps value a little bit (it's float). now, change the parameters for unblend, to remove the framenumbers debug=false. If you want, unblendpattern can correct the unblended video itself to 25fps (half framrate of inputclip). Just set refitfps=true Code:
xxxsource("yourblendedvideo.xx") dgbob(order=?) unblendpattern(22,24,true,false) instead of dgbob() for deinterlacing. (You'll get lesser stairstepping) Code:
function kernelbob(clip a, int th) { f=a.kerneldeint(order=1, sharp=true, twoway=true, threshold=th) e=a.separatefields.trim(1,0).weave.kerneldeint(order=0, sharp=true, twoway=true, threshold=th) interleave(f,e) } Code:
xxxsource("yourblendedvideo.xx") #assumetff #use it, if video jerks back and forth kernelbob(4) unblendpattern(22,24,true,false) btw. I invented this Idea, because BaronVlad had problems with an interlaced PAL movie. First I thought it has been directly converted from 24p to 50i using blending. But that wasn't the truth! The broadcaster took the already preogressive 25fps Film and speeded it up to unbelievable 26fps using blending. I think this has been done to be able to broadcast 3.5 minutes more advertisement. German TV sucks!
__________________
Don't forget the 'c'! Don't PM me for technical support, please. Last edited by scharfis_brain; 13th December 2003 at 00:51. |
![]() |
![]() |
![]() |
#2 | Link |
Registered User
Join Date: Feb 2003
Location: USA
Posts: 34
|
kernelbob is a great filter...thanks. it was the only one that could handle the 2 telecined PAL DVD's I have been working with for almost a week now.
Telecide(order=1, mode=3) Decimate(6) - dgbob() repal() both failed miserably on them. kernelbob(4) repal() worked great just wanted to add a little bit more to importing these avs files and using them in a script for those who dont know (I was recently one of them) first of all, you have to create an avs with just the function code in it. Then you have to load that avs into your regular script by: import("%filename%.avs") also you need to have kerneldeint.dll on your comp and load it in. then usage of the kernelbob is i believe kernelbob(4) feel free to correct me if i'm wrong, its my first experience with this filter, but definitely not my last. Also would be nice to get it into a dll if its possible, may speed it up a bit. |
![]() |
![]() |
![]() |
#5 | Link |
brainless
Join Date: Mar 2003
Location: Germany
Posts: 3,650
|
just take 100 (or more) fields (or deinterlaced after dgbob / kernelbob) and count the good (non-blended) fields.
If the same picture appears twice or more, just count it once. If you have, let's say 30 good out of 100 fields, you have a ratio of 1.0 : 0.3 . this means a framerate (PAL) of 50 : x = 1.0 : 0.3 where x = 15 with NTSC: 59.94 : x = 1.0 : 0.3 -> x = 17.98 (approx. 18 fps) but this gives only a raw idea of the fps-value. the exact value can only be found through testing the source from 0 to end. If there is a swimming or jumping offset in your video, you have to separate your video into segments, unblend them each with their fitting offset and re-join then back together after that. PS: After testing unblendpattern with NTSC-samples, I found out (with help of manono!), that AVIsynth handles the floating-point fps not very well. This means for you applying a assumefps(29.97) directly after opening the video. Else unblendpattern will return a error claiming about non-matching framerates.
__________________
Don't forget the 'c'! Don't PM me for technical support, please. Last edited by scharfis_brain; 13th December 2003 at 00:51. |
![]() |
![]() |
![]() |
#6 | Link |
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
hmm. i'm at a loss as to what to do with hybrid 24/30 clips that have become interlaced through PAL conversion.
best i can get is about 70% of good frames which isn't much better than the original content. good function nonetheless.
__________________
sucking the life out of your videos since 2004 |
![]() |
![]() |
![]() |
#7 | Link | |
brainless
Join Date: Mar 2003
Location: Germany
Posts: 3,650
|
Quote:
some converters are blending ALL the time, meaning that a slight blending is everytime visible. ANd others are only doing blending if the new temporal PAL-image position lays roughly between two NTSC-images. Else the nearest neighbor is choosen without blending two NTSC-images together. When converted with such a converter, you'll be able to select 30 frames out of 50 with success!
__________________
Don't forget the 'c'! Don't PM me for technical support, please. |
|
![]() |
![]() |
![]() |
#8 | Link |
Registered User
Join Date: Jul 2002
Posts: 14
|
Can this be used to sort of go from PAL back to NTSC? I have NTSC material that was converted and put on a PAL DVD. So when I do my code it looks like this:
Code:
bad: 00, 03, 05, 08, 10, 13, 15, 18, 20, 23, 25, 28, 30, 33, 35, 38, 40, 43, 45, 48, 50 good: 01,02, 04, 06,07, 09, 11,12, 14, 16,17, 19, 21,22, 24, 26,27, 29, 31,32, 34, 36,37, 39, 41,42, 44, 46,47, 49 |
![]() |
![]() |
![]() |
#11 | Link |
brainless
Join Date: Mar 2003
Location: Germany
Posts: 3,650
|
then try using
kernelbob(4) unblendpattern(x,29.97,false,true) x is the Offset, which you have to change until unblendpattern chooses only the good frames.
__________________
Don't forget the 'c'! Don't PM me for technical support, please. |
![]() |
![]() |
![]() |
#15 | Link |
brainless
Join Date: Mar 2003
Location: Germany
Posts: 3,650
|
just remove ,0 [ kernelbob(5) ]
and then you can use the kernelbob, I've posted here its just my personal super-duper-hyper-useless switch, hehe
__________________
Don't forget the 'c'! Don't PM me for technical support, please. |
![]() |
![]() |
![]() |
#16 | Link |
Registered User
Join Date: Jul 2002
Posts: 14
|
Code:
import("F:\dvd\unblender.avs") mpeg2source("C:\Documents and Settings\Administrator\Desktop\s.d2v") kernelbob(5) unblendpattern(1,30,false,false) #DeRainbow(8) #crop(8,8,704,564) #BicubicResize(512,384,0,0.5) |
![]() |
![]() |
![]() |
#17 | Link |
brainless
Join Date: Mar 2003
Location: Germany
Posts: 3,650
|
this function cannot remove blends from existing frames. it only can select the "best" matching frames, meaning that blending on some frames is still visible.
The great advantage is after using this function, that you have a video with its original framrate and smoothness. Please don't expect wonders from it. It is just a stupid frame-selector. Nothing else!
__________________
Don't forget the 'c'! Don't PM me for technical support, please. |
![]() |
![]() |
![]() |
#19 | Link | |
brainless
Join Date: Mar 2003
Location: Germany
Posts: 3,650
|
What tha hell?!?
Quote:
How shall I do this kind of remote-diagnosis without something to have a look on? Sample = 5 to 10 secs long non-reencoded part cutted out of the VOB's use ChopperXP
__________________
Don't forget the 'c'! Don't PM me for technical support, please. Last edited by scharfis_brain; 24th January 2004 at 18:03. |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|