Log in

View Full Version : Most basic VapourSynth test script


LigH
28th January 2024, 16:28
I would like to check if a custom ffmpeg built with media-autobuild suite with VapourSynth support enabled works correctly with a *.vpy script as input file directly.

Can you recommend me a most basic script to generate a video clip for ffmpeg to process, similar to AviSynth commands like "Version()" or "ColorBarsHD().Info()"? It should not require any physical source video file, if possible.

poisondeathray
28th January 2024, 16:30
This is like "version" in avisynth


import vapoursynth as vs
core = vs.core
clip = core.std.BlankClip(format=vs.RGB24, color=[0, 0, 0])
c = core.text.CoreInfo(clip)
c.set_output()

LigH
28th January 2024, 16:59
Thank you for your quick response.

I tried it to convert it to MP4 with x264, but my ffmpeg only prints its configuration and then quits (when I had a typo in the source file name, I got an error message). Same for ffprobe or ffplay.

At least VSPipe.exe -info version.vpy reports a few sane values. Maybe something is indeed missing.

poisondeathray
28th January 2024, 17:08
Thank you for your quick response.

I tried it to convert it to MP4 with x264, but my ffmpeg only prints its configuration and then quits (when I had a typo in the source file name, I got an error message). Same for ffprobe or ffplay.

At least VSPipe.exe -info version.vpy reports a few sane values. Maybe something is indeed missing.

What was the commandline ?

Not sure which version you were using, but in the old ffmpeg vapoursynth patches, you needed either -f vapoursynth or -f vapoursynth_alt as format input options . They weren't autodetected

e.g


ffmpeg -f vapoursynth -i input.vpy ....


There were significant speed differences for the patches. The "alt" patch was the "Stephen" patch and much faster if you had several filters. The default patch was faster for source filter only

LigH
28th January 2024, 20:24
More details: m-ab-s issue 2592 (https://github.com/m-ab-s/media-autobuild_suite/issues/2592)

I tried:
ffmpeg.exe -v verbose -f vapoursynth -i version.vpy -codec:v libx264 version.vpy.mp4
ffmpeg quit after displaying its configuration. No output file was created.

I also tried:
ffprobe.exe -f vapoursynth version.vpy
ffprobe quit after displaying its configuration. No analysis results were printed.

I also tried:
ffplay.exe -f vapoursynth version.vpy
ffplay quit after displaying its configuration and printed an additional statistics line with zero values.

Selur
29th January 2024, 05:37
I tried:
ffmpeg.exe -v verbose -f vapoursynth -i version.vpy -codec:v libx264 version.vpy.mp4
ffmpeg quit after displaying its configuration. No output file was created.

sound like '-v verbose' doesn't work, there should be more output.
try using '-loglevel verbose' instead and check whether it displays that the input was detected as Vapoursynth input. (not sure whether ffmpeg is compiled statically with the Vapoursynth libraries in it or whether it requires to be either inside a portable Python/Vapoursynth folder or to find a globally installed Python/Vapoursynth)

Cu Selur

LigH
29th January 2024, 10:09
ffmpeg.exe -loglevel verbose -f vapoursynth -i version.vpy -codec:v libx264 version.vpy.mp4

Same result, no text output after the configuration string.

To compare direct input with VSPipe, I would like to test the script from reply #2 (https://forum.doom9.org/showthread.php?p=1996625#post1996625) in YV24 or YV16 too, because the Y4M header does not support RGB.

Selur
29th January 2024, 17:00
Also check what:
ffmpeg.exe -v verbose -f vapoursynth -i version.vpy
outputs at least this should output some info about the source, if the Vapoursynth support works.

LigH
29th January 2024, 20:21
No output after the configuration string.

Selur
30th January 2024, 05:22
Then something is wrong with the Vapoursynth support. Haven't used this for ages, but there should be an output regaring the inputs format&co which also show that Vapoursynth is used.

poisondeathray
30th January 2024, 05:44
There were people building ffmpeg with vpy demuxer support - e.g. the ffmpeg builds in staxrip were built by Patman . But that was a while ago; I don't know the current status. And I think they might be x64 exclusively for while. Also quot27 on this forum posted some builds. Perhaps you can ask them about the current situation ?

LigH
30th January 2024, 10:13
In github, hydra3333 reported 64 bit ffmpeg working. We are discussing there too (see ^#5).

LigH
5th February 2024, 11:00
Current state: SegFault in vapoursynth.c in read_header_vs()
at
if (!vsscript_init()) {
when running 32-bit ffmpeg in a directory with the extracted content of python-3.11.0-embed-win32 and VapourSynth32-Portable-R63

The same works as expected
when running 64-bit ffmpeg in a directory with the extracted content of python-3.11.0-embed-win64 and VapourSynth64-Portable-R65

Selur
5th February 2024, 14:54
Older Vapoursynth doesn't work with Python 3.11, try Python 3.8 instead.

LigH
5th February 2024, 15:03
So I tried unpacking python-3.8.0-embed-win32 and VapourSynth32-Portable-R63 into one directory with ffmpeg; unfortunately, the same result: No output after the version string.

PS: Python 3.8.10 (https://www.python.org/downloads/release/python-3810/) seems to be the last v3.8 release with embeddable Win32 binaries. But no output either.

A file may be missing in the Python embed package.

Selur
5th February 2024, 16:02
Vapoursynth 32bit portable seems problem to me.
Normally "VSPipe --version" should output the Vapoursynth version (after extracting portable Python into a folder together with portable Vapoursynth), this does not work for any of the the portable 32bit Vapoursynth version downloads,...
=> seems to me 32bit portable Vapoursynth never worked.
Maybe be installing 32bit Vapoursynth through the installer and copying the files into a folder where a portable Python 3.8 and a portable.vs file works,..