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 May 2018, 14:31   #3041  |  Link
Pat357
Registered User
 
Join Date: Jun 2006
Posts: 452
Quote:
Originally Posted by LigH View Post
Supporting VS optionally when the environment is available ... that will be much more interesting.
That's exactly what I mean !
See https://forum.doom9.org/showthread.p...28#post1840628

See here for proof : HolyWu compiled a ffmpeg binary (https://forum.doom9.org/showthread.p...63#post1840663)

He has also given a way how to create such binary :
https://forum.doom9.org/showthread.p...03#post1840703

Or read the whole thread (only 2 pages) at
https://forum.doom9.org/showthread.php?t=175341

I hope this makes you reconsider building ffmpeg with --enable-vapoursynth, because it works for all : VS installed, portable VS and without any VS.
Pat357 is offline   Reply With Quote
Old 26th May 2018, 11:17   #3042  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Got a small question, since my Vapoursynth/Python understanding is lacking. :/
I got the following script:
Code:
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'G:/Hybrid/64bit/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/SharpenFilter/AWarpSharp2/libawarpsharp2.dll")
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/SourceFilter/Imagemagick/libimwri.dll")
# Import scripts
import havsfunc
import mvsfunc
# Loading C:\Users\Selur\Desktop\Image sequence\%02d.png using vsImageReader
clip = core.imwri.Read("C:/Users/Selur/Desktop/Image sequence/%02d.png", firstnum=1)
clip = core.std.Trim(clip=clip, length=30)
# making sure frame rate is set to 25/1
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Making sure input color range is set to PC (full) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=0)
original = clip
 # line darkening using Toon
# adjusting color space from RGB24 to YUV444P16 for VsToon
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, matrix_s="709")
clip = havsfunc.Toon(input=clip)
# adjusting output color from: YUV444P16 to YUV420P8 for x264Model (i420)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8)
# adjusting for FilterView; original is RGB24 and clip is YUV420P8
if original.format.id != clip.format.id:
  if (original.format.id == vs.RGB24 or original.format.id == vs.RGB32):
    original = core.resize.Bicubic(original, format=clip.format.id,matrix_s="709",matrix_in_s="709")
  else:
    original = core.resize.Bicubic(original, format=clip.format.id,matrix_in_s="709")  
clip = core.text.Text(clip,"Filtered")
original = core.text.Text(original,"Original")
interleaved = core.std.Interleave([clip, original])
# Output
interleaved.set_output()
Where I want to apply 'Toon' to the input and compare it to the original, but get:
Quote:
Error getting the frame number 1:
Resize error 1026: RGB color family cannot have YUV matrix coefficients
I hoped that using the if-block would fix the issue.

-> How to fix this? + Is there a way to check if original.format.id is inside vs.RGB ?

Cu Selur
__________________
Hybrid here in the forum, homepage

Last edited by Selur; 26th May 2018 at 11:20.
Selur is offline   Reply With Quote
Old 26th May 2018, 11:26   #3043  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Check the color_family property instead. It indicates rgb/yuv/gray. I suspect that's what you want
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 26th May 2018, 11:38   #3044  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
What I want is that in case the formats of original and clip differ, that original should be adjusted.
Since converting from RGB to YUV requires that matrix_s is specified I need some 'if'-block.

How to get the frame propery?
Code:
original.props['color_family']
doesn't work.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 26th May 2018, 11:48   #3045  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
okay it's original.format.color_family.
Problem is:
Code:
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'G:/Hybrid/64bit/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/SharpenFilter/AWarpSharp2/libawarpsharp2.dll")
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/SourceFilter/Imagemagick/libimwri.dll")
# Import scripts
import havsfunc
import mvsfunc
# Loading C:\Users\Selur\Desktop\Image sequence\%02d.png using vsImageReader
clip = core.imwri.Read("C:/Users/Selur/Desktop/Image sequence/%02d.png", firstnum=1)
clip = core.std.Trim(clip=clip, length=30)
# making sure frame rate is set to 25/1
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Making sure input color range is set to PC (full) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=0)
original = clip
 # line darkening using Toon
# adjusting color space from RGB24 to YUV444P16 for VsToon
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, matrix_s="709")
clip = havsfunc.Toon(input=clip)
# adjusting output color from: YUV444P16 to YUV420P8 for x264Model (i420)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8)
# adjusting for FilterView
if original.format.id != clip.format.id:
  if (original.format.color_family == vs.RGB and clip.format.color_family != vs.RGB):
    original = core.resize.Bicubic(original, format=clip.format.id,matrix_s="709",matrix_in_s="709") 
  elif (original.format.color_family == clip.format.color_family):
    original = core.resize.Bicubic(original, format=clip.format.id) 
  else:
    original = core.resize.Bicubic(original, format=clip.format.id,matrix_in_s="709")
clip = core.text.Text(clip,"Filtered")
original = core.text.Text(original,"Original")
interleaved = core.std.Interleave([clip, original])
# Output
interleaved.set_output()
sill causes the error.
Quote:
Error getting the frame number 1:
Resize error 1026: RGB color family cannot have YUV matrix coefficients
No clue where the problem is.
I thought this should do the conversion and not add YUV matrix to RGB.
__________________
Hybrid here in the forum, homepage

Last edited by Selur; 26th May 2018 at 11:59.
Selur is offline   Reply With Quote
Old 26th May 2018, 23:37   #3046  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Thanks a lot ! That helped.
Didn't know about mvsfuncs Preview function.

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 30th May 2018, 15:42   #3047  |  Link
unix
Registered User
 
Join Date: Aug 2015
Posts: 47
Guys i got an error with some scripts
Quote:
Failed to evaluate the script:
Python exception: (unicode error) 'utf-8' codec can't decode byte 0xe9 in position 35: invalid continuation byte (mvsfunc.py, line 1267)

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1847, in vapoursynth.vpy_evaluateScript
File "C:/Users/G_N-A/Desktop/VapourSynthEditor-r16-64bit/Untitled.vpy", line 4, in
File "C:\Users\G_N-A\AppData\Local\Programs\Python\Python36\Lib\fvsfunc.py", line 4, in
import havsfunc as haf # https://github.com/HomeOfVapourSynthEvolution/havsfunc
File "C:\Users\G_N-A\AppData\Local\Programs\Python\Python36\Lib\havsfunc.py", line 2, in
import mvsfunc as mvf
File "C:\Users\G_N-A\AppData\Local\Programs\Python\Python36\Lib\mvsfunc.py", line 1267
"""
^
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xe9 in position 35: invalid continuation byte
I have python-3.6.5-64 & VapourSynth-R43-64, and I have attached 3 scripts that showing in the error message.

any help!

Last edited by unix; 31st May 2018 at 15:10.
unix is offline   Reply With Quote
Old 30th May 2018, 15:53   #3048  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by unix View Post
Guys i got an error with some scripts


I have python-3.6.5-64 & VapourSynth-R43-64, and I have attached 3 scripts that showing in the error message.

any help!
You haven't put anything inside the double quotation.
lansing is offline   Reply With Quote
Old 30th May 2018, 17:01   #3049  |  Link
unix
Registered User
 
Join Date: Aug 2015
Posts: 47
Quote:
Originally Posted by lansing View Post
You haven't put anything inside the double quotation.
I didn't get you!


this what inside the double quotation, the error message .

Quote:
Failed to evaluate the script:
Python exception: (unicode error) 'utf-8' codec can't decode byte 0xe9 in position 35: invalid continuation byte (mvsfunc.py, line 1267)

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1847, in
vapoursynth.vpy_evaluateScript
File "C:/Users/G_N-A/Desktop/VapourSynthEditor-r16-64bit/Untitled.vpy", line 4, in
File "C:\Users\G_N-A\AppData\Local\Programs\Python\Python36\Lib\fvsfunc.py", line 4, in
import havsfunc as haf # https://github.com/HomeOfVapourSynthEvolution/havsfunc
File "C:\Users\G_N-A\AppData\Local\Programs\Python\Python36\Lib\havsfunc.py", line 2, in
import mvsfunc as mvf
File "C:\Users\G_N-A\AppData\Local\Programs\Python\Python36\Lib\mvsfunc.py", line 1267
"""
^
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xe9 in position 35: invalid continuation byte
unix is offline   Reply With Quote
Old 30th May 2018, 17:08   #3050  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
Have you checked that the file mvsfunc.py is not broken? I.e. open it in Notepad++ and see what that line shows.
__________________
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 30th May 2018, 17:08   #3051  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by unix View Post
I didn't get you!


this what inside the double quotation, the error message .
lansing is offline   Reply With Quote
Old 30th May 2018, 17:23   #3052  |  Link
unix
Registered User
 
Join Date: Aug 2015
Posts: 47
Quote:
Have you checked that the file mvsfunc.py is not broken? I.e. open it in Notepad++ and see what that line shows.
One of the scripts was broken, and the second one was in ANSI encoding so i change it to UTF-8

thank you every one
unix is offline   Reply With Quote
Old 31st May 2018, 07:51   #3053  |  Link
unix
Registered User
 
Join Date: Aug 2015
Posts: 47
Back

I got another an error


Code:
Failed to evaluate the script:
Python exception: module 'mvsfunc' has no attribute 'Depth'

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1847, in vapoursynth.vpy_evaluateScript
File "/XXXXX/Desktop/VapourSynthEditor-r16-64bit/Untitled.vpy", line 9, in 
AttributeError: module 'mvsfunc' has no attribute 'Depth'

Last edited by unix; 31st May 2018 at 13:40.
unix is offline   Reply With Quote
Old 31st May 2018, 09:42   #3054  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
Did you try the latest version of mvsfunc? That file of yours doesn't have that function that is being called.
__________________
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 31st May 2018, 10:11   #3055  |  Link
unix
Registered User
 
Join Date: Aug 2015
Posts: 47
Quote:
Originally Posted by Boulder View Post
Did you try the latest version of mvsfunc? That file of yours doesn't have that function that is being called.

You're right, it works now thanx =)
unix is offline   Reply With Quote
Old 31st May 2018, 10:47   #3056  |  Link
unix
Registered User
 
Join Date: Aug 2015
Posts: 47
Guys one more question, I just try to use the portable ver of VSynth


VSynth library paths should direct to python lib or what?

& VP plugins paths should direct to plugins of VSynth (plugins64) right?

Last edited by unix; 31st May 2018 at 21:25.
unix is offline   Reply With Quote
Old 31st May 2018, 13:55   #3057  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,752
No need for bold face.

You mean the "portable" version (without installing Python into the system)?

And again, again, and again (Groundhog day): Prefer external image hosts over attaching images in the forum, because it takes time for a moderator to approve them.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 31st May 2018, 14:55   #3058  |  Link
unix
Registered User
 
Join Date: Aug 2015
Posts: 47
Quote:
Originally Posted by LigH View Post
No need for bold face.

You mean the "portable" version (without installing Python into the system)?

And again, again, and again (Groundhog day): Prefer external image hosts over attaching images in the forum, because it takes time for a moderator to approve them.
I just edited it and yes I mean portable version!

Quote:
because it takes time for a moderator to approve them
I'm happy that you're not one of them.

anyway I think it's better to ask in "VapourSynth Editor" not here.


.

Last edited by unix; 31st May 2018 at 21:34.
unix is offline   Reply With Quote
Old 3rd June 2018, 18:09   #3059  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Anyone got a download link to a up-to-date LSSMashSource dll for 64bit Vapoursynth ?
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 8th June 2018, 15:03   #3060  |  Link
unix
Registered User
 
Join Date: Aug 2015
Posts: 47
I tried to used IVTC but I got an error

script:

Quote:
from vapoursynth import core
import vapoursynth as vs
core = vs.get_core()
src = core.d2v.Source('My.d2v')
src = src.vivtc.VFM().vivtc.VDecimate()
src.set_output()
error:

Quote:
Failed to evaluate the script:
Python exception: VFM: argument order is required

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1830, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:36860)
File "C:/Users/Administrator/Desktop/encoder/Untitled.vpy", line 6, in
src.set_output()
File "src\cython\vapoursynth.pyx", line 1722, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:35000)
vapoursynth.Error: VFM: argument order is required
-VapourSynthEditor-r18-64bit
-VapourSynth-R39
unix 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 12:16.


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