View Full Version : Can this DVD be reverted back to 24fps?
Backwoods
1st May 2004, 22:32
I've been trying this DVD on and off for ages now. The DVD is called Violent Cop by Takashi Kitano. I've even emailed the head of the company who put out the DVD and he admitted that there was a mistake in the production. The company has been bought out and he mentioned the DVD was to be re-released but he does not know when. That was about...2 years ago or so.
Here is a VOB sample:
www.mikegetoffline.com/vc01.vob
DVD2AVI reports "Progressive" with "NTSC 99%" then jumps to "Film 3x%" up to 49% then it switches back and forth to NTSC.
I tried something simple such as:
ComplementParity()
Telecide().Decimate(5)
And it looked ok for a bit, then in other scenes it sure as hell didn't.
I can provide another VOB section if needed. Any help would be appreciated.
manono
2nd May 2004, 04:08
Hi-
If there are problems with the DVD, they don't show in that sample. It's telecined Progressive 100% Film. However, I ripped Violent Cop a couple of years ago, and parts of it played real jerky, and I never could figure out why. But I didn't know anything then. As I remember, one of the problem scenes was near the beginning, where Kitano and another cop are doing something with some papers in their office. Again, if I remember correctly, this was just before Kitano got called into the boss's office to get yelled at.
But we'll need a better sample, I think.
Not so fast, manono!
Do a BFF separate fields and look at the crappy fields. This gives "perfect" in-pattern recovery:
telecide(order=0,post=0,guide=1,show=true)
But it still shows combing due to the crappy source.
This is about the best you can do:
telecide(order=0,guide=1,post=2,vthresh=25,blend=false) // version 5.1.1
decimate(5)
scharfis_brain
2nd May 2004, 10:53
I've took a short look at this sample.
It is full of (wrong) blends.
a normal telecine Pattern will be like this:
A A B B B C C D D D E E F F F G G
but the telecine Pattern is like this:
xA A BA B BA CB C DC D DC ED E FE F FE FG G
this means, a fullframerate-bob, and then a adaptive selection would be cool.
from doubles (CB C or ED E) it has to choose the 2nd one
and from triples(BA B BA or DC D DC) it has to choose the middle one
that way you will restore the unblended 24fps.
maybe selectevery(5,1,4) or with other values could help, if the source has a constant pattern.
manono
2nd May 2004, 11:27
Yeah, my apologies to Backwoods. Originally I just noted it was 100% Film, and then thought no more of it. But as you, neuron2, and scharfis_brain say, it's a mess. I don't know what to do with it.
Backwoods
2nd May 2004, 23:21
No problem Manono, the sample I posted does work fine with what neuron2 posted. What is odd though, the same scene in the original VOB that scene I clipped out does not yield the same results. It gives an out of pattern reading very often.
Here is a Divx sample of the same scene and a little more using
"telecide(order=0,guide=1,post=2,vthresh=25,blend=false) // version 5.1.1
decimate(5)" with show=true:
www.mikegetoffline.com/vc_d_02.avi
Now using
bob()
selectevery(5,1,4)
The sample looks very good too, but angled lines have a very jagged look and sometimes you see pulsing:
www.mikegetoffline.com/vc_d_03.avi
Tonight or tomorrow I'll do some MPG2 encoding and output to TV, see how these options work out.
What do you guys think so far?
scharfis_brain
3rd May 2004, 00:23
do not use
bob()
selectevery(5,1,4)
repl;ace bob() with a smart bobber, like at least dgbob() or much better: kernelbob()
further do not rely on selectevery(5,1,4)
also try:
selectevery(5,0,3)
selectevery(5,1,4)
selectevery(5,2,5)
selectevery(5,3,6)
selectevery(5,4,7)
found this script in the avisynth doc:
# Take a 24fps progressive input clip and apply 3:2 pulldown,
# yielding a 30fps interlaced output clip
AssumeFrameBased()
SeparateFields()
SelectEvery(8, 0,1, 2,3,2, 5,4, 7,6,7)
Weave()
if you replace separatefields() with
interleave(last,layer(last,last.trim(1,0),"fast"))
you'll probably get the same result like backwood's sample shows.
scharfis_brain
3rd May 2004, 10:16
the answer to the Thread Title now is definately:
YES!
I've got it killing all blends out of this stream.
imagine the following sequence:
AB B AB BC C CD D CD DE E EF F EF
I figuere out, where the blends AB - AB , CD - CD or EF - EF are.
(with simple frame comparision -> both blends are identical!)
then I replace the 2nd blend of both with its clean middle frame.
the following scence gets returned:
AB B B BC C CD D D DE E EF F F
this makes a easy decimation possible:
decimate(5)
AB B BC C CD D DE E EF F
then I've tried unblend(), but it was not reliable.
so I modified restore24 to get rid of the blends.
the original:
function DoIt ()
{
Calculate(work)
AlreadyBobbed = last
assumeframebased()
separatefields.selectevery(4,1,2).weave
SmartDecimate(24,50, bob=AlreadyBobbed, tel=0.3, t_max=0.0000050, console=false)
trim(24,0)
return(last)
}
modified:
function DoIt ()
{
Calculate(work)
#AlreadyBobbed = last
#assumeframebased()
#separatefields.selectevery(4,1,2).weave
#SmartDecimate(24,50, bob=AlreadyBobbed, tel=0.3, t_max=0.0000050, console=false)
trim(50,0)
return(last)
}
this makes restore24 becoming an universal unblender :)
afterwards I do an decimate(2) to cancel the dupes et viola:
the resulting scence is a clean and blendfree video:
B C D E F
the scrip I used:
setmemorymax(640)
loadplugin("c:\x\mpeg2dec3.dll")
loadplugin("c:\x\masktools.dll")
loadplugin("c:\x\decomb510.dll")
loadplugin("c:\x\kerneldeint140.dll")
loadplugin("c:\x\avisynth_c.dll")
loadcplugin("C:\x\smartdecimate.dll")
import("C:\x\avs-scripts\intellibob.avs")
import("C:\x\avs-scripts\restorex.avs") #modified restore24
mpeg2source("vc01.d2v")
assumebff()
converttoyuy2(interlaced=true)
# create the working clip.
# I need stacking two bobbed stream because of restore24
# I will separate them later
work=stackhorizontal(r24kernelbob(),kernelbob())
# create the test-clip
test=work
test=subtract(test.duplicateframe(0).duplicateframe(0),test)
test1=test.levels(130,1,255,0,255)
test2=test.levels(0,1,126,255,0)
test=layer(test1,test2,"fast").converttoyv12() #.trim(1,0)
# create the clip, that replaces the blend
repl=work.duplicateframe(0)
# do the detection and blend replacing
conditionalfilter(test,work,repl,"Averageluma()",">","17")
# decimate out the replaced frame.
decimate(5)
# separate to two bobbed streams.
a=crop(0,0,720,0) #analyse-stream (left)
b=crop(720,0,0,0) #output-stream (right)
# do the blend removal
restore24(a,b)
#decimate the dupes
decimate(2)
Backwoods
5th May 2004, 07:44
This is great that you have done this, but I am recieving an error:
"there is no function named "r24kernelbob"
I've searched for that function on the forums here and nothing was returned.
scharfis_brain
5th May 2004, 07:47
oh, forgot to say that.
I made a new thread about restore24.
there you can find a File for download, that includes r24kernelbob.
scharfis_brain
5th May 2004, 07:57
here both kernelbob-functions:
Output bobber for Restore24
function kernelbob(clip a, int "th",bool "mask")
{ mask=default(mask,false)
th=default(th,5)
ord = getparity(a) ? 1 : 0
f=a.kerneldeint(order=ord, sharp=true, twoway=false, threshold=th,map=mask)
e=a.separatefields.trim(1,0).weave.kerneldeint(order=1-ord, sharp=true, twoway=false, threshold=th,map=mask)
interleave(f,e).assumeframebased
}
Analyse bobber for Restore24
function r24kernelbob(clip a, int "th",bool "mask")
{ mask=default(mask,false)
th=default(th,0)
ord = getparity(a) ? 1 : 0
f=a.kerneldeint(order=ord, sharp=false, twoway=true, threshold=th,map=mask)
e=a.separatefields.trim(1,0).weave.kerneldeint(order=1-ord, sharp=false, twoway=true, threshold=th,map=mask)
interleave(f,e).assumeframebased
}
Backwoods
5th May 2004, 20:34
I downloaded your pack from that thread and used the AVS script you post with the altered Restorex.avs changes.
My video is still 2 frames next to each other, 1440x480.
Now in your last post you show 2 additions, where would these go/replace?
Sorry for the ignorance, but these type of indepth scripts (as I'm sure you can tell) are out of my league and very new to me.
scharfis_brain
5th May 2004, 23:52
I'll try to make a function out of all this stuff.
So you only have to bother DL'ing the correct DLL's and importing the function.
scharfis_brain
6th May 2004, 00:49
DL this File: http://home.arcor.de/scharfis_brain/blending/restorex.avs
and do the following script:
setmemorymax(512) #set this to 2/3 of your system's RAM
#be sure using the newest masktools and avisynth
loadplugin("mpeg2dec3.dll")
loadplugin("masktools.dll")
loadplugin("decomb510.dll")
loadplugin("kerneldeint140.dll")
import("restorex.avs") #modified restore24 with additional backwoods function
mpeg2source("vc01.d2v")
crop(0,52,0,-52)
assumebff()
restorebackwoods24fps()
this returns a slightly cropped and fully deblended 24fps stream.
do some additional cropping and resizing AFTER restorbackwoods24fps()
Backwoods
6th May 2004, 04:17
ResetMask: RGB32 data only
restorex.avs, line 72
restorex.avs, line 358
VC.avs, line 14
I'm using the DLLs posted in your RAR and the new AVS and script posted.
If I take out "restorebackwoods24fps()" the video loads but with interlacing/combing @ 29.97 720x376.
Any ideas?
Backwoods:
That sounds pretty much like you're using AviSynth 2.54. The latest is 2.55, and that one is needed for Restore24 to run properly.
(The script is somewhat complicated, and was already several times affected by changes through new AviSynth versions.)
- Didée
Backwoods
8th May 2004, 03:12
I thought I had the latest version, forget to install the EXE, thanks for that.
Here is a sample of the clip. 99% of the combing and dupe frames are gone, but the motion is kind of jerky.
www.mikegetoffline.com/vc_d_06.avi
Thanks for helping out, maybe the DVD just isn't meant to be corrected, ha. I appreciate the help.
scharfis_brain
8th May 2004, 10:15
Have you used exactly this?
mpeg2source("vc01.d2v")
crop(0,52,0,-52)
assumebff()
restorebackwoods24fps()
and have you read this :
do some additional cropping and resizing AFTER restorbackwoods24fps()
Backwoods
8th May 2004, 18:23
Originally posted by scharfis_brain
Have you used exactly this?
Yes.
and have you read this :
The clip has that.
What would either of these points have to do with jerky video? :confused:
scharfis_brain
9th May 2004, 00:47
What would either of these points have to do with jerky video?
wrong cropping may causing:
- changing the fieldorder -> wrong deinterlacing -> jumpyness
- causing the deinterlacer gets into trouble -> jumpyness
try changing assumebff() into assumetff()
completely remove any cropping & resizing before restorebackwoods24fps()
if that doesn't work:
remove restorebackwoods24fps()
and replace it with bob()
then look at it, whether it runs smooth without jumpyness
if not, change tff() <-> bff() again.
I cannot understand, why it fails on your PC if you've exctly done what I've posted.
the sample, you've provided with your first post, was absolute smooth using the described way!
But if I change bff() into tff(), I get exactly the same jumpyness as your last sample shows.
So I think, you've made a mistake while setting it up.
Please check every char within the script....
Backwoods
13th May 2004, 05:24
A simple tff() is all it needed.
I appreciate your tremendous help alot, really do.
Thanks again.
Backwoods
13th May 2004, 21:22
Originally posted by Backwoods
edit Wilbert: I removed your other 5 identical post. Please don't do that anymore.
Ha, like I meant to man. The forum didn't tell me it posted. It hanged and when I went back to the page my post was not there. Thanks for deleting them.
Does this look like usenet? ;)
SeeMoreDigital
13th May 2004, 22:59
Originally posted by Backwoods
Here is a VOB sample:
www.mikegetoffline.com/vc01.vob
DVD2AVI reports "Progressive" with "NTSC 99%" then jumps to "Film 3x%" up to 49% then it switches back and forth to NTSC.
How do these XviD samples (http://homepage.ntlworld.com/seemoredigital/vc01_(Anamorphic_XviD).zip) look?
One was left interlaced the other has been de-interlaced. Both have been cropped and resized to an 1.77:1 anamorphic XviD 720x480 frame.
Cheers
MOmonster
29th July 2005, 20:56
original posted by scharfis_brain
the answer to the Thread Title now is definately:
YES!
I've got it killing all blends out of this stream.
Sorry to say this, but no it isn´t.
Yes, you are right, the clip shows this pattern. I don´t know if we get the same clip from backwoods, but in my clip often also the clear fields shows blending (not so bad like the frames around, but there is blending).
@backwoods
you offered your problem in another thread and this is my solution for you:
crop(16,64,-16,-64)
a = leakkernelbob(order=0, sharp=false, twoway=true, threshold=4)
backwoods(output=a)
function backwoods(clip input, clip "output")
{
work = input.separatefields()
global out = output
clp = out.selectevery(5,0,0)
global x = 0
global frame_cbb = work.selectevery(5,2,2).duplicateframe(0).duplicateframe(0)
global frame_cb0 = work.selectevery(5,3,3).duplicateframe(0).duplicateframe(0)
global frame_cb = work.selectevery(5,4,4).duplicateframe(0).duplicateframe(0)
global frame_c0 = work.selectevery(5,0,0)
global frame_c1 = work.selectevery(5,1,1)
global frame_c2 = work.selectevery(5,2,2)
global frame_c3 = work.selectevery(5,3,3)
global frame_c4 = work.selectevery(5,4,4)
global frame_c5 = work.selectevery(5,0,0).trim(2,0)
global frame_c6 = work.selectevery(5,1,1).trim(2,0)
global frame_c7 = work.selectevery(5,2,2).trim(2,0)
c99=scriptclip(clp, "out.selectevery(5,x,x+3)")
c2=FrameEvaluate(c99, "global x = (combl_eb*2.8 < combl_ebb) && (combl_eb*2.8 < combl_e1) ? 0 :
\ ((combl_e0*2.8 < combl_eb0) && (combl_e0*2.8 < combl_e2) ? 1 :
\ ((combl_e1*2.8 < combl_eb) && (combl_e1*2.8 < combl_e3) ? 2 :
\ ((combl_e2*2.8 < combl_e0) && (combl_e2*2.8 < combl_e4) ? 3 :
\ ((combl_e3*2.8 < combl_e1) && (combl_e3*2.8 < combl_e5) ? 4 : x))))")
c1=FrameEvaluate(c2, "global combl_e5 = LumaDifference(frame_c5, frame_c7)
global combl_e4 = LumaDifference(frame_c4, frame_c6)
global combl_e3 = LumaDifference(frame_c3, frame_c5)
global combl_e2 = LumaDifference(frame_c2, frame_c4)
global combl_e1 = LumaDifference(frame_c1, frame_c3)
global combl_e0 = LumaDifference(frame_c0, frame_c2)
global combl_eb = LumaDifference(frame_cb, frame_c1)
global combl_eb0 = LumaDifference(frame_cb0, frame_c0)
global combl_ebb = LumaDifference(frame_cbb, frame_cb)")
return(c1)
}
Yes you are right the code is absolutly not optimised, but if you crop before, it doesn´t run too slow.
So or so, I think with restore24 you overdo it for this problem.
Like I already said there will be still some blendings left, you can´t avoid because of missing motion informations, but it doesn´t looks to bad.
Maybe in the future we can use restorefps to solve this problem (if we delete the doubled blends before), but not at this stage of development.
Hope this helps ;)
Backwoods
29th July 2005, 21:07
Thank you for the help.
I'll test this today/tomorrow and post the results.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.