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 3rd March 2017, 06:12   #1  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 156
Cloning, individually processing and merging clips?

Is cloning, individually processing and then merging clips supported in Vapoursynth?

Code:
# make copies of a clip
for i in range(0, loop):
    clips.append(clip[:])
...
# process all clips
for i in range(0, loop):
    .. set unique parameters
    .. process clips[i]
...
# merge all clips
for i in range(0, loop):
    clip += clips[i]
Semantically there should not be a difference between the last loop and a single assignment right?

Code:
clip = clips[0] + clips[1] + clips[2] ......

Last edited by Cary Knoop; 3rd March 2017 at 06:35.
Cary Knoop is offline   Reply With Quote
Old 3rd March 2017, 09:28   #2  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 711
Making copies is not necessary. The original clip remains unchanged if you never assign anything new to it. You can pass it to however many filters you want.
Code:
clips = []
for i in range(0, loop):
    clips.append(YourFilter(clip))
And yes, your third loop is almost the same as that single assignment. I say almost the same because the loop appends the filtered versions to the original clip, but the single assignment only splices the filtered versions together. You would need to use += to make it exactly the same as the loop.

If you have a lot of clips it's more efficient to call Splice directly. That way there is only one instance of it, instead of one for every addition operator.
Code:
clip = core.std.Splice(clips)
# Or if you want the original included, like in the loop:
#clip = core.std.Splice([clip, core.std.Splice(clips)])
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 3rd March 2017, 17:26   #3  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 156
Quote:
Originally Posted by jackoneill View Post
Making copies is not necessary. The original clip remains unchanged if you never assign anything new to it.
Great, thanks!

Quote:
Originally Posted by jackoneill View Post
clip = core.std.Splice(clips)
Yes, this one works great.

Thanks for the help!
Cary Knoop 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 22:57.


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