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 > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 4th March 2015, 17:45   #141  |  Link
kaefert
Registered User
 
Join Date: Jul 2013
Posts: 60
is there something like SVP or Interframe for Vapoursynth?

I mean some library that allows to calculate extra frames between other frames based on movement analysis?

If I understood it correctly MVTools is only the "basis" for such a tool since it provides motion analysis functions, but it does not contain a function to calculate extra frames based on those analysis, is that correct?
kaefert is offline   Reply With Quote
Old 5th March 2015, 09:51   #142  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
SVPFlow is based on the same idea as MVFlow, which is an extension of MVCompensate from blocks to single pixels. It certainly is possible, it just won't be as high quality as SVP, as they've done a bang-up job of enhancing the quality as much as possible. See a rather old thread for an idea of how to get MVFlowFPS working. I'm a little too tipsy to convert to VS right now.
foxyshadis is offline   Reply With Quote
Old 5th March 2015, 16:06   #143  |  Link
kaefert
Registered User
 
Join Date: Jul 2013
Posts: 60
okey, thanks for the reply foxyshadis!
did I understand you correctly:
Is the recommendation for getting the best possible quality of Motion Interpolation to stick to using Avisynth 32bit + SVP?

Last edited by kaefert; 5th March 2015 at 16:10.
kaefert is offline   Reply With Quote
Old 5th March 2015, 19:38   #144  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Quote:
Originally Posted by kaefert View Post
okey, thanks for the reply foxyshadis!
did I understand you correctly:
Is the recommendation for getting the best possible quality of Motion Interpolation to stick to using Avisynth 32bit + SVP?
Yes, SVP's gpu-accelerated quality is much nicer than either mvtools or SVP's cpu mode. They've put a lot of professional effort into it.

You can use SVP in VSynth through the avs wrapper. Right now that means limited to 8-bit, but kolak and SEt are pushing them to include stacked 16-bit as well.
foxyshadis is offline   Reply With Quote
Old 6th March 2015, 07:20   #145  |  Link
kaefert
Registered User
 
Join Date: Jul 2013
Posts: 60
oh. okey. so does that mean that if I'm using a a Server that has a nice octacore Xeon CPU, but virtually no GPU "Matrox G200e (Server Engines)" that I have no chance to get this quality?
I guess I would need nvidia or ati to be able to use gpu-accelerated version, correct?

UPDATE: okey so I've found this compatibility list for which GPUs work:
http://www.svp-team.com/wiki/GPU_Compatibility
But I could not yet find an answer to the question if I can't simply generate the "same" quality of motion interpolated in-between frames by using SVP with the gpu=0 parameter set. (slower of course, but since I want to encode the result instead of displaying it live (like the SVP-team seems to intend) slower is annoying but not a deal breaker for me)

Last edited by kaefert; 7th March 2015 at 16:37.
kaefert is offline   Reply With Quote
Old 9th March 2015, 23:40   #146  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Here is v8.

Code:
   * Fix occasional division by zero in Analyse with 16 bit input
Not much new in this one.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 22nd May 2015, 15:52   #147  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
uh... really don't wanna be a dick here, but gotta ask about "vmulti, mdegrainN" stuff again, those are planned to be implemented someday or like, never gonna happen?
I'm like, ditching avisynth and moving everything to vaporsynth and mvtools, it's the only major problem I got now
plz, gimme an answer, functions added by Firesledge, will they ever appear in vsmvtools?
feisty2 is offline   Reply With Quote
Old 22nd May 2015, 22:40   #148  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by feisty2 View Post
uh... really don't wanna be a dick here, but gotta ask about "vmulti, mdegrainN" stuff again, those are planned to be implemented someday or like, never gonna happen?
I'm like, ditching avisynth and moving everything to vaporsynth and mvtools, it's the only major problem I got now
plz, gimme an answer, functions added by Firesledge, will they ever appear in vsmvtools?
At the moment, I have no plans to touch MVTools except to fix bugs.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 23rd May 2015, 00:01   #149  |  Link
captainadamo
Guest
 
Posts: n/a
Quote:
Originally Posted by Are_ View Post
Results for Degrain test:
Code:
8 threads:
    VapourSynth Windows = 32.35 fps (100% cpu)
    VapourSynth Linux =      37.50 fps (100% cpu)
    AviSynth firesledge =       8.32 fps (35% cpu)
1 thread:
    VapourSynth Windows =   5.32 fps (12% cpu)
    VapourSynth Linux =        5.50 fps (12% cpu)
    AviSynth Vanilla =           4.42 fps (12% cpu)
    AviSynth SVP =               6.05 fps (12% cpu)
VapourSynth script:
Code:
import vapoursynth as vs
core = vs.get_core()  # threads=1
v = core.lsmas.LWLibavSource(r'720x480 YUV420P8 mpeg2.mkv')
super = core.mv.Super(src)
mvbw3 = core.mv.Analyse(super, isb=True, delta=3, overlap=4)
mvbw2 = core.mv.Analyse(super, isb=True, delta=2, overlap=4)
mvbw = core.mv.Analyse(super, isb=True, delta=1, overlap=4)
mvfw = core.mv.Analyse(super, isb=False, delta=1, overlap=4)
mvfw2 = core.mv.Analyse(super, isb=False, delta=2, overlap=4)
mvfw3 = core.mv.Analyse(super, isb=False, delta=3, overlap=4)
v = core.mv.Degrain3(clip=src, super=super, mvbw=mvbw, mvfw=mvfw, mvbw2=mvbw2, mvfw2=mvfw2, mvbw3=mvbw3, mvfw3=mvfw3) 
v.set_output()
AviSynth script:
Code:
LWLibavVideoSource("720x480 YUV420P8 mpeg2.mkv")
super = MSuper(last)
mvbw3 = MAnalyse(super, isb=True, delta=3, overlap=4)
mvbw2 = MAnalyse(super, isb=True, delta=2, overlap=4)
mvbw = MAnalyse(super, isb=True, delta=1, overlap=4)
mvfw = MAnalyse(super, isb=False, delta=1, overlap=4)
mvfw2 = MAnalyse(super, isb=False, delta=2, overlap=4)
mvfw3 = MAnalyse(super, isb=False, delta=3, overlap=4)
MDeGrain3(last, super, mvbw, mvfw, mvbw2, mvfw2, mvbw3, mvfw3)
This was done more for fun, but with this test using v8 of MVTools and replacing only the 4x4 and 8x8 Sad_C with NEON intrinsics, I was able to get around 10.5 fps from a 720x480 raw source on an iPad Air 2 with 3 threads. Nothing blazing, but not bad for being on a tablet.

Last edited by captainadamo; 23rd May 2015 at 00:17. Reason: Updating reflecting that this was a using a raw source not compressed which obviously would have added some amount of slowdow
  Reply With Quote
Old 23rd May 2015, 08:02   #150  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by captainadamo View Post
This was done more for fun, but with this test using v8 of MVTools and replacing only the 4x4 and 8x8 Sad_C with NEON intrinsics, I was able to get around 10.5 fps from a 720x480 raw source on an iPad Air 2 with 3 threads. Nothing blazing, but not bad for being on a tablet.
So 10.5 fps after. How was it before?
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 23rd May 2015, 16:25   #151  |  Link
captainadamo
Guest
 
Posts: n/a
Around 6.5fps. The NEON for the 4x4 SAD only improved things consistently up to about 6.8 fps. The big gain was the 8x8 SAD in NEON which gave it the bump to 10.5 fps.

Just to note this was only when optimizing based off of profiling that single test script. And even with the NEON, those two SAD functions still basically swamp everything else in the performance counters so I don't know how much more I can squeeze out.

Last edited by captainadamo; 23rd May 2015 at 16:46.
  Reply With Quote
Old 24th May 2015, 10:37   #152  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
mv.compensate seems like, well.. busted
Code:
import vapoursynth as vs
core = vs.get_core()
clp = core.raws.Source("Y.rgb", 736, 960, src_fmt="Y8")
clp = core.fmtc.stack16tonative(clp)
super = core.mv.Super (clp)
bv = core.mv.Analyse (super, isb=True,delta=1)
bcmp = core.mv.Compensate (clp, super, bv, thsad=400, thscd1=248, thscd2=130)
bcmp.set_output ()
bv.set_output () works okay
bcmp.set_output () = instant crash
feisty2 is offline   Reply With Quote
Old 24th May 2015, 15:33   #153  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by feisty2 View Post
mv.compensate seems like, well.. busted
Code:
import vapoursynth as vs
core = vs.get_core()
clp = core.raws.Source("Y.rgb", 736, 960, src_fmt="Y8")
clp = core.fmtc.stack16tonative(clp)
super = core.mv.Super (clp)
bv = core.mv.Analyse (super, isb=True,delta=1)
bcmp = core.mv.Compensate (clp, super, bv, thsad=400, thscd1=248, thscd2=130)
bcmp.set_output ()
bv.set_output () works okay
bcmp.set_output () = instant crash
Fixed. Thanks for the report.

Here is v9.
Code:
   * Fix crash in Compensate with Gray input
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 24th May 2015, 17:02   #154  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
any way to encode the vector clip to an actual vid and load it later, like whenever I need it?
tried to encode it directly and vspipe moaned about "cannot output clips with varying dimensions"
I need vectors encoded so I can do motion estimation just once and use it to motion compensate several times

Last edited by feisty2; 24th May 2015 at 17:07.
feisty2 is offline   Reply With Quote
Old 24th May 2015, 22:37   #155  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
Quote:
Originally Posted by feisty2 View Post
any way to encode the vector clip to an actual vid and load it later, like whenever I need it?
tried to encode it directly and vspipe moaned about "cannot output clips with varying dimensions"
I need vectors encoded so I can do motion estimation just once and use it to motion compensate several times
I'm also interested in this, and thus got interested as you asked.

Save the image data using imwri is impossible, the plugin create image as you visualize them, and due to impossibility to use vspipe to request all frames this is a manual process, also save 100 frames in png require about 30MB.

The ye olde mvtools for avs had an interesting outfile parameters, but seems lacking an infile parameter, thus making it useless, also it was removed.

Then i took a look at the code and tried to see how the analyse function saved the image.
It did so creating a frame 1xnVector and then writing/reading directly into it.
Replacing this frame for a simple array and then writing this array to a file in a binary format [and maybe applying some compression if needed].

If you don't want to modify mvtools code [for reason i can understand], creating an extra plugin [i dunno if it can be done also as a script] that read the image and binarize that into a file and vice versa, it should be a trivial task i think.

if you are not capable [iirc you said that you are not so good with c] and jackoneill don't want to make this i can spare some time.

EDIT1: I should go to splice cause almost 1AM but i got really interested in this problem.
I sketched something in my head and i think i only need how to access sequentially all the frames of a video without requesting it directly [so not something like imwri, but like lsmash] and maybe have also a progress bar of some sort [you know, you don't want to stare at a spinning circle for hours or more]
Probably something like getFrameAsync() that call a writing function with fmSerial threading mode.

EDIT1.1: Reading vspipe source i thought about modifying it to create a new output mode that do exactly that, and then create a plugin to read that binary file and recreate the vec data and i also have some idea on how to make this.
Now sleep!

Last edited by MonoS; 24th May 2015 at 23:41.
MonoS is offline   Reply With Quote
Old 25th May 2015, 06:30   #156  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
awesome! well, I failed to figure out a way to do it by scripting and, I suck at C/C++, so counting on u to save the world bro!
feisty2 is offline   Reply With Quote
Old 25th May 2015, 08:14   #157  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
You can do this in Python:

Code:
import vapoursynth as vs

c = vs.get_core()

src = c.ffms2.Source("asdf.mp4")

superclip = c.mv.Super(src)
analysis = c.mv.Analyse(superclip, delta=1, isb=True)

f = open("/tmp/vectors.bin", "wb")

for i in range(analysis.num_frames):
    if (i+1) % 100 == 0:
        print(i+1, "/", analysis.num_frames)

    frame = analysis.get_frame(i)

    view = frame.get_read_array(0)

    for y in range(len(view)):
        # there is only one row (this loop runs once)
        f.write(view[y])

f.close()
It's about 82 KiB/frame.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 25th May 2015, 08:43   #158  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
and for reading?? if all the frames have different width there should be a frameLen in the file, also i don't see any function for creating varying dimension clip for then writing to it
MonoS is offline   Reply With Quote
Old 25th May 2015, 09:35   #159  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by MonoS View Post
and for reading?? if all the frames have different width there should be a frameLen in the file, also i don't see any function for creating varying dimension clip for then writing to it
I don't think the width varies in a clip. The output of Analyse has unknown dimensions simply because they are not known until a frame is returned, not because they could change from one frame to the next. Anyway, I'll leave all that as exercises for the reader.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 25th May 2015, 10:20   #160  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
Then it should be a trivial task to do via scripting.
i'll try to.implemebt as soon as i return home.

@feisty2: i return home at about 15 utc, if you expect to write it yourself let me know so we don't write it twice
MonoS 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 15:03.


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