RestoreFPS
(New page: {{FilterCat|External_filters|Restoration_filters|Deblenders}} {{Filter|{{Author/mg262}}|2005.07.31|[http://avisynth.org/warpenterprises/files/restorefps_25_dll_20050731.zip restorefps_25_d...) |
(add archived downloads) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{FilterCat4|External_filters|Plugins|Restoration_filters|Deblenders}} |
− | {{ | + | {{Filter3 |
− | + | |{{Author/mg262}} | |
− | | | + | |v1.0 |
− | + | |[http://wilbertdijkhof.com/mg262/Restorefps_v10.zip Restorefps_v10.zip] | |
+ | |Deblenders | ||
+ | |[http://www.gnu.org/licenses/gpl-2.0.txt GPLv2] | ||
+ | |6=[http://forum.doom9.org/showthread.php?t=94091 Doom9 Thread]}} | ||
− | + | == Description == | |
− | == | + | |
[[RestoreFPS]] reverses the kind of blending generated by [[ConvertFPS]], restoring original framerate. | [[RestoreFPS]] reverses the kind of blending generated by [[ConvertFPS]], restoring original framerate. | ||
It will work perfectly well on any regular blend pattern, including the [http://home.arcor.de/scharfis_brain/ExotischesInterlacing/#2.3 types] mentioned by scharfis_brain [http://forum.doom9.org/showthread.php?s=&threadid=89266 in this thread] | It will work perfectly well on any regular blend pattern, including the [http://home.arcor.de/scharfis_brain/ExotischesInterlacing/#2.3 types] mentioned by scharfis_brain [http://forum.doom9.org/showthread.php?s=&threadid=89266 in this thread] | ||
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 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.) | ||
− | == | + | <br> |
− | * | + | <br> |
− | + | == Requirements == | |
+ | *AviSynth 2.5.8 or [http://sourceforge.net/projects/avisynth2/files/AviSynth_Alpha_Releases/ later] | ||
+ | *Supported color formats: [[YV12]] | ||
+ | <br> | ||
+ | == [[Script variables|Syntax and Parameters]] == | ||
+ | :{{Template:FuncDef|RestoreFPS (clip, float, float)}} | ||
+ | <br> | ||
+ | ::{{Par2| |clip| }} | ||
+ | :::Input clip. | ||
+ | <br> | ||
+ | ::{{Par2| |float| }} | ||
+ | :::'''''FPS''''' is the 'underlying' frame rate of the input clip (which will actually have a higher actual frame rate due to blending), RestoreFPS will try to reverse the blending and restore the original frame rate. | ||
+ | <br> | ||
+ | ::{{Par2| |float| }} | ||
+ | :::'''''Phase''''' is a number between 0 and 1 which specifies the relative displacement of old and new clips (see example below). | ||
+ | <br> | ||
+ | :*'''Note:''' all parameters are unnamed and do not have a default so they must be specified. | ||
+ | <br> | ||
== Examples== | == Examples== | ||
− | In order to test the filter we need to generate a clip using ConvertFPS. A script like this: | + | In order to test the filter we need to generate a clip using [[ConvertFPS]]. A script like this: |
− | <pre> | + | <ul><pre> |
− | + | BicubicResize(4*60,3*60) | |
− | + | SelectEvery(200,0) | |
− | + | AssumeFPS(24000,1001) | |
− | + | ConvertFPS(25) | |
− | + | Overlay([[Crop(0,0,-0, 26, true).ShowFrameNumber) | |
− | + | </pre></ul> | |
− | + | ||
− | </pre> | + | |
will do the trick. | will do the trick. | ||
− | Now running RestoreFPS(24/1.001, 0.00) produces a stream of frames. | + | Now running <tt>RestoreFPS(24/1.001, 0.00)</tt> produces a stream of frames. |
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. That won't always be true - if we take the '''convertFPS''' clip above and trim it (say add '''Trim(10,0)'''), then we have a different situation. | 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. That won't always be true - if we take the '''convertFPS''' clip above and trim it (say add '''Trim(10,0)'''), then we have a different situation. | ||
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: | 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: | ||
− | <pre> | + | <ul><pre> |
function phase(clip c, float phi){ | function phase(clip c, float phi){ | ||
c | c | ||
Line 36: | Line 53: | ||
#trim here if desired | #trim here if desired | ||
− | a= | + | a=SelectEvery(6,0) |
− | b= | + | b=SelectEvery(6,1) |
− | c= | + | c=SelectEvery(6,2) |
− | d= | + | d=SelectEvery(6,3) |
− | e= | + | e=SelectEvery(6,4) |
− | f= | + | 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) | Trim(0,-1).Loop(0,1000) | ||
− | + | Subtitle(String(phi, "%f")) | |
} | } | ||
#insert source clip here | #insert source clip here | ||
− | + | Animate(0,100,"phase",0.0,1.0) | |
− | + | Trim(0,100) | |
− | </pre> | + | </pre></ul> |
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). | 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). | ||
'''Note''': If you're dealing with a clip in which fields (not full frames) are blended, separate them and process them separately; the phase parameters for the top and bottom fields will possibly differ by 0.5. | '''Note''': If you're dealing with a clip in which fields (not full frames) are blended, separate them and process them separately; the phase parameters for the top and bottom fields will possibly differ by 0.5. | ||
+ | <br> | ||
+ | <br> | ||
+ | == Archived Downloads == | ||
+ | {| class="wikitable" border="1"; width="600px" | ||
+ | |- | ||
+ | !!width="100px"| Version | ||
+ | !!width="150px"| Download | ||
+ | !!width="150px"| Mirror | ||
+ | |- | ||
+ | !v1.0 | ||
+ | |[http://wilbertdijkhof.com/mg262/Restorefps_v10.zip Restorefps_v10.zip] | ||
+ | |[http://web.archive.org/web/20150222225736/http://wilbertdijkhof.com/mg262/Restorefps_v10.zip Restorefps_v10.zip] | ||
+ | |- | ||
+ | !v20050731 | ||
+ | |[http://www.avisynth.nl/users/warpenterprises/files/restorefps_5F25_dll_20050731.zip restorefps_25_dll_20050731.zip] | ||
+ | |[http://web.archive.org/web/20140420183538/http://www.avisynth.nl/users/warpenterprises/files/restorefps_5F25_dll_20050731.zip restorefps_25_dll_20050731.zip] | ||
+ | |} | ||
+ | <br> | ||
==External Links== | ==External Links== | ||
− | *[http://forum.doom9.org/showthread.php?t=94091 | + | *[http://forum.doom9.org/showthread.php?t=94091 Doom9 Forum] - RestoreFPS discussion. |
+ | *[http://forum.doom9.org/showthread.php?t=118430 Doom9 Forum] - mg262's plugins with source | ||
+ | <br> | ||
+ | <br> | ||
+ | ----------------------------------------------- | ||
+ | '''Back to [[External_filters#Fieldblending_and_Frameblending_removal|External Filters]] ←''' |
Latest revision as of 00:07, 23 February 2015
Abstract | |
---|---|
Author | mg262 |
Version | v1.0 |
Download | Restorefps_v10.zip |
Category | Deblenders |
License | GPLv2 |
Discussion | Doom9 Thread |
Contents |
[edit] Description
RestoreFPS reverses the kind of blending generated by ConvertFPS, restoring original framerate. It will work perfectly well on any regular blend pattern, including the types mentioned by scharfis_brain in this thread
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.)
[edit] Requirements
[edit] Syntax and Parameters
- RestoreFPS (clip, float, float)
- clip =
- Input clip.
- clip =
- float =
- FPS is the 'underlying' frame rate of the input clip (which will actually have a higher actual frame rate due to blending), RestoreFPS will try to reverse the blending and restore the original frame rate.
- float =
- float =
- Phase is a number between 0 and 1 which specifies the relative displacement of old and new clips (see example below).
- float =
- Note: all parameters are unnamed and do not have a default so they must be specified.
[edit] 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) AssumeFPS(24000,1001) ConvertFPS(25) Overlay([[Crop(0,0,-0, 26, true).ShowFrameNumber)
will do the trick. Now running RestoreFPS(24/1.001, 0.00) produces a stream of frames. 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. That won't always be true - if we take the convertFPS clip above and trim it (say add Trim(10,0)), then we have a different situation. 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) #here 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")) } #insert 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).
Note: If you're dealing with a clip in which fields (not full frames) are blended, separate them and process them separately; the phase parameters for the top and bottom fields will possibly differ by 0.5.
[edit] Archived Downloads
Version | Download | Mirror |
---|---|---|
v1.0 | Restorefps_v10.zip | Restorefps_v10.zip |
v20050731 | restorefps_25_dll_20050731.zip | restorefps_25_dll_20050731.zip |
[edit] External Links
- Doom9 Forum - RestoreFPS discussion.
- Doom9 Forum - mg262's plugins with source
Back to External Filters ←