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 10th September 2017, 16:01   #2701  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
Attachments need to be approved here. Better use any pastebin if you can, or the CODE bbTag.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 10th September 2017, 16:10   #2702  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
@mparade: Do you get an error when you open the script with inside the Vapoursynth editor, or through:
Code:
"C:\PROGRA~1\Hybrid\VAPOUR~1\vspipe.exe" --info "PATH to Script"
if you do you might want to share that info,...
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 10th September 2017, 16:35   #2703  |  Link
mparade
Registered User
 
Join Date: Nov 2013
Posts: 577
Quote:
Originally Posted by Selur View Post
@mparade: Do you get an error when you open the script with inside the Vapoursynth editor, or through:
Code:
"C:\PROGRA~1\Hybrid\VAPOUR~1\vspipe.exe" --info "PATH to Script"
if you do you might want to share that info,...
In VS editor there seems to be no error.
In Windows command line I got: "No output file specified"
mparade is offline   Reply With Quote
Old 10th September 2017, 16:37   #2704  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
You need to specify a hyphen ("-") for the vsipe command.
sneaker_ger is offline   Reply With Quote
Old 10th September 2017, 16:48   #2705  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Oh, sorry, sneaker_ger is right I forgot to write it down.
Code:
"C:\PROGRA~1\Hybrid\VAPOUR~1\vspipe.exe" --info "PATH to Script" -
Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 10th September 2017, 17:03   #2706  |  Link
mparade
Registered User
 
Join Date: Nov 2013
Posts: 577
Quote:
Originally Posted by Selur View Post
Oh, sorry, sneaker_ger is right I forgot to write it down.
Code:
"C:\PROGRA~1\Hybrid\VAPOUR~1\vspipe.exe" --info "PATH to Script" -
Cu Selur
Then:

1. Message on command line:
Quote:
setVideoInfo: The VSFormat pointer passed by DGSource was not obtained from registerFormat() or getFormatPreset().
2. I get bug report from my Windows 10 64 bit OS:
Quote:
Operation of VSPipe.exe has been terminated
-- close program button inside the bug report window needs to click on
mparade is offline   Reply With Quote
Old 10th September 2017, 17:10   #2707  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Quote:
setVideoInfo: The VSFormat pointer passed by DGSource was not obtained from registerFormat() or getFormatPreset().
That either sounds like a bug in DGSource or a bug/limitation in Vapoursynth 'avs'-filter handling capabilities.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 10th September 2017, 17:11   #2708  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
I've tried:

Code:
import vapoursynth as vs
core = vs.get_core()
core.avs.LoadPlugin(r"D:\Software\Medien\DGDecNV\DGDecodeNV.dll")
clip = core.avs.DGSource(r"D:\Video\Samples\4K\HEVC 10-bit_temp\HEVC 10-bit.dgi", fulldepth = True)
clip.set_output()
result:

Unhandled exception at 0x00007FFB268634BE (ucrtbase.dll) in Veedub64.exe: Fatal program exit requested.
stax76 is offline   Reply With Quote
Old 12th September 2017, 20:02   #2709  |  Link
mparade
Registered User
 
Join Date: Nov 2013
Posts: 577
The answer to this maybe as simple as whether Vapoursynth supports HDR from Avisynth source filters or not. Or maybe it can have problem with 16 bit and it needs to be converted to 10 bit first.
mparade is offline   Reply With Quote
Old 12th September 2017, 20:06   #2710  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Problem is:
a. DG probably will not create a native Vapoursynth version of DGSource.
b. I would understand the Vapoursynth developers when they say that they won't support anything but 8bit from Avisynth filters.
-> I keep my fingers crossed.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 12th September 2017, 22:28   #2711  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Selur View Post
Problem is:
a. DG probably will not create a native Vapoursynth version of DGSource.
b. I would understand the Vapoursynth developers when they say that they won't support anything but 8bit from Avisynth filters.
-> I keep my fingers crossed.
I already support all the avs+ formats. This is something else. I also have no intention of paying (I mean compulsory donation hahahahaha) to debug this. Or buying an nvidia graphics card for that matter.

Let the butthurt commence!
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 13th September 2017, 07:40   #2712  |  Link
Logan9778
Registered User
 
Join Date: Mar 2017
Posts: 118
Yeah, just love that "compulsory donation". However, in Nvidia's defense ( as much as they charge for a dang video card ), using the GPU did significantly speed up my AviSynth / X264 output.
Logan9778 is offline   Reply With Quote
Old 13th September 2017, 16:15   #2713  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
How do I apply filter to a range of frames on a video? I have a list of range and a list of different setting of a filter, and have each setting applies to each range of frames.
Code:
ranges = [[0,100],[500,1000],[1500,10000]]
settings = [1,2,3]

clip = somefunc(setting=settings[0]) # applies to frame 0-100
clip = somefunc(setting=settings[1]) # applies to frame 500-1000
This looks like a task for the FrameEval but it doesn't allow me to set the range of frames as input.
lansing is offline   Reply With Quote
Old 13th September 2017, 17:53   #2714  |  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
How do I apply filter to a range of frames on a video? I have a list of range and a list of different setting of a filter, and have each setting applies to each range of frames.
Code:
ranges = [[0,100],[500,1000],[1500,10000]]
settings = [1,2,3]

clip = somefunc(setting=settings[0]) # applies to frame 0-100
clip = somefunc(setting=settings[1]) # applies to frame 500-1000
This looks like a task for the FrameEval but it doesn't allow me to set the range of frames as input.
Trim and splice. Like avisynth.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 13th September 2017, 18:19   #2715  |  Link
splinter98
Registered User
 
Join Date: Oct 2010
Posts: 36
Quote:
Originally Posted by Myrsloik View Post
Trim and splice. Like avisynth.
Yep, but unlike avisynth you can sprinkle some python magic (untested):

Code:
def gen_clip(clip, ranges, settings):
    i = 0
    for rng, setting in ranges:
        start, end = rng
        if start > i:
            yield clip[i:start], None
        yield clip[start:end]), setting
        i = end
    if end < len(clip):
        yield clip[end:]

clip = core.std.Splice([somefunc(c, setting=s) for c,s in gen_clip(clip, ranges, settings) if s is not None else c])

Last edited by splinter98; 13th September 2017 at 18:24.
splinter98 is offline   Reply With Quote
Old 13th September 2017, 20:33   #2716  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
Quote:
Originally Posted by Myrsloik View Post
Trim and splice. Like avisynth.
Except AviSynth has ReplaceFramesSimple:

A=somefunc(settings)
ReplaceFramesSimple(Last,A,Mappings="[0 500]")


It is, admittedly, even more helpful when you have multiple instances of needing the same settings over a limited range of frames but I couldn't live without it and find the more traditional Trim/Splice method pretty clunky and completely unworkable when there are a lot of different filters with different settings to use over a limited range of frames. It won't work in Vapoursynth without changes being made?

http://www.avisynth.nl/users/stickboy/

Last edited by manono; 14th September 2017 at 05:18. Reason: Fixed an incomplete ReplaceFramesSimple line. Can also add more frame ranges if needed.
manono is offline   Reply With Quote
Old 13th September 2017, 23:42   #2717  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
And in vapoursynth you have https://github.com/Irrational-Encodi...th-RemapFrames and https://github.com/Irrational-Encodi...vsfunc.py#L825 and only god know how many more python functions scattered around the internet.
Are_ is offline   Reply With Quote
Old 14th September 2017, 00:32   #2718  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
Yes. You have the Python standard library at your fingertips and the VS clips are list-like objects. There is absolutely no need for plugins to muck around with frame orders or applying filters to parts of clips.

If I read the original request correctly you just want to use zip() to pair up frame ranges with their arguments. That's pretty much a oneliner, something like
Code:
ranges = [(0, 200), (300, 400)]
settings = [{'argument': 3}, {'argument': 4}]
clip = core.std.splice([core.foo.Bar(clip, **args)[start:end] for (start, end), args in zip(ranges, settings)])
Not tested, of course.

Python syntax abuse used:
- Double splat operator (**), or "argument dict unpacking": if you have a function in Python that takes two named arguments a and b, and a dict like {"a": 3, "b": 4}, calling func(**argsDict) will end up calling the function with the a parameter being 3 and the b parameter being 4. Very handy, that. Use single splat (*) for similarly translating a list to positional arguments. You can use both at the same time, as in func(*positional, **named).

- List comprehensions, as in [str(x) for x in [0, 1, 2]] - a handy way to write oneliners and you should use them at every opportunity to make sure nobody can read your code.

- Nested destructuring (or maybe it's more appropriately called "unpacking" in Python terminology?) assignment of iterator variables, as in:
Code:
[str(c) for (b, c), a in [((3, 5), 6)]]
# returns ['5']

Last edited by TheFluff; 14th September 2017 at 00:56.
TheFluff is offline   Reply With Quote
Old 14th September 2017, 00:55   #2719  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by TheFluff View Post
Yes. You have the Python standard library at your fingertips and the VS clips are list-like objects. There is absolutely no need for plugins to muck around with frame orders or applying filters to parts of clips.

If I read the original request correctly you just want zip() to pair up frame ranges with their arguments. That's pretty much a oneliner, something like
Code:
ranges = [(0, 200), (300, 400)]
settings = [{'argument': 3}, {'argument': 4}]
clip = core.std.splice([core.foo.Bar(clip[start:end], **args) for (start, end), args in zip(ranges, settings)])
Not tested, of course.

Python syntax abuse used:
- Double splat operator (**), or "argument dict unpacking": if you have a function in Python that takes two named arguments a and b, and a dict like {"a": 3, "b": 4}, calling func(**argsDict) will end up calling the function with the a parameter being 3 and the b parameter being 4. Very handy, that. Use single splat (*) for similarly translating a list to positional arguments. You can use both at the same time, as in func(*positional, **named).

- List comprehensions, as in [str(x) for x in [0, 1, 2]] - a handy way to write oneliners and you should use them at every opportunity to make sure nobody can read your code.

- Nested destructuring (or maybe it's more appropriately called "unpacking" in Python terminology?) assignment of iterator variables, as in:
Code:
[str(c) for (b, c), a in [((3, 5), 6)]]
# returns ['5']
I did use zip() in a for loop similar, but then that will only append clips with frames that were specified in the ranges. In this example, I want to apply filter on frame 0-200 and 300-400, and have frame 201-299 and frames after 400 untouched.

Reading through the filter description, looks like ReplaceFrames is the function for this task.
lansing is offline   Reply With Quote
Old 14th September 2017, 15:30   #2720  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Ok I got it working with ReplaceFramesSimple in the remapframes package
Code:
ranges = [[0,200],[300,400],[1000,10000]]
settings = [1,2,3]

for r, s in zip(ranges, settings):
	temp = somefunc(clip, setting=s)
	map_string = '[{} {}]'.format(r[0], r[1])	
	final_clip = core.remap.Rfs(clip, temp, mappings=map_string, mismatch=False)
lansing 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 08:31.


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