Log in

View Full Version : InterFrame 2.8.2 - Framedoubling/60FPS/HFR conversion script


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 [14] 15 16 17 18 19 20

rowas
5th June 2014, 21:58
I know for a fact that Interframe is usable with any program that can handle AviSynth scripts. Up until now, I've been using the method described in the step-by-step guide with MeGUI.

However, I need to use MediaCoder and I've been attempting to follow along with the MeGUI guide to get videos to convert correctly on the other program. I'm not sure what I'm doing wrong... is there anyone here who can post a step-by-step guide for using Interframe with MediaCoder?

Music Fan
5th June 2014, 22:21
You just have to load your avs script in MediaCoder, as with all encoders, assuming MediaCoder accept avs scripts. Otherwise you can load your script in Virtual Dub, encode in lossless (Lagarith is good for this), then load your Lagarith video (in avi container) in MediaCoder.
The quality will be exactly the same and the whole process won't need much more time than loading directly the script in MediaCoder.
If you do this, don't forget to configure correctly Lagarith (untick RGB and choose YV12 if your video is in YV12, which is the case of most videos).

Bloax
6th June 2014, 00:43
Don't forget to set [Video > Color Depth > Output format to compressor/display -> 4:2:0 planar YCbCr (YV12)] in VirtualDub if you're going to encode it to YV12 in Lagarith. (And if your avisynth input is YV12, you may also want to set "Decompression format" to the same thing.)

foxyshadis
7th June 2014, 02:27
Unless you're doing multiple encodes, avsproxy is usually much faster than a lossless step. The disk writing & reading kills speed, and lagarith is pretty slow too.

Mediacoder might not work because it includes version 2.6 alpha 2 of avisynth, which doesn't really work with anything. Replace it (in the "codecs" folder) with your own avisynth.dll from the windows folder.

Music Fan
7th June 2014, 11:48
The disk writing & reading kills speed, and lagarith is pretty slow too.
The encoding time difference between avsproxy and lagarith is probably very thin, especially when encoding in x264 (which needs much more time than reading the source file).
I didn't know avsproxy but there were other tricks to render avs script as "virtual" avi for non avs compatible applications (AVS2AVI, MakeAVIS, VFAPI with readAVS.dll ...), but I don't know what is better.
Are you sure avsproxy can work with anything else than Avidemux ?
http://www.avidemux.org/admWiki/doku.php?id=using:avsproxy
AvsProxy, as the name says, is a proxy between Avisynth and Avidemux.

rowas
8th June 2014, 00:15
I'm gonna come out of the digital closet here and say that there are ulterior motives for getting a motion interpolation script working with MediaCoder.

I have OSX installed on my system and I was frustrated having to switch to Windows to run the conversion. Currently, there are no viable methods to run motion interpolation on videos on OSX except with professional video editing software. I've looked, but didn't find any native OSX software that can use Avisynth. Maybe someone can point me to something if it exists?

Just out of curiosity, I checked to see if MeGUI can run under Wine (with Crossover). It doesn't.
However, I discovered that MediaCoder (despite being nagware), lists good compatibility with OSX and Linux when running under Wine.
So far, the program has given me no problems other than confusing me when getting Avisynth to work.

I'm quite sure that Avisynth can work in this environment and the fault is likely entirely my own for being quite ignorant in this area (pretty n00b actually). But bear with me. Once I have this figured out, I'm sure this will help others in the future who want to experience videos differently.
Once done, I'll be posting a video tutorial along with a guide similar to Subjunk's guide on Spirton (http://www.spirton.com/convert-videos-to-60fps/) for users who are using OSX or Linux who are using Wine. Perhaps, he may want to post my guide there as well, who knows. I just want my 60fps videos.

Here are the steps I am taking. Please examine them and let me know what I'm doing wrong. I'm following along with Subjunk's guide here, looking for the equivalent procedures on MediaCoder as MeGUI.

1.) Install the Avisynth program as provided on Spirton. v2.6 alpha
2.) Install MediaCoder v0.8.30.5622 (32-bit) Full edition - non portable
3.) Extract "tools" to program files > MediaCoder > tools
4.) Create the script. I edited the script from the guide
Setmemorymax(2048)
SetMTMode(3,4)
PluginPath = "C:\Program Files\MediaCoder\tools\avisynth_plugin\"
LoadPlugin(PluginPath+"svpflow1.dll")
LoadPlugin(PluginPath+"svpflow2.dll")
Import(PluginPath+"InterFrame2.avsi")
<input>.ConvertToYV12()
SetMTMode(2)
<deinterlace>
<crop>
<denoise>
<resize>
InterFrame(Cores=8)
5.) I didn't see a built- in script wizard like MeGUI does, so I used a normal text editor. The example script does not include the video input so I added
DirectShowSource("c:\Program Files\Working\In\Sample.mp4")
to point to the video at the first line.
6.) I now believe the script to be finished, so I save the .avs file in \Working\Scripts
7.) That done, I drag the script into the queue in MediaCoder. MediaCoder is set to its defaults currently and nothing has been changed. I try encoding the video. It doesn't work and I get an error message stating that "An Invalid Combination of Settings is Made."

7.) I also tried a different method where I used the "AviSynth" tab and specified my script as the script template (without the first line), dragging "Sample.mp4" to the list and trying to encode it that way. The process works, but the resulting video is the same as the input video as if the script was bypassed entirely.

SubJunk
8th September 2014, 23:22
Hi rowas, it might be that some of the lines in that script are MeGUI-specific; <input> is a placeholder that shows MeGUI where to put the input file, <deinterlace> shows it where to put deinterlacing stuff, etc. so we can remove those bits of code and replace <input> with your input.
So for a non-MeGUI script you can try:

Setmemorymax(512)
SetMTMode(3,4)
PluginPath = "C:\Program Files\MediaCoder\tools\avisynth_plugin\"
LoadPlugin(PluginPath+"svpflow1.dll")
LoadPlugin(PluginPath+"svpflow2.dll")
Import(PluginPath+"InterFrame2.avsi")
DirectShowSource("C:\Program Files\Working\In\Sample.mp4").ConvertToYV12()
SetMTMode(2)
InterFrame(Cores=4)

Other things I changed were memory from 2048 to 512, because AviSynth is bad at dealing with memory so this has to be low for stability, regardless of how much RAM you have on the computer.
Also the second number in "SetMTMode" should be the same as "Cores".

If you end up publishing a guide for OS X I'll be happy to link to it from my guide

SubJunk
9th September 2014, 01:53
InterFrame 2.6.0 is released, with the addition of a new boolean "FrameDouble" to always double the framerate. Enjoy!

Sparktank
9th September 2014, 12:20
new boolean "FrameDouble"

Nice one, thanks. :)

StainlessS
9th September 2014, 12:23
+1 to that.:thanks:

Bloax
9th September 2014, 16:58
Hell yeah, no more checking the actual video framerate and manually setting the damn settings.
Thanks!

sofakng
3rd October 2014, 02:19
Is there a difference in 60 FPS and 120 FPS?

My monitor is 120 Hz and SVP always converts to 120 FPS. However, SVP doesn't always achieve 120 FPS so I'm looking to do offline conversion so it plays smoother.

Is there a difference in 60 vs 120 FPS?

Also, how would I tell InterFrame to convert to 60 and 120?

SubJunk
3rd October 2014, 02:58
Sure, 120 FPS will be even smoother than 60 FPS, but will take almost twice as long to convert so you should compare the conversion speeds between the two framerates and decide if it's worth it :)

InterFrame(Cores=x, NewNum=120000, NewDen=1001)

sofakng
3rd October 2014, 03:03
Thanks, that's what I thought.

Encoding is very, very slow with 1080p... (h264 encoding doesn't take too long but SVP absolutely kills my i5-2500k CPU).

SubJunk
3rd October 2014, 03:48
You can try different speed presets in both InterFrame and x264 to make it pretty fast

johnmeyer
3rd October 2014, 05:10
Does converting to 120 fps actually make the video look better?? I would think that any minor improvement in smoothness would be more than offset with the inevitable artifacts that motion estimation introduces. I have only seen the results of my TV's internal software ("Auto Motion Pro") which does a similar thing, and I have to say that the result is most definitely not addictive. However, perhaps I have not tried using it on the right video sources, and therefore it might look good with some program material.

Chacun à son goût, I guess.

creaothceann
3rd October 2014, 09:02
However, perhaps I have not tried using it on the right video sources, and therefore it might look good with some program material.

http://www.youtube.com/watch?v=lXX7dRULFaE
http://amvnews.ru/index.php?go=Files&file=down&id=4941

johnmeyer
3rd October 2014, 15:55
I only watched the YouTube video. The video quality was absolutely awful to begin with, and the morphing artifacts between the anime slow/variable framerate was terribly distracting.

I restore old films and video for a living, and I am probably more sensitive than most people to artifacts that result from technology designed to improve video. I know what it is like to apply a noise filter, for instance, and initially marvel at the reduction in noise, only to later realize what a mess I've created. From those experiences, I've learned to live by this old quote: Less is more. (Mies van der Rohe, from Robert Browning).

However, if you like it, that is all that matters. Pay no attention to me ...

SubJunk
4th October 2014, 04:23
The quality of interpolation will be the same whether 60FPS or 600FPS, because motion vectors are used to create the intermediate frames - adding more frames doesn't change the motion vectors, and every time you double the frames it means each frame is being displayed for half the time as before, so the quality always looks the same regardless.

TL;DR If you don't like it at 60FPS then 120FPS won't change it negatively or positively

daglax
4th October 2014, 17:50
Is it possible to use this script with avisynth x64? It would be really nice to use more than 2 Gigs of RAM when applying different filters.

PS: I found a movie interpolated to 40 fps to have a lot less artifacts than a movie interpolated to 60 fps. So i don't think that's completly true.

Music Fan
4th October 2014, 19:20
Are you sure avisynth x86 is limited to 2 GB when installed on Windows 64 bit ?

daglax
4th October 2014, 19:38
Yes. A 32 bit application only uses 2 Gigs of RAM regardless of 32bit or 64bit windows operation system.

I did run into some errors during realtime encoding due to this limited amount of RAM available.

SubJunk
5th October 2014, 05:14
Yeah the RAM thing is true, I haven't tried AviSynth x64 so I'm not sure if this script works with it.
I haven't had any issues with this script running out of memory when I use SetMemoryMax(512), but it has at higher values than that. But I haven't done much 4k interpolation, only 1080p.

Asmodian
5th October 2014, 07:18
You can get Avisynth x86 to use 4 Gigs of RAM on a 64 bit OS if your application is Large Address Aware. You can patch an application to be large address aware too, lots of tools available if you google.

Music Fan
5th October 2014, 13:05
Interesting, could you explain how to do this for avisynth ?
The 1st result found with google ;
http://www.techpowerup.com/forums/threads/large-address-aware.112556/
It seems to work with all 32 bit programs but I'm not sure.

videoh
5th October 2014, 13:31
Interesting, could you explain how to do this for avisynth ? You can't do it to a DLL, because large address awareness is a process attribute, i.e., it applies to EXEs. You need to apply it to the EXE that invokes Avisynth.

Music Fan
5th October 2014, 13:45
Ok, do you mean the program in which the script is opened, for example Virtual Dub ?

videoh
5th October 2014, 14:53
Yes, that is correct.

StainlessS
5th October 2014, 15:05
It is my understanding that you can enable Large Address Aware for program invoking Avisynth for both 32/64 bit systems.
Under 32 bit OS, enables 3GB user space, Under 64 bit OS, enables 4GB user space.

Question:
Is there any difference to the invoking LAA executable, ie do you have to have one for 32 bit OS @3GB and another for 64bit OS @ 4GB ?
(or is it just setting a flag that is interpreted differently depending upon system).
EDIT: What if any difference if executable is 32bit / 64bit ?


Thank you in advance.

daglax
5th October 2014, 17:27
To answer the question, i asked:

No, it's not possible to use Interframe with Avisynth x64. Large Address Aware seems like a good alternative, unfortunately this program doesn't really work with avisynth. mpc-hc still crashes at around 2GB RAM usage with heavy post processing scripts enabled.

i guess the only thing we can do is to wait for an 64bit working svpflow.dll from the SVP developers, which they declined a while ago in their forums.

Groucho2004
5th October 2014, 17:50
unfortunately this program doesn't really work with avisynthWhich program?

Groucho2004
5th October 2014, 17:56
Under 32 bit OS, enables 3GB user space
Only under specific conditions, see link below.

Question:
Is there any difference to the invoking LAA executable, ie do you have to have one for 32 bit OS @3GB and another for 64bit OS @ 4GB ?
(or is it just setting a flag that is interpreted differently depending upon system).
EDIT: What if any difference if executable is 32bit / 64bit ?


Thank you in advance.
Have a look here. (http://blogs.technet.com/b/askperf/archive/2007/03/23/memory-management-demystifying-3gb.aspx)

daglax
5th October 2014, 19:15
Which program?
Large Address Aware

Keiyakusha
5th October 2014, 19:20
mpc-hc still crashes at around 2GB RAM usage with heavy post processing scripts enabled.

what about virtualdub? maybe that's mpc-hc being buggy. Also have you patched mpc-hc with largeadressaware? Because host app should be patched, not the avisynth itself.

Groucho2004
5th October 2014, 20:38
Large Address Aware
:confused::confused:
"LARGE_ADDRESS_AWARE" is a linker flag. For an already built binary it can be applied by patch. Try Keiyakusha's suggestions.

Edit:
I see now that somebody made a "program" called Large Address Aware. Funny, it requires .NET Framework 3.5 although a patch utility like this could be written in 5 minutes with a few lines of C code. Talk about hyper-bloat.

Music Fan
5th October 2014, 20:45
:confused::confused:
"LARGE_ADDRESS_AWARE" is a linker flag.
That's also the name of a tool which allows to patch programs, I gave the link page 34.

daglax
6th October 2014, 20:15
if anything in the combination mpc-hc - ffdshow - avisynth is laggy, it sure is avisynth. The plugins and dlls aren't supposed to run in x64 or with a large adress aware flag.
Unfortunately Interframe stays 32bit with max 2 Gigs of RAM

Groucho2004
7th October 2014, 10:23
if anything in the combination mpc-hc - ffdshow - avisynth is laggy, it sure is avisynth.
It's not Avisynth that's slow, it's the filters and how you use them. Your statement borders on trolling since you provide no data whatsoever to back it up.

The plugins and dlls aren't supposed to run in x64 or with a large adress aware flag.
Another ridiculous statement.

Unfortunately Interframe stays 32bit with max 2 Gigs of RAM
More proof that you have not understood anything what other users here tried to tell you. It's not the plugins that have to be "large address aware", it's the application that interfaces with Avisynth.

By the way, mpc-hc uses more than 2GB happily in my quick test:

Script:
SetMemoryMax(4000)
SetMTMode(3)
LWLibavVideoSource("test.264", threads = 1)

SetMTMode(2)
SlowMotion(multi = 5)

function SlowMotion (clip video, int "multi")
{
last = video
org_num = FramerateNumerator(last)
org_den = FramerateDenominator(last)
multi = default(multi, 2)
InterFrame(NewNum = FramerateNumerator(last) * multi, NewDen = FramerateDenominator(last), Cores = 4, Tuning = "Smooth", GPU = true)
AssumeFPS(org_num, org_den)
return last
}


Task Manager:
http://s29.postimg.org/k3h5jaeon/mpchc.png

chainik_svp
7th October 2014, 21:46
mpc-hc.exe is already "patched" since ages ;)
common apps that need to be patched are x264.exe and potplayermini.exe

and again and again - if you really lack memory with some AVS script try SVP's avisynth.dll at the first place
it was specifically optimized to save memory in MT mode to not break 3GB level
look at SVP generated scripts for sample code

Groucho2004
7th October 2014, 22:27
mpc-hc.exe is already "patched" since ages ;)
Indeed.

common apps that need to be patched are x264.exe and potplayermini.exe
32 Bit x264 has the large address aware linker flag set by default. Why would it need to be patched?
On a 64 Bit system one would use the 64 Bit x264 anyway, receiving frames through stdout from Avisynth.

chainik_svp
8th October 2014, 09:24
32 Bit x264 has the large address aware linker flag set by default. Why would it need to be patched.

some people complained about the one included with MeGUI for example

Groucho2004
8th October 2014, 10:17
some people complained about the one included with MeGUI for example
Odd. One would have to deliberately remove that linker switch when compiling x264 or "un-patch" the binary. Both of which seem rather unlikely.

mixmasterarne
24th December 2014, 15:31
Hello Doom9 Board.

i am a big fan of frame interpolation and using this tool a lot to increase the overall picture quality. I do not use the realtime solution with Potplayer or MPC. I am using a interframe gui tool, that is based on the avisynth encoder and megui. It can be found here:

https://highframerate.wordpress.com/int … -download/

I tested this on several movies and it worked out quite good, smooth motions and fine image quality. However, there are still artifacts when it comes to motions that are not straight like people running on a police chase.

I was searching for a method or special settings on the template, that will lower the amount of artifacts. So far i did not find them, if anyone hase some settings please let me know.

The next thing i was testing was that i took the new X265 encoder and replaced it in the folder of the X264 exe. There are x265 builds deployed every day on this page:

http://builds.x265.eu/

So i took the latest x32 build with 8bit and renamed it to x264.exe and put into the folder of the interframe gui program.

The result was good and i noticed that the amount of artifact was slightly reduced. Has anyone some experience with X265 and frame interpolation?

Are there possibilites to run the frame interpolation also with 4K content?

Music Fan
24th December 2014, 15:49
Your link is incomplete, I guess it's this one ;
https://highframerate.wordpress.com/interframegui-download/

Sparktank
25th December 2014, 00:05
I was searching for a method or special settings on the template, that will lower the amount of artifacts. So far i did not find them, if anyone hase some settings please let me know.

You could lower the new fps to 48 instead of 60.
That would lower artefacts.

You could also use SVP which allows much more customization and save as an AVS script and run that through an encoder.

Also it helps a lot to have a capable graphics card so you can set GPU=true.

IMO, double the frame rate looks better than 2.5x the frame rate.

My monitor is also capable of doing 60/70/75 Hz, so I customized it to do 71.928 Hz instead.
So 47.952fps (double of NTSC_FILM@23.976) looks superb.

wonkey_monkey
25th December 2014, 01:19
IMO, double the frame rate looks better than 2.5x the frame rate.

Doubling means you have just one interpolated frame between every input frame, and all of the input frames make it into the output. If you use a non-integer multiplier, on the other hand, not all of the input frames will even make it into the output unaltered - so with 2.5x, you end up one unaltered input frame followed by four interpolated frames, which skip over the next input frame (if that makes sense)

See how frame 1 (and all other odd frames, if you continue the list) doesn't appear in the list under 2.5x:


Output frame number 2x 2.5x
0 0 0
1 0.5 0.4
2 1 0.8
3 1.5 1.2
4 2 1.6
5 2.5 2
6 3 2.4
7 3.5 2.8

Sparktank
25th December 2014, 01:28
Output frame number 2x 2.5x
0 0 0
1 0.5 0.4
2 1 0.8
3 1.5 1.2
4 2 1.6
5 2.5 2
6 3 2.4
7 3.5 2.8


I actually never looked at it that way.
I've been using double so I can keep it at 1080p for remuxes (to avoid frame drops in MadVR).
I used to do 60fps (2.5 for me in NTSC) but had to resize to 1280width or even 800width in SVP.

I should start playing with everything again.
1280width wouldn't be so bad. I don't exactly have HD monitors.

Since I'm going to resize, I wonder how different resize filters affect interpolation quality.
I did notice that in SVP, it would always use Lanczos to downsize, until I modified scripts to use Spline in all circumstances.

After the holidays, I'll give a few different resizers a go.
I did notice a difference between Lanczos and Spline when interpolating (especially when using Pulfrich 3D glasses).
(and create a new thread to discuss more on resizing+interpolating)

Music Fan
25th December 2014, 10:43
Doubling means you have just one interpolated frame between every input frame, and all of the input frames make it into the output. If you use a non-integer multiplier, on the other hand, not all of the input frames will even make it into the output unaltered - so with 2.5x, you end up one unaltered input frame followed by four interpolated frames, which skip over the next input frame (if that makes sense)
I'm not sure to understand the sense of your message because your reasoning seems to confirm that Sparktank made the good choice.
Doubling the framerate should be better, there is only one new frame between two original frames unaltered and there are probably less artifacts.
With 2,5 multiplication, you can't keep all original frames, otherwise the process would add judder (36 new frames can't be spread evenly between the 24 original frames).

I don't know how Interframe works, but the best solution to get 60 frames from 24 may be to convert 24 fps into 120 fps (24 x 5), then keep 1 frame on 2.

mixmasterarne
25th December 2014, 21:25
Hello,

i know that there are some special settings from svp for example anime movies to prevent artifacts.

Can someone show me how to import these settings to the avisynth script?

wonkey_monkey
25th December 2014, 22:58
I don't know how Interframe works, but the best solution to get 60 frames from 24 may be to convert 24 fps into 120 fps (24 x 5), then keep 1 frame on 2.

That wouldn't be any different to going direct from 24 to 60 - half of the unaltered input frames would still get dropped at the "keep 1 frame in 2" stage.