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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 26th June 2015, 08:49   #1601  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
eedi3 16bits: guess I'm getting there, now the upper half of the image is good and the lower half is gone... like blank and all black..
damn, never thought programming would be painful like this..
feisty2 is offline   Reply With Quote
Old 29th June 2015, 20:57   #1602  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
Myrsloik
I'm feeling very stupid to ask such a dumb question - but do you have a Windows build of mpv, compiled with VapourSynth support?
In other words - where can I find .lib/.dll files suitable for linking with gcc?
__________________
SVPflow motion interpolation
chainik_svp is offline   Reply With Quote
Old 30th June 2015, 04:58   #1603  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by chainik_svp View Post
In other words - where can I find .lib/.dll files suitable for linking with gcc?
They're in the installer. Nothing keeps you from compiling your program with GCC. I didn't need the .lib file, even.
Code:
x86_64-w64-mingw32-g++ -o app.exe app.o -L/path/to/vsscriptdll -lvsscript
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 30th June 2015, 09:54   #1604  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
Code:
C:/msys32/mingw32/lib/vapoursynth.lib: error adding symbols: File in wrong format
Code:
const VSAPI *vs = getVapourSynthAPI(VAPOURSYNTH_API_VERSION);
qDebug()<<"VS: "<<(vs!=0);
return 0;
Code:
g++ .... -L"C:\Program Files (x86)\VapourSynth\core32" -lvapoursynth

undefined reference to `_imp__getVapourSynthAPI@4'
What am I doing wrong?
__________________
SVPflow motion interpolation

Last edited by chainik_svp; 30th June 2015 at 12:31.
chainik_svp is offline   Reply With Quote
Old 30th June 2015, 21:18   #1605  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by chainik_svp View Post
Code:
C:/msys32/mingw32/lib/vapoursynth.lib: error adding symbols: File in wrong format
Code:
const VSAPI *vs = getVapourSynthAPI(VAPOURSYNTH_API_VERSION);
qDebug()<<"VS: "<<(vs!=0);
return 0;
Code:
g++ .... -L"C:\Program Files (x86)\VapourSynth\core32" -lvapoursynth

undefined reference to `_imp__getVapourSynthAPI@4'
What am I doing wrong?
Ugh. I'm revising my answer above: Nothing keeps you from compiling your program with GCC, if you're compiling a 64 bit program. If you're compiling a 32 bit program, apparently you need to create your own .lib files. (if someone knows why it's not the same for both, I would love to hear about it.)

For vsscript.dll this worked:
Code:
LIBRARY vsscript
EXPORTS
   vsscript_clearEnvironment@4
   vsscript_clearOutput@8
   vsscript_clearVariable@8
   vsscript_createScript@4
   vsscript_evaluateFile@12
   vsscript_evaluateScript@16
   vsscript_finalize@0
   vsscript_freeScript@4
   vsscript_getCore@4
   vsscript_getError@4
   vsscript_getOutput@8
   vsscript_getVSApi@0
   vsscript_getVariable@12
   vsscript_init@0
   vsscript_setVariable@8
Save as vsscript.def and run
Code:
dlltool -d vsscript.def -l vsscript.lib
Link the resulting vsscript.lib into your application. You don't need to point ld to vsscript.dll.

For vapoursynth.dll, this .def file should work:
Code:
LIBRARY vapoursynth
EXPORTS
   getVapourSynthAPI@4
This is annoying stuff. Have you considered creating only 64 bit applications?
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 30th June 2015, 22:23   #1606  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
jackoneill

Have you actually tried to execute compiled binary?
Yeah, it links w/o errors, but gives "procedure entry point "getVapourSynthAPI@4" couldn't be located" at runtime

depends.exe shows that .exe asks for "getVapourSynthAPI@4" while the library contains "_getVapourSynthAPI@4"

You may think that adding "_" to the .def file could help? no it that case linking fails again

===============

The correct answer is:
Code:
dlltool --add-stdcall-underscore -d vsscript.def -l vsscript.lib
Now it works!

I wonder why it isn't included into "SDK"?
__________________
SVPflow motion interpolation

Last edited by chainik_svp; 30th June 2015 at 22:38.
chainik_svp is offline   Reply With Quote
Old 1st July 2015, 06:57   #1607  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
I tried to run it in Wine, but VapourSynth isn't installed there, so it only got as far as reporting that Python34.dll was missing. I'm glad you got it to work.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 20th July 2015, 15:02   #1608  |  Link
Pat357
Registered User
 
Join Date: Jun 2006
Posts: 452
Quote:
Originally Posted by chainik_svp View Post
jackoneill

The correct answer is:
Code:
dlltool --add-stdcall-underscore -d vsscript.def -l vsscript.lib
Now it works!

I wonder why it isn't included into "SDK"?
Thank you ! I was looking for this too ;-)

Do you need to link in both the vapoursynth.lib and the vsscript.lib ?
Can you show me how you do this linking ?

Thanks again, man !
Pat357 is offline   Reply With Quote
Old 21st July 2015, 20:38   #1609  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by Pat357 View Post
Thank you ! I was looking for this too ;-)

Do you need to link in both the vapoursynth.lib and the vsscript.lib ?
Can you show me how you do this linking ?

Thanks again, man !
If you use VSScript, only vsscript.lib needs to be linked.

I think a command similar to this works:
Code:
g++ -o asdf.exe asdf.cpp -L. -lvsscript
Give -L the folder where vsscript.lib is.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 30th July 2015, 04:31   #1610  |  Link
Q3CPMA
Registered User
 
Q3CPMA's Avatar
 
Join Date: Jun 2015
Posts: 28
Hello,
I tried to search in the thread, but I didn't find anything related. How are we supposed to process variable framerate videos?
Q3CPMA is offline   Reply With Quote
Old 30th July 2015, 07:52   #1611  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by Q3CPMA View Post
Hello,
I tried to search in the thread, but I didn't find anything related. How are we supposed to process variable framerate videos?
That's a fairly vague question. Can you elaborate?
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 30th July 2015, 14:18   #1612  |  Link
Q3CPMA
Registered User
 
Q3CPMA's Avatar
 
Join Date: Jun 2015
Posts: 28
Quote:
Originally Posted by jackoneill View Post
That's a fairly vague question. Can you elaborate?
Well, when using ffsm2 to open clips with variable framerate, it gives me a constant framerate in the end (only in the metadata, since the doc says that there's the same number of frame), so, how would I do to get the same framerate in the output file?
Q3CPMA is offline   Reply With Quote
Old 30th July 2015, 14:24   #1613  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Raw video, Y4M etc. don't know about variable framerate. You have to save timecodes into external file using vspipe and load into encoder/muxer.

vspipe script.vpy - --y4m --timecodes timecodes.txt | x264 - --demuxer y4m --tcfile-in timecodes.txt -o output.mkv
(btw.: vspipe help is missing "--tcfile-in" part of x264)

I have not tested this:
1.) I don't know if ffms2 creates frame duration metadata
2.) I don't know if timecodes.txt is created immediately for use

At least in AviSynth ffms2 also has a parameter to create timecode file directly. I don't know if that parameter is available in the VapourSynth version. (And of course it would be useless in case you actually want to work with the frame duration metadata within VapourSynth)

Last edited by sneaker_ger; 30th July 2015 at 14:27.
sneaker_ger is offline   Reply With Quote
Old 30th July 2015, 15:20   #1614  |  Link
Q3CPMA
Registered User
 
Q3CPMA's Avatar
 
Join Date: Jun 2015
Posts: 28
Quote:
Originally Posted by sneaker_ger View Post
Raw video, Y4M etc. don't know about variable framerate. You have to save timecodes into external file using vspipe and load into encoder/muxer.

vspipe script.vpy - --y4m --timecodes timecodes.txt | x264 - --demuxer y4m --tcfile-in timecodes.txt -o output.mkv
(btw.: vspipe help is missing "--tcfile-in" part of x264)

I have not tested this:
1.) I don't know if ffms2 creates frame duration metadata
2.) I don't know if timecodes.txt is created immediately for use

At least in AviSynth ffms2 also has a parameter to create timecode file directly. I don't know if that parameter is available in the VapourSynth version. (And of course it would be useless in case you actually want to work with the frame duration metadata within VapourSynth)
Thanks, I'll try. It would be cool to have a wrapper that transfer all metadata automatically into a matrovska container.
Q3CPMA is offline   Reply With Quote
Old 30th July 2015, 16:20   #1615  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
1) ffms2 does attach the frame duration to each frame.
2) The timecodes file is only complete after vspipe writes all the frames.

If sneaker_ger's command doesn't work, you'll have to pass the timecodes file to the muxer after x264 is done.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 30th July 2015, 18:03   #1616  |  Link
Q3CPMA
Registered User
 
Q3CPMA's Avatar
 
Join Date: Jun 2015
Posts: 28
Quote:
Originally Posted by jackoneill View Post
1) ffms2 does attach the frame duration to each frame.
2) The timecodes file is only complete after vspipe writes all the frames.

If sneaker_ger's command doesn't work, you'll have to pass the timecodes file to the muxer after x264 is done.
It worked perfectly, except the fact that I couldn't use a pipe.

vspipe script.vpy --y4m --timecodes tc.dat out.y4m
x264 out.y4m --demuxer y4m --tcfile-in tc.dat -o out.mkv

did the trick.
Q3CPMA is offline   Reply With Quote
Old 30th July 2015, 18:19   #1617  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Yes, like jackoneill said timecode file is not ready at start of conversion (when x264 needs it), so my example does not work.

You could do like he suggested without having to save huge y4m file:
vspipe script.vpy --y4m --timecodes tc.dat - | x264 - --demuxer y4m -o es.264
mkvmerge -o out.mkv --timecodes "0:tc.dat" es.264
(but since x264 does not have timecodes it cannot do things like framerate aware CRF if you care about that)
sneaker_ger is offline   Reply With Quote
Old 30th July 2015, 19:07   #1618  |  Link
Q3CPMA
Registered User
 
Q3CPMA's Avatar
 
Join Date: Jun 2015
Posts: 28
Actually, this doesn't work well. I have two problems:
- The output video is offset by -0.217s
- I have random passages where I get garbled frame order and/or frame repetition. Original segment, garbled segment. (I hope it's okay with the rules; it's only a less than 2s segment ). I insist on the fact that this problem appears randomly.

I also tried with the mkvmerge method, still fucked.

Last edited by Q3CPMA; 30th July 2015 at 19:14.
Q3CPMA is offline   Reply With Quote
Old 30th July 2015, 19:22   #1619  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Can you test latest RC?
http://forum.doom9.org/showpost.php?...postcount=2088
sneaker_ger is offline   Reply With Quote
Old 30th July 2015, 19:45   #1620  |  Link
Q3CPMA
Registered User
 
Q3CPMA's Avatar
 
Join Date: Jun 2015
Posts: 28
Quote:
Originally Posted by sneaker_ger View Post
I can't since I'm not on Windows. Tried with the latest git, and the second problem is still here. Well, only the second one, at least.

Last edited by Q3CPMA; 30th July 2015 at 19:50. Reason: orthograph
Q3CPMA is offline   Reply With Quote
Reply

Tags
speed, vaporware, vapoursynth


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 00:37.


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