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 25th August 2021, 17:04   #61  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by lansing View Post
The test installer didn't include the api4 headers in the sdk folder
Will be fixed in the next build.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 25th August 2021, 20:40   #62  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
It's RC1 time!

Notable changes from test3:
  • nfMakeLinear source filters now perform well again (FFMS2 was 50% faster than in the R54 API3 release in my very unscientific test)
  • It's now possible to select additional fourccs for output. Use vs.set_option('alt_output', x). Where 1 gives you I420, YUY2 or v210 and 2 gives you IYUV or UYVY depending on input. Invalid alt_output modes are simply ignored.
  • In Python you now access frame data with "plane = frame[0]" and then that's a 2d array, get_read/write_array() functions have been removed since they were broken in many subtle ways
  • The API4 headers are included in the installer
  • Lots of small bug fixes

Note that non-source filters that use nfMakeLinear (very few) still work poorly and will need to be manually updated.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 25th August 2021 at 20:42.
Myrsloik is offline   Reply With Quote
Old 25th August 2021, 21:31   #63  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by Myrsloik View Post
nfMakeLinear source filters now perform well again
Thank you.

Is there a way to install and test this without affecting my API3 install?
videoh is offline   Reply With Quote
Old 25th August 2021, 21:49   #64  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by videoh View Post
Thank you.

Is there a way to install and test this without affecting my API3 install?
Use the portable version if you're fine with vspipe for output. Simply grab the python 3.9.x embedded version and extract the portable VS version on top. Done!

Extracting vsedit in the same dir used to work too.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 25th August 2021, 23:42   #65  |  Link
_Al_
Registered User
 
Join Date: May 2011
Posts: 321
Using that latest API4 R 55 portable RC1 version with latest portable python 3.9 on windows 7, running VSPipe.exe I get:
Code:
The program can't start because api-ms-win-core-path-|1-1-0.dll is missing from computer. Try reinstalling the program to fix this problem.
What do i have outdated? Older R51 portable is working.
Do I need Visual Studio 2019 for portable setup?

Last edited by _Al_; 26th August 2021 at 00:00.
_Al_ is offline   Reply With Quote
Old 26th August 2021, 00:08   #66  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by Myrsloik View Post
Use the portable version if you're fine with vspipe for output. Simply grab the python 3.9.x embedded version and extract the portable VS version on top. Done!
I don't know what this means. Any chance of a step-by-step? Thank you.
videoh is offline   Reply With Quote
Old 26th August 2021, 00:19   #67  |  Link
DJATOM
Registered User
 
DJATOM's Avatar
 
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 377
1) download https://www.python.org/ftp/python/3....mbed-amd64.zip
2) extract it to for example VS-R55-API4
3) download https://github.com/vapoursynth/vapou...55-API4-RC1.7z
4) extract contents of that archive into VS-R55-API4 (confirm overwrite of some files)
5) copy plugins into VS-R55-API4\vapoursynth64\plugins
6) if you want to add some importable scripts, copy them into VS-R55-API4 or edit python39._pth and add extra line with your scripts location (I'm using ./vs-scripts)
7) if you willing to use some preview application (VapourSynth Editor), there's https://github.com/YomikoR/VapourSyn...od-1-x86_64.7z which works with APIv4 Vapoursynth (extract contents into VS-R55-API4)

I believe that's enough to get things working.
__________________
Me on GitHub
PC Specs: Ryzen 5950X, 64 GB RAM, RTX 2070
DJATOM is offline   Reply With Quote
Old 26th August 2021, 00:24   #68  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
embedded + portable vapoursynth seems to work for me on simple scripts so far (using similar procedure as DJATOM) , but I have same installed python version as the embedded version and it doesn't work with the installed version - "Failed to initialize VSScript"

Is there anyway I can use installed python version with the portable vapoursynth version?
poisondeathray is offline   Reply With Quote
Old 26th August 2021, 02:23   #69  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by Myrsloik View Post
It's now possible to select additional fourccs for output. Use vs.set_option('alt_output', x). Where 1 gives you I420, YUY2 or v210 and 2

gives you IYUV or UYVY depending on input. Invalid alt_output modes are simply ignored.
Does not seem to work correctly - I tried different combinations like putting it before/after set_output(),

VapourSynth-Editor-r19-mod-1 shows no error, preview ok

Code:
import vapoursynth as vs
core = vs.core
clip = core.std.BlankClip(width=1920,height=1080,format=vs.YUV422P8, length=300, color=[16, 128, 128])
#clip = core.std.BlankClip(width=1920,height=1080,format=vs.YUV422P10, length=300, color=[64, 512, 512])
clip = core.std.AssumeFPS(clip, fpsnum=30000, fpsden=1001)
clip = core.text.FrameNum(clip)
#vs.set_option('alt_output', 1)
#vs.set_option('alt_output', 2)
clip.set_output()
#vs.set_option('alt_output', 1)
vs.set_option('alt_output', 2)
bundled vspipe -v says
Core R54
API R4.0
API R3.6

using avfs
"PATH\python-3.9.6-embed-amd64\avfs" yuv422_alt1.vpy gives yv16 according to mediainfo (should be YUY2)
"PATH\python-3.9.6-embed-amd64\avfs" yuv422_alt2.vpy gives yv16 according to mediainfo (should be UYVY)

"PATH\python-3.9.6-embed-amd64\avfs" yuv422p10_alt1.vpy gives p210 according to mediainfo (should be v210)

using vspipe to ffmpeg
"PATH\python-3.9.6-embed-amd64\vspipe" --y4m yuv422_alt2.vpy - | ffmpeg -f yuv4mpegpipe -i - -an -f null NUL

ffmpeg reports Y42B, yuv422p . Normally it should say UYVY , uyvy422

Last edited by poisondeathray; 26th August 2021 at 02:27.
poisondeathray is offline   Reply With Quote
Old 26th August 2021, 02:50   #70  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by DJATOM View Post
1) download https://www.python.org/ftp/python/3....mbed-amd64.zip
2) extract it to for example VS-R55-API4
...
I believe that's enough to get things working.
Thank you, DJ!
videoh is offline   Reply With Quote
Old 26th August 2021, 03:16   #71  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
In VSScript.h there's a vsscript_finalize() to free the runtime, what do I do for this with VSScript4.h?
lansing is offline   Reply With Quote
Old 26th August 2021, 03:32   #72  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by lansing View Post
In VSScript.h there's a vsscript_finalize() to free the runtime, what do I do for this with VSScript4.h?
You don't have to do anything when done now
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 26th August 2021, 09:20   #73  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
This change in video format id comparison is getting too long?
Code:
// api3
if(cpVideoFormat.id == pfRGB24) {}

// api4
uint32_t formatId = m_cpVSAPI->queryVideoFormatID(cpVideoFormat.colorFamily, 
            cpVideoFormat.sampleType, cpVideoFormat.bitsPerSample, cpVideoFormat.subSamplingW,
            cpVideoFormat.subSamplingH, m_pCore);

if(formatId == pfRGB24){}
Or, is this the correct way to use it?
Code:
int formatIdFound = m_cpVSAPI->getVideoFormatByID(&cpVideoFormat, pfRGB24, m_pCore);
        
if (formatIdFound != 0) {}

Last edited by lansing; 26th August 2021 at 09:28. Reason: update
lansing is offline   Reply With Quote
Old 26th August 2021, 09:51   #74  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
The field base enum in the VSConstants4.h is wrong

Code:
typedef enum VSFieldBased {
	VSC_FIELD_PROGRESSIVE = 0,
	VSC_FIELD_TOP = 1,
	VSC_FIELD_BOTTOM = 2
} VSFieldBased;
The documentation said that bff is 1 and tff is 2.
lansing is offline   Reply With Quote
Old 26th August 2021, 12:08   #75  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by lansing View Post
The field base enum in the VSConstants4.h is wrong

Code:
typedef enum VSFieldBased {
	VSC_FIELD_PROGRESSIVE = 0,
	VSC_FIELD_TOP = 1,
	VSC_FIELD_BOTTOM = 2
} VSFieldBased;
The documentation said that bff is 1 and tff is 2.
Will fix. There are some comparison helper functions in https://github.com/vapoursynth/vapou...SHelper4.h#L93. I'll probably add some more to cover VideoFormat and pfConstant later.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 26th August 2021, 12:12   #76  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by poisondeathray View Post
Does not seem to work correctly - I tried different combinations like putting it before/after set_output(),

VapourSynth-Editor-r19-mod-1 shows no error, preview ok

Code:
import vapoursynth as vs
core = vs.core
clip = core.std.BlankClip(width=1920,height=1080,format=vs.YUV422P8, length=300, color=[16, 128, 128])
#clip = core.std.BlankClip(width=1920,height=1080,format=vs.YUV422P10, length=300, color=[64, 512, 512])
clip = core.std.AssumeFPS(clip, fpsnum=30000, fpsden=1001)
clip = core.text.FrameNum(clip)
#vs.set_option('alt_output', 1)
#vs.set_option('alt_output', 2)
clip.set_output()
#vs.set_option('alt_output', 1)
vs.set_option('alt_output', 2)
bundled vspipe -v says
Core R54
API R4.0
API R3.6

using avfs
"PATH\python-3.9.6-embed-amd64\avfs" yuv422_alt1.vpy gives yv16 according to mediainfo (should be YUY2)
"PATH\python-3.9.6-embed-amd64\avfs" yuv422_alt2.vpy gives yv16 according to mediainfo (should be UYVY)

"PATH\python-3.9.6-embed-amd64\avfs" yuv422p10_alt1.vpy gives p210 according to mediainfo (should be v210)

using vspipe to ffmpeg
"PATH\python-3.9.6-embed-amd64\vspipe" --y4m yuv422_alt2.vpy - | ffmpeg -f yuv4mpegpipe -i - -an -f null NUL

ffmpeg reports Y42B, yuv422p . Normally it should say UYVY , uyvy422
Core R54 <= you've accidentally used an older version somehow
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 26th August 2021, 14:16   #77  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by Myrsloik View Post
Core R54 <= you've accidentally used an older version somehow

You're right

Core R55
API R4.0
API R3.6


But with Core R55, ffmpeg still reports Y42B, yuv422p for the yuv422 alt2 script .

Also, avfs now crashes when file is accessed, even a plain BlankClip script (without alt_output options) . It "mounts", but as soon as you touch or access the fake avi, it crashes no helpful error message

Calling old avfs with same plain BlankClip script does not crash
poisondeathray is offline   Reply With Quote
Old 26th August 2021, 18:42   #78  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
In case anyone's wondering the part of the API in vsscript4.h is not considered stable. I predict that it will be rolled back closer to something along the lines of the old api.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 26th August 2021, 20:58   #79  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
is there a functionality in API v3 that corresponds to setCacheOptions in API v4?
feisty2 is offline   Reply With Quote
Old 26th August 2021, 21:21   #80  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by feisty2 View Post
is there a functionality in API v3 that corresponds to setCacheOptions in API v4?
The closest thing is if you manually insert a cache and pass a bunch of arguments to it. But the arguments are quite different in api3 so even that's questionable.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik 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 10:02.


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