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 23rd February 2020, 21:13   #3741  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by amichaelt View Post
What about avisynth_c.h?
Using the avisynth C api is really iffy. If all you want is to evaluate a script and get frames out then writing your own C++ wrapper dll will be so much more reliable and also faster. Believe me, I've tried both ways long ago when developing yatta.

VapourSynth has a very straightforward C-api in comparison.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 23rd February 2020, 23:18   #3742  |  Link
_Al_
Registered User
 
Join Date: May 2011
Posts: 321
If trying to modify props and clip resolution is ridiculously small, it crashes, where no recovery is possible, it locks a PC.

Code:
rgb  = core.std.BlankClip(width=30, height=16, format=vs.RGB24)
rgb2 = rgb.std.PlaneStats(prop='PlaneStats')
PROP_NAME  = f'New_string_name_here'
def copy_prop(n,f):
   f_out = f[0].copy()
   f_out.props[PROP_NAME] = '{:.1f}'.format(f[1].props['PlaneStatsAverage']*100)
   return f_out
rgb = core.std.ModifyFrame(rgb, [rgb, rgb2], copy_prop)

Last edited by _Al_; 23rd February 2020 at 23:20.
_Al_ is offline   Reply With Quote
Old 24th February 2020, 00:31   #3743  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Quote:
Originally Posted by DJATOM View Post
The way you're using frame fetching in VS is inefficient. In general you have to care about async frame requests on your end, otherwise it works like a single-threaded frameserver.
For a GUI like staxrip it's totally fine, it's not used for encoding but only to access parameters and for a basic crop and preview dialog that doesn't support playback and HDR color handling but has mpv/mpc integration to take care of this. The GDI based WinForms rendering was ridiculously slow but it was addressed with a hardware accelerated Direct2D replacement. It does a vertical flip and converts to RGB32 in software via avs/vs. For best possible performance vertical flip and YV12 could be handled by Direct3D and like you told frames could be accessed asynchronously.

Last edited by stax76; 24th February 2020 at 00:46.
stax76 is offline   Reply With Quote
Old 29th February 2020, 15:22   #3744  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by _Al_ View Post
If trying to modify props and clip resolution is ridiculously small, it crashes, where no recovery is possible, it locks a PC.

Code:
rgb  = core.std.BlankClip(width=30, height=16, format=vs.RGB24)
rgb2 = rgb.std.PlaneStats(prop='PlaneStats')
PROP_NAME  = f'New_string_name_here'
def copy_prop(n,f):
   f_out = f[0].copy()
   f_out.props[PROP_NAME] = '{:.1f}'.format(f[1].props['PlaneStatsAverage']*100)
   return f_out
rgb = core.std.ModifyFrame(rgb, [rgb, rgb2], copy_prop)
I can't reproduce this and need more information. CPU? OS? Number of threads? Does it happen every time?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 1st March 2020, 00:02   #3745  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
R49-RC1 is now available. All maintenance this time since I'm slowly working on the separate audio build.

Changes:
Code:
r49:
updated to python 3.8 on windows
updated visual studio 2019 runtime version
updated zimg and added support for spline64 resize method
fixed a savestring bug in avscompat (sekrit-twc)
interleave, selectevery and separate fields now have a modify_duration argument to determine if they modify frame durations and fps
addborders and crop now update the _fieldbased attribute properly when an odd number of lines are cut from the top
fixed add to path not working for single user installs
fixed compilation on non-x86 systems
fixed an infinite loop in the expr filter optimizer that was introduced in r48 (sekrit-twc)
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 3rd March 2020, 07:44   #3746  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
I don't know if this is a bug from vapoursynth or KNLMeansCL. KNLMeansCL requires input clip to be YUV444P10, but it still complains about it when I converted my clip to YUV444P10.

Code:
clip = core.resize.Bicubic(clip, format=vs.YUV444P10)
clip = core.knlm.KNLMeansCL(clip)
But then it works when I convert it to YUV444P8
lansing is offline   Reply With Quote
Old 4th March 2020, 19:31   #3747  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
@lansing: read https://github.com/Khanattila/KNLMeansCL/issues/42
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 4th March 2020, 20:31   #3748  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by Selur View Post
Thanks, I'll follow up over there.
lansing is offline   Reply With Quote
Old 19th March 2020, 21:21   #3749  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
R49-RC2 is out. Should be the final RC.

Code:
r49:
updated to python 3.8 on windows
updated visual studio 2019 runtime version
updated zimg and added support for spline64 resize method
fixed transfer characteristics not being applied to gray format clips (sekrit-twc)
fixed vdecimate bugs when compiled on systems where char is unsigned by default
fixed a regression introduced in r48 in that could sometimes cause corrupt output from expr on cpus without sse4.1 (sekrit-twc)
fixed a savestring bug in avscompat (sekrit-twc)
interleave, selectevery and separate fields now have a modify_duration argument to determine if they modify frame durations and fps
addborders and crop now update the _fieldbased attribute properly when an odd number of lines are cut from the top
fixed add to path not working for single user installs
fixed compilation on non-x86 systems
fixed an infinite loop in the expr filter optimizer that was introduced in r48 (sekrit-twc)
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 24th March 2020, 16:17   #3750  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,345
Can 2 python versions 3.x coexist ? 3.7.x and 3.8.x ? I ask because I need 3.7 for some other projects but would like to test new version of vapoursynth, and I'm assuming 3.8 is a requirement for r49-rc2 ?
poisondeathray is offline   Reply With Quote
Old 24th March 2020, 16:30   #3751  |  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
Can 2 python versions 3.x coexist ? 3.7.x and 3.8.x ? I ask because I need 3.7 for some other projects but would like to test new version of vapoursynth, and I'm assuming 3.8 is a requirement for r49-rc2 ?
Yes, they can generally do that without any problems. However the python installer doesn't approve so you'll need to rename/delete the registry entries for the version you install first.

There's also always the portable version. Maybe that's easier.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 25th March 2020, 07:33   #3752  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
@Myrsloik
Code:
auto y1 = vsapi->getReadPtr(x, 0);

auto x2 = vsapi->cloneFrameRef(x);
auto y2 = vsapi->getReadPtr(x2, 0);
say "x" is a frame ref, do "y1" and "y2" evaluate to the same value?
feisty2 is offline   Reply With Quote
Old 25th March 2020, 09:05   #3753  |  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
@Myrsloik
Code:
auto y1 = vsapi->getReadPtr(x, 0);

auto x2 = vsapi->cloneFrameRef(x);
auto y2 = vsapi->getReadPtr(x2, 0);
say "x" is a frame ref, do "y1" and "y2" evaluate to the same value?
Yes, they point to the same underlying frame.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 26th March 2020, 14:58   #3754  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
what is the lifetime of "in" and "out" in the "Create" function? If I create an std::string_view from propGetData(in, ...), does it have a global lifetime?
feisty2 is offline   Reply With Quote
Old 26th March 2020, 15:25   #3755  |  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
what is the lifetime of "in" and "out" in the "Create" function? If I create an std::string_view from propGetData(in, ...), does it have a global lifetime?
They're only valid inside the create function and usually destroyed very quickly after.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 26th March 2020, 15:32   #3756  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
I see, so I should copy the string with an owning std::string.
feisty2 is offline   Reply With Quote
Old 26th March 2020, 15:37   #3757  |  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
I see, so I should copy the string with an owning std::string.
Yes, always.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 26th March 2020, 16:32   #3758  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
If I have a VFR video clip, say like part A deinterlaced to 25fps and part B bobbed to 50fps in the script and the two parts combined with A+B - what is the proper way to get the correct timecodes out with vspipe? Should I use AssumeFPS to set the framerate to 25fps (which I will use when I feed it to x265) or leave it as it is?
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 26th March 2020, 20:31   #3759  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
R49 released!
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 26th March 2020, 20:33   #3760  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Boulder View Post
If I have a VFR video clip, say like part A deinterlaced to 25fps and part B bobbed to 50fps in the script and the two parts combined with A+B - what is the proper way to get the correct timecodes out with vspipe? Should I use AssumeFPS to set the framerate to 25fps (which I will use when I feed it to x265) or leave it as it is?
It's been a long time since I did this so it could be wrong but generally you simply splice the two different fps clips (mismatch=1 in splice) and then use it as input to x265. Make sure to use the vspipe timecode option and after the encode is done mux in the proper timecodes.

Or that's how I think it should work.
__________________
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 10:41.


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