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 29th December 2019, 13:53   #3741  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,064
Quote:
Originally Posted by Selur View Post
Nice, hoping to view the wave front of an input file to find the audio delay of some files.
Thanks!

Cu Selur
Only trim, splice and raw pcm output from vspipe is planned for the first test version. There's however one little problem...

All existing audio sources suck so I'll probably have to improve FFMS2 first.

Feel free to start implementing audio plugins using the doodle1 branch. The API is conceptually stable (but tweaks will definitely be made).
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 29th December 2019, 14:37   #3742  |  Link
Jukus
Registered User
 
Join Date: Jul 2019
Location: Russia
Posts: 27
@Myrsloik
What about variable fps?
Jukus is offline   Reply With Quote
Old 29th December 2019, 15:04   #3743  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,064
Quote:
Originally Posted by Jukus View Post
@Myrsloik
What about variable fps?
What about you asking a complete question?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 30th December 2019, 05:19   #3744  |  Link
Jukus
Registered User
 
Join Date: Jul 2019
Location: Russia
Posts: 27
Quote:
Originally Posted by Myrsloik View Post
What about you asking a complete question?
VS does not support variable FPS for output, will it be implemented?

Last edited by Jukus; 30th December 2019 at 05:30.
Jukus is offline   Reply With Quote
Old 30th December 2019, 08:22   #3745  |  Link
Lypheo
Registered User
 
Join Date: Sep 2018
Posts: 9
Quote:
Originally Posted by Jukus View Post
VS does not support variable FPS for output, will it be implemented?
It does, though? Just have vspipe write the timestamp file with --timecodes and mux it in (or pass it to x264 or whatever).

Quote:
Only trim, splice and raw pcm output from vspipe is planned for the first test version. There's however one little problem...

All existing audio sources suck so I'll probably have to improve FFMS2 first.

Feel free to start implementing audio plugins using the doodle1 branch. The API is conceptually stable (but tweaks will definitely be made).
Can we expect a test build soon or not until you’re done fixing ffms2?
Lypheo is offline   Reply With Quote
Old 30th December 2019, 09:50   #3746  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,064
Quote:
Originally Posted by Lypheo View Post
It does, though? Just have vspipe write the timestamp file with --timecodes and mux it in (or pass it to x264 or whatever).



Can we expect a test build soon or not until you’re done fixing ffms2?
There needs to be at least one decent source filter for audio or there won't be much to test really...
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 1st January 2020, 01:30   #3747  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 233
I can't figure this out on Windows 10.

1. I installed Python using Anaconda (e:\anaconda3)
2. Installed Vapoursynth (all users) (e:\vapoursynth)

python myscript.vpy works fine!
Code:
import vapoursynth as vs
from vapoursynth import core

print(core.version())
clip = core.std.BlankClip(format=vs.RGB24, color=[0, 0, 0])
clip.set_output()
vspipe and vsedit don't work.

vspipe --info myscript.vpy -

Setting PythonPath in registry to "e:\anaconda3" gives:

Failed to initialize VapourSynth environment

Setting PythonPath to "" gives:

Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00008fdc (most recent call first):


Registry entries:
Code:
Key Name:          HKEY_LOCAL_MACHINE\SOFTWARE\VapourSynth
Class Name:        <NO CLASS>
Last Write Time:   12/31/2019 - 4:26 PM
Value 0
  Name:            Version
  Type:            REG_SZ
  Data:            48

Value 1
  Name:            Path
  Type:            REG_SZ
  Data:            e:\vapoursynth

Value 2
  Name:            CorePlugins
  Type:            REG_SZ
  Data:            e:\vapoursynth\core\plugins

Value 3
  Name:            Plugins
  Type:            REG_SZ
  Data:            e:\vapoursynth\plugins

Value 4
  Name:            VapourSynthDLL
  Type:            REG_SZ
  Data:            e:\vapoursynth\core\vapoursynth.dll

Value 5
  Name:            VSScriptDLL
  Type:            REG_SZ
  Data:            e:\vapoursynth\core\vsscript.dll

Value 6
  Name:            VSPipeEXE
  Type:            REG_SZ
  Data:            e:\vapoursynth\core\vspipe.exe

Value 7
  Name:            VSRepoPY
  Type:            REG_SZ
  Data:            e:\vapoursynth\vsrepo\vsrepo.py

Value 8
  Name:            PythonPath
  Type:            REG_SZ
  Data:            e:\anaconda3
Created a batch file clearing all environment variables except for path, systemdrive and systemroot.
No change, same problem.

Last edited by Cary Knoop; 1st January 2020 at 01:33.
Cary Knoop is offline   Reply With Quote
Old 5th January 2020, 19:54   #3748  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,146
I wrote some syntactic sugar stuff for the C++ API here: https://github.com/IFeelBloated/vapo...ster/sugar.hpp
C++2a support is required (I'm 100% sure C++17 aint cuttin' it), it compiles with "-std=c++2a" for GCC10

you can use
Code:
auto MakePlane(auto Pointer, auto Width, auto Height, auto PaddingPolicy)
to access the plane in a 2-dimensional style, out-of-bound access (automatic padding) is allowed for the source plane, but not allowed for the destination plane.

I'll give you a concrete example, to write a 3x3 box blur, you would do the following:
Code:
auto srcp = reinterpret_cast<const float *>(srcp8);
auto dstp = reinterpret_cast<float *>(dstp8);

auto padded_src = reinterpret_cast<float *>(malloc((width+2) * (height+2) * sizeof(float)));
for (auto y : Range{ height })
     std::memcpy(padded_src + (y+1) * (width+2) + 1, srcp + y * width, width * sizeof(float));

// lots of code here to deal with padding for "padded_src"

auto gc_addr = padded_src;
padded_src += (width + 2) + 1;

for (auto y : Range{ height })
     for (auto x : Range{ width }) {
             auto above = padded_src - (width + 2);
             auto below = padded_src + (width + 2);
             dstp[x] = (above[x-1] + above[x] + above[x+1] + padded_src[x-1] + padded_src[x] + padded_src[x+1] + below[x-1] + below[x] + below[x+1]) / 9;
             dstp += width;
             padded_src += width + 2;
     }

free(gc_addr);
with "sugar.hpp", that huge pile of nuisance is equivalent to simply
Code:
auto srcp = MakePlane<const float>(srcp8, width, height, Repeat);
auto dstp = MakePlane<float>(dstp8, width, height, Zero);

for (auto y : Range{ height })
     for (auto x : Range{ width })
             dstp[y][x] = (srcp[y-1][x-1] + srcp[y-1][x] + srcp[y-1][x+1] + srcp[y][x-1] + srcp[y][x] + srcp[y][x+1] + srcp[y+1][x-1] + srcp[y+1][x] + srcp[y+1][x+1]) / 9;
             // possible out-of-bound access like "srcp[y-1][x-1]" is automatically handled here with the given padding policy, you got nothing to worry about
The header includes 3 pre-defined padding policies
Code:
Zero
Repeat (or simply called "pad" on this forum)
Reflect
however, you can also define your own padding policy by completing the following function and pass it to "MakePlane()"
Code:
auto PaddingFunction = [](auto Canvas, auto Width, auto Height, auto y, auto x) {
      ...
};
note that the "PaddingPolicy" argument has no effect on "dstp" as no padding is applied here.

you are welcome to leave a comment if you have any suggestions or ideas to further improve this.
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated

Last edited by feisty2; 6th January 2020 at 11:45.
feisty2 is offline   Reply With Quote
Old 5th January 2020, 20:05   #3749  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,146
simple live demonstration: https://godbolt.org/z/MHebt8
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   Reply With Quote
Old 8th January 2020, 15:50   #3750  |  Link
Jukus
Registered User
 
Join Date: Jul 2019
Location: Russia
Posts: 27
How to properly process the video where 3 progressive frames, 2 interlaced and it turns out that every 5 frame is a duplicate?
Jukus is offline   Reply With Quote
Old 8th January 2020, 18:50   #3751  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,662
Quote:
Originally Posted by Jukus View Post
How to properly process the video where 3 progressive frames, 2 interlaced and it turns out that every 5 frame is a duplicate?
Standard IVTC? VFM to match fields followed by VDecimate to drop the dupes.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 11th January 2020, 17:18   #3752  |  Link
PlazzTT
Registered User
 
PlazzTT's Avatar
 
Join Date: Jan 2002
Location: -
Posts: 115
I'm getting this error when compiling Vapoursynth on Linux (Mint 19.3)

I installed cython through pip.

"which cython" gives "/home/me/.local/bin/cython"

Quote:
...
CXXLD libremovegrain.la
CC src/filters/vinverse/libvinverse_la-vinverse.lo
CCLD libvinverse.la
CC src/filters/vivtc/libvivtc_la-vivtc.lo
CCLD libvivtc.la
CYTHON src/cython/vapoursynth.c
/bin/bash: cython: command not found
Makefile:2217: recipe for target 'src/cython/vapoursynth.c' failed
make: *** [src/cython/vapoursynth.c] Error 127
Any ideas how to fix this?

Last edited by PlazzTT; 11th January 2020 at 17:24.
PlazzTT is offline   Reply With Quote
Old 11th January 2020, 20:53   #3753  |  Link
Jukus
Registered User
 
Join Date: Jul 2019
Location: Russia
Posts: 27
By the way, to the page:
http://www.vapoursynth.com/doc/insta...-from-packages
May be added that there is a ready-made solution for Debian:
https://www.deb-multimedia.org/

And, apparently, remove the link to packages for Ubuntu.

Last edited by Jukus; 11th January 2020 at 20:58.
Jukus is offline   Reply With Quote
Old 12th January 2020, 20:50   #3754  |  Link
outhud
Registered User
 
Join Date: Aug 2018
Posts: 5
Where should Vapoursynth plugins (.so) be placed by default on Linux (Ubuntu) so that they are auto-loaded?

Is there a way to print the autoload folder?

I've tried /usr/local/lib/ and /usr/lib/x86_64-linux-gnu/vapoursynth/ but it seems the modules are not being found.
outhud is offline   Reply With Quote
Old 12th January 2020, 20:56   #3755  |  Link
Richard1485
Registered User
 
Join Date: Feb 2010
Posts: 248
Quote:
Originally Posted by PlazzTT View Post
I installed cython through pip.
Did you install it with pip3?

Code:
pip3 install cython
Richard1485 is offline   Reply With Quote
Old 12th January 2020, 21:02   #3756  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 293
Quote:
Originally Posted by outhud View Post
Where should Vapoursynth plugins (.so) be placed by default on Linux (Ubuntu) so that they are auto-loaded?

Is there a way to print the autoload folder?

I've tried /usr/local/lib/ and /usr/lib/x86_64-linux-gnu/vapoursynth/ but it seems the modules are not being found.
http://www.vapoursynth.com/doc/autoloading.html

Most probably in /usr/local/lib/vapoursynth in your case.
Are_ is offline   Reply With Quote
Old 14th January 2020, 14:46   #3757  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,064
Quote:
Originally Posted by Myrsloik View Post
Only trim, splice and raw pcm output from vspipe is planned for the first test version. There's however one little problem...

All existing audio sources suck so I'll probably have to improve FFMS2 first.

Feel free to start implementing audio plugins using the doodle1 branch. The API is conceptually stable (but tweaks will definitely be made).
Audio update:
A a best but slow audio source has been created so that's no longer a major problem (will still get some usefulness improvements over time).

Testing and debugging everything else is however taking longer than expected but audio will be fully supported by AVFS and VFW as well from the start and vspipe will be able to output wave64 headers.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 14th January 2020, 17:07   #3758  |  Link
Richard1485
Registered User
 
Join Date: Feb 2010
Posts: 248
^ Excellent news! Down the line, I hope that it might be possible to have an equivalent to AviSynth's Dissolve(), which affects video and audio.
Richard1485 is offline   Reply With Quote
Old 18th January 2020, 12:43   #3759  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: 36 Chambers
Posts: 5,918
I'm not sure what's the focus of this thread because my question is about vs host application development.

There is a weird exception happening here:

Code:
    case WM_DESTROY:
        DiscardGraphicsResources();
        SafeRelease(&g_D2D_Factory);

        g_vsapi->freeNode(g_vsnode);
        vsscript_freeScript(g_vsscript);
        vsscript_finalize();

        PostQuitMessage(0);
        return 0;
Exception thrown at 0x00007FFAFC5B448D (vapoursynth.cp37-win_amd64.pyd) in VapourSynth Direct2D Rendering.exe: 0xC0000005: Access violation writing location 0x0000000000000000.

Weird thing is it crashes only inside WM_DESTROY and not when this code is executed before WM_DESTROY !

How can this issue be debugged?

Last edited by stax76; 18th January 2020 at 12:46.
stax76 is offline   Reply With Quote
Old 18th January 2020, 12:54   #3760  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,064
Quote:
Originally Posted by stax76 View Post
I'm not sure what's the focus of this thread because my question is about vs host application development.

There is a weird exception happening here:

Code:
    case WM_DESTROY:
        DiscardGraphicsResources();
        SafeRelease(&g_D2D_Factory);

        g_vsapi->freeNode(g_vsnode);
        vsscript_freeScript(g_vsscript);
        vsscript_finalize();

        PostQuitMessage(0);
        return 0;
Exception thrown at 0x00007FFAFC5B448D (vapoursynth.cp37-win_amd64.pyd) in VapourSynth Direct2D Rendering.exe: 0xC0000005: Access violation writing location 0x0000000000000000.

Weird thing is it crashes only inside WM_DESTROY and not when this code is executed before WM_DESTROY !

How can this issue be debugged?
It's with a trivial script (BlankClip only)?

Are there any restrictions on what you're allowed to do when handling a WM_DESTROY message? If not then I'd simply see what the call stack is in a debugger. Maybe there's a hint in there.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Reply

Tags
speed, vaporware, vapoursynth

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 08:54.


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