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 16th February 2020, 06:17   #1  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Load avs x64 core function into vapoursynth x64 ?

Is there a way to load a native(internal) x64 avisynth core function (not an external .dll plugin) in vapoursynth x64 ?

eg. RGBAdjust()

avsproxy can embed x86 avs+ in x64 vapoursynth, but I don't think it can do x64 avs
poisondeathray is offline   Reply With Quote
Old 16th February 2020, 08:58   #2  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
No, not unless you recompile then as separate plugins. If you look at the rgbadjust documentation you'll see it's trivial to implement using expr.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 16th February 2020, 16:02   #3  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by Myrsloik View Post
No, not unless you recompile then as separate plugins. If you look at the rgbadjust documentation you'll see it's trivial to implement using expr.
Thanks,

In this case I was more interested in the analyze=true parameter ? Same with ColorYUV(analyze=true).

Or does vapoursynth have another similar function where it can display min/max values
poisondeathray is offline   Reply With Quote
Old 16th February 2020, 16:10   #4  |  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
Thanks,

In this case I was more interested in the analyze=true parameter ? Same with ColorYUV(analyze=true).

Or does vapoursynth have another similar function where it can display min/max values
This will show you what you want (untested)

Code:
vs.std.PlaneStats(clip).text.FrameProps()
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 16th February 2020, 16:21   #5  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
It works and does what I want, thanks
poisondeathray is offline   Reply With Quote
Old 16th February 2020, 16:26   #6  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Is there a smart python way to display results for planes 0,1,2 together in 1 command ?
poisondeathray is offline   Reply With Quote
Old 16th February 2020, 16:54   #7  |  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
Is there a smart python way to display results for planes 0,1,2 together in 1 command ?
Code:
vs.std.PlaneStats(clip, plane=0, prop='PlaneStatsR').std.PlaneStats(clip, plane=1, prop='PlaneStatsG').std.PlaneStats(clip, plane=2, prop='PlaneStatsB').text.FrameProps()
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 16th February 2020, 17:04   #8  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Thanks, it works
poisondeathray is offline   Reply With Quote
Old 16th February 2020, 22:33   #9  |  Link
_Al_
Registered User
 
Join Date: May 2011
Posts: 321
nice, and to analyze those frames it could go like this for example:
Code:
import vapoursynth
from vapoursynth import core
import threading

clip = core.lsmas.LibavSMASHSource(r'C:\video.mp4')
clip = core.resize.Point(clip, format = vs.RGB24, matrix_in_s = '709')

class Analyze:
    LABELS = [
               'RMin',
               'RMax',
               'GMin',
               'GMax',
               'BMin',
               'BMax'
             ]

    def __init__(self, c):
        self.c = c
        self.illegal_R = 0
        self.illegal_G = 0
        self.illegal_B = 0

        c = core.std.PlaneStats(c, plane=0, prop = 'PlaneStatsR' )\
                .std.PlaneStats(c, plane=1, prop = 'PlaneStatsG' )\
                .std.PlaneStats(c, plane=2, prop = 'PlaneStatsB' )

        for frame in range(len(c)):
            props_dict = dict(c.get_frame(frame).props)
            for label in self.LABELS:
                setattr(self, label, props_dict['PlaneStats'+label])
                #print('frame:', frame, label,'=', getattr(self, label))  
            self.analyze_frame(frame)

        self.resolution()

    def analyze_frame(self, frame):
        if self.RMin < MIN or self.RMax > MAX:
            self.illegal_R +=1
        #and something with other channels

    def resolution(self):
        print(f'channel R has {self.illegal_R} illegal frames out of {len(self.c)} frames')
       #etc.
        
            
 #checking illegal RGB values
MIN = 5
MAX=246        
test_clip = clip    
p = threading.Thread(target=Analyze, args=(test_clip,))       
p.start()
clip.set_output()

Last edited by _Al_; 16th February 2020 at 22:35.
_Al_ 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 06:56.


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