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 9th April 2018, 15:49   #21  |  Link
Chthon
Registered User
 
Join Date: Dec 2012
Posts: 6
Quote:
Originally Posted by Myrsloik View Post
I updated my old and broken dropbox link. Not sure if I really want to fork the project since I'd have basically no time to maintain it anyway. Would be a shame if the changes were lost tough...
I don't suppose you could figure out what to do with that for loop in Factorize.cpp? I'm having a lot of trouble following the code's intent well enough to be sure about that close bracket's placement.
Chthon is offline   Reply With Quote
Old 10th April 2018, 05:50   #22  |  Link
foxyshadis
Angel of Night
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
Quote:
Originally Posted by Chthon View Post
2. It looks like there's another bug. The for loop at the bottom of Factorize.cpp is missing its {}s. I *think* the closing brace should go on line 52 (???).
No bug there, implicit braces around the following block, the if.

The bigger problem is that with oddball resolutions it'll turn into an infinite loop, and zero bounds checking means you can get memory corruption if you have an overly factorizable resolution -- though even 8k resolutions would probably be safe.
foxyshadis is offline   Reply With Quote
Old 27th November 2019, 01:29   #23  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
Quote:
Originally Posted by Chthon View Post
Thank you Are_ .

Edit: A few notes for anyone else trying to compile:

1. Looking at the newer source on the official page, it looks likes vc's fix for the issue pointed out in post #9 is to comment out both lines. This seems fine, since the variable is unused anyway.

2. It looks like there's another bug. The for loop at the bottom of Factorize.cpp is missing its {}s. I *think* the closing brace should go on line 52 (???).

3. libfftw3f_threads is a dependency (at least for the fixed version). If you don't link it at compile time, core.vcfreq.Sharp() will crash with an undefined symbol error for fftwf_init_threads.

4. I was able to compile with
Code:
g++ -Wall -shared -fPIC -I. -L/usr/local/lib/vsplugins/lib -lfftw3f_threads -o libvcfreq.so vcfreq.cpp
after copying the vapoursynth headers into the working directory.
(My libfftw3f_threads.so is in usr/local/lib/vsplugins/lib; adjust accordingly.)
i'm trying to do this today as i have a client's footage with LED lighting that has caused wiblly-wobbly phasey-wasey effects with the camera's rolling shutter.

no matter how i poke that g++ line, i'm still getting crash with "undefined symbol: fftwf_init_threads".

running python 3.6, ubuntu 18.04
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 27th November 2019, 01:53   #24  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
With this line too?:
Code:
g++ -Wall -shared -fPIC -I. $(pkg-config --cflags vapoursynth) $(pkg-config --libs fftw3f_threads) -o libvcfreq.so vcfreq.cpp
And you have fftw correctly installed? v3.x.x one?
Are_ is offline   Reply With Quote
Old 28th November 2019, 03:00   #25  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
i have fftw3f installed (pkg-config shows ver 3.3.7), but that line fails saying fftw3f_threads is not around. is this a custom package?

[edit]
also i wasn't aware of vapoursynth having pkg-config abilities. i've just been copying the files... i'm not a developer, just a tinkerer unfortunately
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 28th November 2019, 04:25   #26  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
I don't know much about Ubuntu, but make sure you have libfftw3-dev installed, if that still doesn't work try this line instead:

Code:
g++ -Wall -shared -fPIC -I. $(pkg-config --cflags vapoursynth) -lfftw3f_threads -lfftw3f -o libvcfreq.so vcfreq.cpp
Are_ is offline   Reply With Quote
Old 28th November 2019, 10:00   #27  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
thanks, but so far still no fun:
Code:
vsedit: symbol lookup error: /usr/lib/x86_64-linux-gnu/vapoursynth/libvcfreq.so: undefined symbol: fftwf_init_threads
and output of ldd:
Code:
$ ldd libvcfreq.so 
	linux-vdso.so.1 (0x00007ffd582ad000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f21a6676000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f21a62d8000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f21a5ee7000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f21a6c16000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f21a5ccf000)
[edit]

it seems like maybe libfftw3f_threads is a separate package that ubuntu doesn't include in it's repos. i've googled a bit but my google game must be off because i haven't found anything relevant

[edit]
ok i have all the libfftw files with the _threads variants. what's the dealio? should a properly functioning libvcfreq.so show a link to fftw in the ldd results?
__________________
sucking the life out of your videos since 2004

Last edited by Mug Funky; 28th November 2019 at 10:34.
Mug Funky is offline   Reply With Quote
Old 28th November 2019, 15:20   #28  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
The library is supposed to be installed by libfftw3-dev, but the package seems to be missing the pkg-conf part, thats why I suggested you to not use it.

It should show with ldd:
Code:
$ ldd /usr/lib64/vapoursynth/libvcfreq.so
        linux-vdso.so.1 (0x00007ffe1373e000)
        libfftw3f_threads.so.3 => /usr/lib64/libfftw3f_threads.so.3 (0x00007fc3564ed000)
        libfftw3f.so.3 => /usr/lib64/libfftw3f.so.3 (0x00007fc3561e4000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fc356012000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fc355ed4000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc355eb1000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fc356560000)
Maybe try this, if this doesn't work I think I will be out of ideas
Code:
g++ -Wall -shared -fPIC -I. $(pkg-config --cflags vapoursynth) -L/usr/lib/x86_64-linux-gnu -lfftw3f_threads -lfftw3f -o libvcfreq.so vcfreq.cpp

Last edited by Are_; 28th November 2019 at 15:22.
Are_ is offline   Reply With Quote
Old 28th November 2019, 18:21   #29  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
i'm now wondering whether libpthread isn't the problem, but that's just weird as most apps are multithreaded and i regularly build ffmpeg and darktable from git without them spitting chips at me (and they use all cores).

the only pthreaddy package ubuntu seems to use is libpthread-stubs because apparently linux just sort of supports all the pthread functions as standard in glibc?

i hate dependency hell.

i'm tempted to just ask for your libvcfreq.so and just see if it runs here...
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 28th November 2019, 22:42   #30  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
this line has got ldd showing pthreads, but still no sign of fftw3f_threads:
Code:
g++ -shared -fPIC -I. $(pkg-config --cflags gthread-2.0) -I/usr/include -o libvcfreq.so vcfreq.cpp
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 28th November 2019, 22:58   #31  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
Here you have, vcfreq compiled with GCC 9.2.0 with "g++ -march=x86-64 -msse2 -O2 -Wall -shared -fPIC -I. $(pkg-config --cflags vapoursynth) $(pkg-config --libs fftw3f_threads) -o libvcfreq.so vcfreq.cpp" command line. Good luck.
Are_ is offline   Reply With Quote
Old 29th November 2019, 02:10   #32  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
sadly this did not work as is.

i'm trying to build fftw3 now to a safe prefix and linking to that, but still it's not cooperating.

when i set it to -static the errors are telling - all of them complain about fftw3
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 29th November 2019, 03:23   #33  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
I knew it was going to be something silly, try this out because I'm pretty sure it's going to work:
Code:
g++ -msse2 -O2 -Wall -shared -fPIC -I. $(pkg-config --cflags vapoursynth) -o libvcfreq.so vcfreq.cpp -lfftw3f_threads -lfftw3f
[EDIT]
And this vcfreq library should work on your system too.

Last edited by Are_; 29th November 2019 at 03:56.
Are_ is offline   Reply With Quote
Old 29th November 2019, 13:00   #34  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
ok that line worked and the plugin seems to be working too.

did i really just need to link both libfftw3f and libfftw3f_threads to make it work? what a wild ride that was.
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 29th November 2019, 13:14   #35  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
Not only that, they had to be in the correct place in de command line, it worked anywhere with my compiler but not in the one Ubuntu comes... nonsense.
Are_ is offline   Reply With Quote
Old 29th November 2019, 23:51   #36  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
this is why i like a good configure script and makefile...
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 12th May 2020, 10:12   #37  |  Link
stefanmathiasson
Registered User
 
Join Date: May 2020
Posts: 2
I managed to compile vcfreq with

gcc -c -fPIC ${CFLAGS} ${CPPFLAGS} -I. $(pkg-config --cflags vapoursynth) -o main.o vcfreq.cpp
g++ -dynamiclib -undefined suppress -flat_namespace *.o -o libvcfreq.dylib

and the files linked in post #18. vcfreq loads fine, but crashes VapourSynth immediately when I try to preview anything, no matter if I try to use F1Quiver, Sharp etc. It's similar to the problems described in post #5, but I think that Issue was fixed in the Dropbox files? Where any of you able to successfully run it on OSX or am I missing something here?

Any help appreciated!
stefanmathiasson is offline   Reply With Quote
Old 12th May 2020, 10:17   #38  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by stefanmathiasson View Post
I managed to compile vcfreq with

gcc -c -fPIC ${CFLAGS} ${CPPFLAGS} -I. $(pkg-config --cflags vapoursynth) -o main.o vcfreq.cpp
g++ -dynamiclib -undefined suppress -flat_namespace *.o -o libvcfreq.dylib

and the files linked in post #18. vcfreq loads fine, but crashes VapourSynth immediately when I try to preview anything, no matter if I try to use F1Quiver, Sharp etc. It's similar to the problems described in post #5, but I think that Issue was fixed in the Dropbox files? Where any of you able to successfully run it on OSX or am I missing something here?

Any help appreciated!
I'm afraid you're going to have to learn how to debug... the hard way.

I certainly never tested the code outside windows.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 12th May 2020, 14:16   #39  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
It works fine on Linux.

I think this is a miss-compilation issue. These are my flags for reference:

Code:
gcc -c -fPIC -shared -std=c++11 -O3 -march=native -pipe -Wl,-O1 -Wl,--as-needed -I. -I/usr/include/vapoursynth -o vcfreq.o vcfreq.cpp

gcc -shared -fPIC -lfftw3f_threads -lfftw3f -Wl,-O1 -Wl,--as-needed -O3 -march=native -pipe -o libvcfreq.so vcfreq.o
As a clear issue I see you didn't link with libfftw3f.
Are_ is offline   Reply With Quote
Old 12th May 2020, 14:48   #40  |  Link
stefanmathiasson
Registered User
 
Join Date: May 2020
Posts: 2
Quote:
Originally Posted by Myrsloik View Post
I'm afraid you're going to have to learn how to debug... the hard way.

I certainly never tested the code outside windows.
Thanks! Would love to be able to use vcfreq, so I'll give it a shot.
stefanmathiasson 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 20:13.


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