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 16th April 2016, 07:29   #2081  |  Link
BakaProxy
Registered User
 
Join Date: Jan 2015
Posts: 47
Just a thought I had recently but is it actually possible to use vpy within c++ without having to call python scripts snd whatnot. I'm talking about calling vpy functions and plugins from within the cpp project.

For example I have a cpp project that generates an image and I want to resize that image without fully making my own resize function, could I then call vpy's internal resize function to do the work or even call the nnedi3 plugin?

Last edited by BakaProxy; 16th April 2016 at 07:33.
BakaProxy is offline   Reply With Quote
Old 16th April 2016, 09:02   #2082  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,119
see
https://github.com/dubhater/vapoursy...141e8f874a1f87
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   Reply With Quote
Old 16th April 2016, 09:05   #2083  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 659
Quote:
Originally Posted by BakaProxy View Post
Just a thought I had recently but is it actually possible to use vpy within c++ without having to call python scripts snd whatnot. I'm talking about calling vpy functions and plugins from within the cpp project.

For example I have a cpp project that generates an image and I want to resize that image without fully making my own resize function, could I then call vpy's internal resize function to do the work or even call the nnedi3 plugin?
Yes, it's possible. You can build a filter graph in C/C++. Here is an example that happens to invoke the internal resizer: https://github.com/vapoursynth/vapou...svapour.c#L504 . For your particular case, you'll also need to implement a VapourSynth source filter in your application.

If it's only the internal resizer you want, you should use zimg directly. It has C and C++ APIs.
jackoneill is online now   Reply With Quote
Old 18th April 2016, 18:16   #2084  |  Link
sofakng
Registered User
 
Join Date: May 2007
Posts: 36
Has anybody been able to cross-compile VapourSynth using Linux?

I'm trying to use MXE (M Cross Environment; mingw32-w64 toolchain builder) and it compiles mpv without any problems, but VapourSynth requires Python 3.4 and I'm stumped on how to properly compile the VapourSynth DLL...
sofakng is offline   Reply With Quote
Old 18th April 2016, 20:00   #2085  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 659
Quote:
Originally Posted by sofakng View Post
Has anybody been able to cross-compile VapourSynth using Linux?

I'm trying to use MXE (M Cross Environment; mingw32-w64 toolchain builder) and it compiles mpv without any problems, but VapourSynth requires Python 3.4 and I'm stumped on how to properly compile the VapourSynth DLL...
It has been done. There are some hoops to jump through.

Note that cross-compiling a 32 bit libvapoursynth produces a broken DLL. I didn't investigate, but I think it has to do with function decorations somehow.

You could try to cross-compile Python, but I found it easier to use the official win64 installer in Wine (even if it took a few hours to find the magic switch that made msiexec work).

So, assuming you will use the official Python installer, the configure command will look something like this:
Code:
./configure --host=x86_64-w64-mingw32 --disable-python-module --disable-plugins PYTHON3_CFLAGS='/path/to/Python3.h' PYTHON3_LIBS='-L/path/to/libpython3.dll -lpython3'
--disable-python-module because Python modules have to be compiled with the same compiler as libpython, so you'll have to use the Python module provided in the official VapourSynth installer.

--disable-plugins because I assume you won't need those.

PYTHON3_CFLAGS needs to be passed to please the configure script. Point it to the Python installation's "include" folder.

PYTHON3_LIBS is also needed to please the configure script. Point it to the Python installation's "DLLs" folder. Inside, you will need to rename Python3.dll to libpython3.dll because otherwise libtool refuses to acknowledge its existence. This means you'll also need to rename Python3.dll on the Windows machine where this thing will run.

Most unfortunately, you will receive a libvapoursynth-script-0.dll instead of vsscript.dll.

Don't use GCC 5.3.0 for this because its libstdc++ has a bug that makes wstring_convert unusable. This is a problem for VapourSynth. GCC 5.1.0 is okay.

If it's for mpv, I think you'll find it much easier to convince mpv's build system to use the vsscript.dll provided in the official VapourSynth installer, or the portable archive.
jackoneill is online now   Reply With Quote
Old 18th April 2016, 20:55   #2086  |  Link
sofakng
Registered User
 
Join Date: May 2007
Posts: 36
Thanks a lot for the help. I ended up using dlltool to generate the lib files (for vapoursynth.dll and vsscript.dll) and I was able to get mpv compiled with vapoursynth supported. I still need to try it on my actual win32 machine so who knows if it will work but at least it compiled
sofakng is offline   Reply With Quote
Old 19th April 2016, 02:22   #2087  |  Link
sofakng
Registered User
 
Join Date: May 2007
Posts: 36
Sorry, but one more question.

Is there an installer for the 64-bit version of VapourSynth? It looks like VapourSynth-R32.exe only installs the 32-bit version.
sofakng is offline   Reply With Quote
Old 19th April 2016, 04:38   #2088  |  Link
HolyWu
Registered User
 
HolyWu's Avatar
 
Join Date: Aug 2006
Location: Taiwan
Posts: 481
Quote:
Originally Posted by sofakng View Post
Sorry, but one more question.

Is there an installer for the 64-bit version of VapourSynth? It looks like VapourSynth-R32.exe only installs the 32-bit version.
The installer contains both 32-bit version and 64-bit version in it. You need to have both 32-bit Python and 64-bit Python installed separately.
HolyWu is offline   Reply With Quote
Old 29th April 2016, 07:11   #2089  |  Link
speedyrazor
Registered User
 
Join Date: Mar 2003
Posts: 194
Hi, I am getting "VSPipe.exe has stopped working" when trying to process Quicktime Prores 4444 files. Here is the script:

Code:
import vapoursynth as vs
core = vs.get_core(threads=4)
ret = core.lsmas.LibavSMASHSource(source=r"Prores_4444_HD_Test.mov")
ret = core.fmtc.resample (clip=ret, w=480, h=384, css="444", kernel="spline36")
ret = core.fmtc.matrix (clip=ret, mats="709", matd="601")
ret = core.fmtc.resample (clip=ret, css="420")
ret = core.fmtc.bitdepth (clip=ret, bits=10)
retFinal = ret
retFinal.set_output()
I am on the latest version of Vapoursynth (R32) and the latest version of LSMASHSource (r877). Here is the crash report:

Code:
Problem signature:
  Problem Event Name:	APPCRASH
  Application Name:	VSPipe.exe
  Application Version:	0.0.0.0
  Application Timestamp:	5707beaa
  Fault Module Name:	vslsmashsource.dll
  Fault Module Version:	0.0.0.0
  Fault Module Timestamp:	00000000
  Exception Code:	c0000005
  Exception Offset:	0000000000001c80
  OS Version:	6.2.9200.2.0.0.272.7
  Locale ID:	2057
  Additional Information 1:	a279
  Additional Information 2:	a279be6c627875dc7e1b7d38560dd807
  Additional Information 3:	750b
  Additional Information 4:	750b3a6db190a3b8cb8b4f7bce54513d
Am I doing something wrong, or is this a bug?

Kind regards.
speedyrazor is offline   Reply With Quote
Old 29th April 2016, 13:55   #2090  |  Link
stax76
staxrip & mpv.net
 
Join Date: Jun 2002
Posts: 5,247
I've downloaded a YUV444P10 sample and got an VS error telling YUV444P10 is not supported by VFW module, could it be supported? I get this error not only with StaxRip and VirtualDub but also with MPC-BE which I thought does not use VFW.

Sample is from here:

https://www.arri.com/camera/amira/le...ample_footage/

Code:
Count                     : 334
Count of stream of this kind: 1
Kind of stream            : Video
Kind of stream            : Video
Stream identifier         : 0
StreamOrder               : 0
ID                        : 1
ID                        : 1
Format                    : ProRes
Commercial name           : ProRes
Format version            : Version 1
Format profile            : 4444
Codec ID                  : ap4h
Codec ID/Url              : http://www.apple.com/quicktime/download/standalone.html
Codec                     : ap4h
Codec                     : ap4h
Codec/CC                  : ap4h
Duration                  : 10240
Duration                  : 10s 240ms
Duration                  : 10s 240ms
Duration                  : 10s 240ms
Duration                  : 00:00:10.240
Duration                  : 00:00:10:06
Duration                  : 00:00:10.240 (00:00:10:06)
Bit rate mode             : VBR
Bit rate mode             : Variable
Bit rate                  : 286246400
Bit rate                  : 286 Mbps
Width                     : 1920
Width                     : 1 920 pixels
Clean aperture width      : 1920
Clean aperture width      : 1 920 pixels
Height                    : 1080
Height                    : 1 080 pixels
Clean aperture height     : 1080
Clean aperture height     : 1 080 pixels
Pixel aspect ratio        : 1.000
Clean aperture pixel aspect ratio: 1.000
Display aspect ratio      : 1.778
Display aspect ratio      : 16:9
Clean aperture display aspect ratio: 1.778
Clean aperture display aspect ratio: 16:9
Rotation                  : 0.000
Frame rate mode           : CFR
Frame rate mode           : Constant
Frame rate                : 25.000
Frame rate                : 25.000 fps
Frame count               : 256
Chroma subsampling        : 4:4:4
Chroma subsampling        : 4:4:4
Scan type                 : Progressive
Scan type                 : Progressive
Bits/(Pixel*Frame)        : 5.522
Delay                     : 10280
Delay                     : 10s 280ms
Delay                     : 10s 280ms
Delay                     : 10s 280ms
Delay                     : 00:00:10.280
Delay_Settings            : DropFrame=No / 24HourMax=Yes / IsVisual=No
Delay_DropFrame           : No
Delay, origin             : Container
Delay, origin             : Container
Stream size               : 366395392
Stream size               : 349 MiB (97%)
Stream size               : 349 MiB
Stream size               : 349 MiB
Stream size               : 349 MiB
Stream size               : 349.4 MiB
Stream size               : 349 MiB (97%)
Proportion of this stream : 0.96949
Writing library           : Arnold & Richter Cine Technik
Writing library           : Arnold & Richter Cine Technik
Language                  : en
Language                  : English
Language                  : English
Language                  : en
Language                  : eng
Language                  : en
Encoded date              : UTC 2014-07-02 09:44:35
Tagged date               : UTC 2014-07-02 09:44:45
colour_description_present: Yes
Color primaries           : BT.709
Transfer characteristics  : BT.709
Matrix coefficients       : BT.709
colour_description_present_Original: Yes
matrix_coefficients_Original: RGB
__________________
staxrip is in need of a new maintainer since I would like to retire.
stax76 is offline   Reply With Quote
Old 29th April 2016, 14:03   #2091  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,770
The problem is that there is no fourcc to represent it that I know of. The closest are ms p010 or whatever it was called and v210 which are both 10bit but subsampled. Find me a fourcc that's actually supported in applications and I'll consider adding it.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 29th April 2016, 14:17   #2092  |  Link
stax76
staxrip & mpv.net
 
Join Date: Jun 2002
Posts: 5,247
Who might help here, maybe the author of MediaInfo or VirtualDub?
__________________
staxrip is in need of a new maintainer since I would like to retire.
stax76 is offline   Reply With Quote
Old 29th April 2016, 14:21   #2093  |  Link
stax76
staxrip & mpv.net
 
Join Date: Jun 2002
Posts: 5,247
found something:

http://wiki.multimedia.cx/index.php?title=Apple_ProRes
__________________
staxrip is in need of a new maintainer since I would like to retire.
stax76 is offline   Reply With Quote
Old 29th April 2016, 14:35   #2094  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,770
Quote:
Originally Posted by stax76 View Post
No, must be uncompressed formats obviously.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 29th April 2016, 15:05   #2095  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,412
YUV 444 10bit packed is known as "Y410", but it's not supported in ffmpeg as a pixel format .


https://msdn.microsoft.com/en-us/lib...px#_444formats
https://en.wikipedia.org/wiki/FFmpeg#Pixel_formats

It's also known as "v410" (analgous to "v210" for 10bit422) but 10bit444
https://www.mplayerhq.hu/DOCS/codecs-status.html
poisondeathray is offline   Reply With Quote
Old 29th April 2016, 15:24   #2096  |  Link
stax76
staxrip & mpv.net
 
Join Date: Jun 2002
Posts: 5,247
yuv fourcc on apple dev page:

https://developer.apple.com/library/...4-CH1-SECTION3

Code:
d:\Temp>ffmpeg -codecs -hide_banner | findstr 4:4:4
 DEVI.. ayuv                 Uncompressed packed MS 4:4:4:4
 DEVI.. v308                 Uncompressed packed 4:4:4
 DEVI.. v408                 Uncompressed packed QT 4:4:4:4
 DEVI.S v410                 Uncompressed 4:4:4 10-bit
__________________
staxrip is in need of a new maintainer since I would like to retire.

Last edited by stax76; 29th April 2016 at 15:30.
stax76 is offline   Reply With Quote
Old 29th April 2016, 16:34   #2097  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 432
I don't think it's helpful.

x264/x265 accept i420, yv12, nv12, i422, yv16, nv16, i444, yv24:
- yv12, yv16 and yv24 are planar, good;
- i420, i422, i444 are identical except that the U and V plane order is reversed, good;
- nv12, nv16 are semi-planar.

Why add a packed format?
__________________
github.com

Last edited by Khanattila; 29th April 2016 at 16:37.
Khanattila is offline   Reply With Quote
Old 29th April 2016, 16:45   #2098  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,770
My personal opinion is that you should just let vfw die. I know it's convenient and simple sometimes but it simply doesn't define enough things. Simply convert to RGB24 or yv24 at the end of all scripts you're only going to preview and be done with it.

If anything I thinkbthe future belongs to specialized editors/preview apps that have proper 10bit and up handling. There are monitors that truly support a higher depth but I don't think any open source solution is capable of properly doing that yet. Let vfw die, it's old and tired.

And you can easily pipe y4m at higher depths into x264 so that makes even less sense. I got that stuff added to y4m several years ago to work around this.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 29th April 2016, 19:16   #2099  |  Link
stax76
staxrip & mpv.net
 
Join Date: Jun 2002
Posts: 5,247
I don't give it up yet, I'm getting closer though.
__________________
staxrip is in need of a new maintainer since I would like to retire.
stax76 is offline   Reply With Quote
Old 29th April 2016, 19:45   #2100  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,770
Quote:
Originally Posted by stax76 View Post
I don't give it up yet, I'm getting closer though.
Why does staxrip need it at all when doing VS stuff?
__________________
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 18:17.


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