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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd February 2008, 11:24   #81  |  Link
WarpEnterprises
C64
 
WarpEnterprises's Avatar
 
Join Date: Apr 2002
Location: Austria
Posts: 830
I'm sorry, I didn't take care of the date, so I think I too only have the September version...
WarpEnterprises is offline   Reply With Quote
Old 23rd February 2008, 12:01   #82  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,455
you guys are lucky:

http://foxyshadis.slightlydark.com/r...2Oct05.dll.zip
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order.
foxyshadis is offline   Reply With Quote
Old 23rd February 2008, 15:05   #83  |  Link
jeffy
Registered User
 
Join Date: Jan 2007
Posts: 943
Quote:
Originally Posted by foxyshadis View Post
404 error
I am also searching for ReverseBlend, the two versions 22nd & 23rd October 2005, do you please have them?

Thank you for your help.
jeffy is offline   Reply With Quote
Old 24th February 2008, 04:29   #84  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,455
I didn't notice that the firewall at the office blocked the upload! So sorry, fixed now. Also:

http://foxyshadis.slightlydark.com/r...3Oct05.dll.zip
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order.
foxyshadis is offline   Reply With Quote
Old 4th May 2008, 00:38   #85  |  Link
AnnaFan777
Registered User
 
Join Date: Apr 2008
Posts: 51
Quote:
Originally Posted by mg262 View Post
Those of you reading this thread for the first time might want to start at this post, which is where the attack on fieldblending starts for real.
____________________________________________

RestoreFPS

Brief description:
Reverses the kind of blending generated by ConvertFPS, restoring original framerate.

Search keywords: ConvertFPS, FPS, framerate, restore, reverse, like unblend, deblend, restore24.

Full description:
RestoreFPS(clip, float fps, float phase) - takes a YV12 clip which has an 'underlying' frame rate of fps but a higher actual frame rate due to blending, and reverses the blending to restore the original frame rate. phase is a number between 0 and 1 which specifies the relative displacement of old and new clips (see example below).

The framerate to restore should be less than the current framerate, and more than half of it. (So restoring from 24 back to 25 and from 24 back to 11 are both illegal.)

The method used is described here.

Examples:
In order to test the filter we need to generate a clip using ConvertFPS. A script like this:

bicubicresize(4*60,3*60)
selectevery(200,0)
converttoyuy2
assumeFPS (24/1.001)
convertFPS (25)
converttoyv12
overlay(crop(0,0,-0, 26). showframenumber)


will do the trick. Some frames from this:



Now running

RestoreFPS(24/1.001, 0.00)

produces a stream like this (do look at the messed up 'frame numbers'):




In this case, the start (in time) of the input clip corresponds exactly to the start (in time) of a frame of the original clip. In other words the situation looks like this:



That won't always be true -- if we take the 'convertFPS' clip above and trim it (say add Trim(10,0)), then we have something more like this:



Dealing with this requires us to guess the amount by which the converted clip is 'slid' with respect to the original, i.e. to guess the phase parameter. I used this script to help with this:

Function phase(clip c, float phi)
{
c
RestoreFPS(24/1.001, phi) #set appropriate frame rate

#trim here if desired

a=selectevery(6,0)
b=selectevery(6,1)
c=selectevery(6,2)
d=selectevery(6,3)
e=selectevery(6,4)
f=selectevery(6,5)

stackhorizontal(a,b,c,d,e,f)
Reduceby2()
stackvertical(last, trim(1,0), trim(2,0), trim(3,0), trim(4,0), trim(5,0))
Trim(0,-1).Loop(0,1000)
subtitle(String(phi, "%f"))
}

#source clip here
animate (0, 100,"phase", 0.0, 1.0)
trim(0, 100)


Save the output of this, open it up in VirtualDub, and drag the slider around to find a phase that looks correct. (You may get an unusual effect in the first few frames of the clip, because of an edge effect.)

Here's a real example to finish up with:

Source (from VHS):


Restored:


(Actually, this example doesn't seem to work exactly like ConvertFPS on a wider scale, but leave that aside for now.)

Notes:
- If you're dealing with a clip in which fields (not full frames) are blended, separate them and process them separately; I think the phase parameters for the top and bottom fields will differ by 0.5 (though I'm not at all sure).

- This isn't optimised; there are several ways in which I could speed it up, and I will if anyone finds it useful.

- If you get the frame rate slightly wrong, this filter will work in a small region and get worse and worse as you drift away from it.

- It will not deal with cuts. You will need to take each cut section and find a phase for it separately. (If the sections are too short, this method may not be of any use.) On the other hand, there are some ways to estimate the phase automatically (esp. autocorrelation), and cuts could be detected by the change in phase.

- Although I've only set it up to reverse ConvertFPS type blends, it will work perfectly well on any regular blend pattern, including the types mentioned by scharfis_brain in this thread. The hard part is analysing the blend type -- I have some scattered thoughts but this post is too long already!

By the way, I'm really sorry I trailed off/disappeared at the end of that last thread... real life got in the way. I'll try and do better with this filter (assuming anyone finds a clip it works on!)
Thank you, but the demo pics are all gone.

and there's no doc in the DLL package,
So , can someone revive this threat ?
AnnaFan777 is offline   Reply With Quote
Old 7th December 2008, 13:03   #86  |  Link
zee944
Registered User
 
Join Date: Apr 2007
Posts: 240
I have a badly encoded video, this one:
http://www.badongo.com/file/12382006 (sample, 12 Mbytes)

I'm just assuming a 25 fps PAL master was used and blended to 29.97i. (Or perhaps fieldblended to 23.976 then telecined.) A lot of frames can only be found as blended. I know from other threads RestoreFps() would probably be the best solution to this, but I can't get it to work.

First, this phase-finder script doesn't work:

Code:
Function phase(clip c, float phi)
{
c
RestoreFPS(24/1.001, phi) #set appropriate frame rate

#trim here if desired

a=selectevery(6,0)
b=selectevery(6,1)
c=selectevery(6,2)
d=selectevery(6,3)
e=selectevery(6,4)
f=selectevery(6,5)

stackhorizontal(a,b,c,d,e,f)
Reduceby2()
stackvertical(last, trim(1,0), trim(2,0), trim(3,0), trim(4,0), trim(5,0))
Trim(0,-1).Loop(0,1000)
subtitle(String(phi, "%f"))
}

#source clip here
animate (0, 100,"phase", 0.0, 1.0)
trim(0, 100)
It only works if I delete the Trim(0,-1).Loop(0,1000) line, but then it becomes suspicious something isn't right. Even then I don't know what to look for - a moment where all the 6 frames look perfect? I've played a LOT around the phase value in a different script, but couldn't find a good value.

Code:
LoadPlugin("Restorefps.dll")
MPEG2Source("Twin_Dragons_Joy_Sales_VideoFile.d2v")
Bob()
RestoreFPS(47.952,[<"phase", 1, 1000, 331>]*0.0033) #set appropriate frame rate
The example pictures are long gone too.

Could someone help pointing me to the right direction? This is the only source worldwide of this version of the movie, and I've no idea what to do now. Thank you in advance.
zee944 is offline   Reply With Quote
Old 13th March 2011, 19:12   #87  |  Link
DoctorM
Registered User
 
Join Date: Sep 2005
Posts: 532
Sorry to bump an old one, but does anyone have a working link for RestoreFPS or a suggestion for a newer filter that does the same thing?
Edit: Sorry, found it on AviSynth's Wiki: http://avisynth.org/mediawiki/RestoreFPS

Last edited by DoctorM; 13th March 2011 at 19:15.
DoctorM is offline   Reply With Quote
Old 13th March 2011, 22:00   #88  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 762
SRestore.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're working on that issue. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 13th March 2011, 22:14   #89  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,394
Quote:
Originally Posted by Emulgator View Post
SRestore.
No. Not even remotely.

Code:
some_video_clip_in_24fps

ConvertFPS(25.000)
Now try SRestore. Big big fail, simply because it is not made for this kind of blending. RestoreFPS is.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 13th March 2011, 22:32   #90  |  Link
DoctorM
Registered User
 
Join Date: Sep 2005
Posts: 532
Just starting out, but RestoreFPS seems to be working great. My source appears to have been 24p -> 25i (with blended fields) -> 29.97i (with more blending).
I'm getting some pretty good results stacking restoration filters: RestoreFPS(50).SRestore(23.976). I'll toy with it a bit more later.
DoctorM is offline   Reply With Quote
Old 16th March 2011, 01:20   #91  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 762
Hm, true, I should have used it on such source before suggesting...
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're working on that issue. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 23rd March 2011, 00:13   #92  |  Link
DoctorM
Registered User
 
Join Date: Sep 2005
Posts: 532
Okay, it was crazy, but I figured my bizarre video out.

The source underwent: 24fps film to 25fps PAL video (by speed up) to 29.97i video (by blending fields).

To repair:
Code:
yadif(mode=1) #produced cleaner frames in this case
restorefps(50,1)
selectodd()
assumefps(23.976)
Never seen it done before. Very bizarre.

To be fair about two thirds of the way through the even frames became the good ones. I fixed that by splitting the video and adjusting the selectodd.

Thanks for the very useful RestoreFPS!

Last edited by DoctorM; 23rd March 2011 at 00:16.
DoctorM is offline   Reply With Quote
Old 7th June 2013, 15:26   #93  |  Link
ceth
Registered User
 
Join Date: May 2011
Posts: 34
Quote:
Originally Posted by zee944 View Post
[...]I can't get it to work.
First, this phase-finder script doesn't work:
[...]
It only works if I delete the Trim(0,-1).Loop(0,1000) line, but then it becomes suspicious something isn't right. Even then I don't know what to look for - a moment where all the 6 frames look perfect? I've played a LOT around the phase value in a different script, but couldn't find a good value.
[...]
The example pictures are long gone too.
Could someone help pointing me to the right direction?
Hello,

Same story for me.
And I'm new to this. I managed to fix a doubleblend with srestore but I don't understand the process of using RestoreFPS.

Could someone help with some more noob-friendly explanations about using RestoreFPS ?

To begin, as for zee944 I can't make the phase-finder script work. Using the full script result in only 1 frame (made of 6x6 frames) and I only get more by commenting the Trim(0,-1).Loop(0,1000) line
ceth is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 14:14.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.