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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th October 2013, 22:53   #61  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Got it. The sum of the integer coefficients was sometimes off by 1 or 2 units. The bug is now fixed and the change will be available in the next release.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 18th November 2013, 18:55   #62  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
Wouldn't build until I included <algorithm> in all sources with min/max.
Wouldn't build with MinGW at all.
__________________
...desu!
Mystery Keeper is offline   Reply With Quote
Old 18th November 2013, 19:40   #63  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
It builds fine with clang/gcc http://forum.doom9.org/showpost.php?...0&postcount=53
Are_ is offline   Reply With Quote
Old 27th November 2013, 17:51   #64  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
fmtconv r7: Warning—I left an important bug in the resizer, you’d better wait for the next version.
  • 64-bit version for Windows
  • resample: A few optimizations for special cases.
  • resample: fixed the coefficients used in integer resizing, whose sum was sometimes off by a few units.
  • Should compile with MinGW
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding

Last edited by cretindesalpes; 30th November 2013 at 10:21.
cretindesalpes is offline   Reply With Quote
Old 29th November 2013, 02:12   #65  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
This script
Code:
from __future__ import print_function

vapoursyth_plugins_path = 'E:\\vapoursynth-plugins\\x64\\'
import vapoursynth as vs
import sys
sys.path.append(vapoursyth_plugins_path + 'E:\\vapoursynth-plugins\\py\\')
core = vs.get_core(threads=8)

core.set_max_cache_size(16000)

import os
for filename in os.listdir(vapoursyth_plugins_path):
	if filename[-4:] != '.dll':
		continue
	try:
		core.std.LoadPlugin(vapoursyth_plugins_path + filename)
	except Exception as e:
		print("Error: ", e, end='\n', file=sys.stderr)

core.std.LoadPlugin(path = 'D:\\Programming\\TempLinearApproximate-VapourSynth\\build\\release-x64\\templinearapproximate.dll')

#fun = core.list_functions()
#print(fun, end='\n', file=sys.stderr)

d2vfile = 'F:\\Video to Process\\Riaru Onigokko 2\\VTS_01_1.d2v'

ret = core.d2v.Source(input=d2vfile)

ret = core.vivtc.VFM(ret, order=1, mode=5)
ret = core.vivtc.VDecimate(ret)

def tvToPC(input):
	c = core.fmtc.resample (clip=input, css="444")
	c = core.fmtc.matrix (clip=c, mats="601", matd="709")
	c = core.fmtc.resample (clip=c, css="420")
	c = core.fmtc.bitdepth (clip=c, bits=8)
	return c

z = ret
#z = tvToPC(z)

ret = tvToPC(ret)

diff = core.std.MakeDiff(z, ret)
line1 = core.std.StackHorizontal([z, ret])
line2 = core.std.StackHorizontal([diff, ret])
compare = core.std.StackVertical([line1, line2])
compare.set_output()
gives this output



I've also managed to crash VirtualDub with this crash report.
__________________
...desu!
Mystery Keeper is offline   Reply With Quote
Old 30th November 2013, 12:15   #66  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
ftmconv r8:
  • resample: fixed bugs introduced in r7.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 30th November 2013, 13:06   #67  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
'Tis fixed. Thank you!
__________________
...desu!
Mystery Keeper is offline   Reply With Quote
Old 25th February 2014, 04:53   #68  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
I wanted to convert color space from YV12 to RGB to load some Virtualdub filters, and I'm getting the error "VFW module doesn't support RGB24 output". How should I do this?

Code:
ret = core.fmtc.resample (ret, css='444')
ret = core.fmtc.matrix (ret, mats="709", col_fam=vs.RGB)
ret = core.fmtc.bitdepth (ret, bits=8)
lansing is offline   Reply With Quote
Old 25th February 2014, 16:48   #69  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by HolyWu View Post
I guess it only accepts RGBs in interleaved format
which one are you referring to? fmtconv or virtualdub?
lansing is offline   Reply With Quote
Old 15th May 2014, 08:21   #70  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Is the internal threading of any use when VapourSynth runs filters in parallel? Or is it simply a leftover from Dither?
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 21st May 2014, 08:07   #71  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Yes it is more or less a leftover from Dither, because I want to keep the same base code to backport it from fmtconv to Dither later. It should be harmless anyway.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 2nd August 2014, 14:12   #72  |  Link
alexxdls
Registered User
 
Join Date: Nov 2013
Posts: 26
Code:
import vapoursynth as vs
core = vs.get_core()
import os
ext = '.png'
dir = r'PNG/'
srcs = [dir + src for src in os.listdir(dir) if src.endswith(ext)]
v = core.imgr.Read(srcs,24,1)
v = core.fmtc.matrix(v, mat="709", col_fam=vs.YUV, bits=16, fulls=1, fulld=1)
v = core.fmtc.bitdepth(v, bits=10, dmode=1)
enable_v210=True
v.set_output()
Code:
Failed to evaluate the script:
Python exception: matrix: only constant pixel formats are supported.
Traceback (most recent call last):
  File "vapoursynth.pyx", line 1148, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:18441)
  File "D:/TRAILERS/DCP/MOCKINGJAY-PT1_TLR-1_S_RU-XX_RU_51_2K_LION_20140729_DLA_IOP_OV/myVapourScript.vpy", line 8, in <module>
    v = core.fmtc.matrix(v, mat="709", col_fam=vs.YUV, bits=16, fulls=1, fulld=1)
  File "vapoursynth.pyx", line 1071, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:17443)
vapoursynth.Error: matrix: only constant pixel formats are supported.
alexxdls is offline   Reply With Quote
Old 12th February 2015, 14:27   #73  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
In the documentation of dither for avs there is a very handy quick explanation of what a dithering algo is good for.
I used to use the stucki error diffusion because seemed the best of the list.
In the vs version you added two new algos: Sierra-2-4A error diffusion and Ostromoukhov error diffusion.

Can you please give me a quick explanation like the ones on the avs doc??
MonoS is offline   Reply With Quote
Old 12th February 2015, 16:28   #74  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Sierra-2-4A is comparable to Floyd-Steinberg, but slightly faster.

Ostromoukhov helps fighting the artefacts seen on Floyd-Steinberg, giving more homogenous flat areas. See also: A Simple and Efficient Error-Diffusion Algorithm
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 14th February 2015, 16:55   #75  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
Ok thanks, i read the article [even i didn't understood it very well], i even tried to make a 2bit image to compare stucki and ostromoukhov, but vs doesn't allow me to output 2bit image afaik.

Then i tried to see the difference between the different ED methods and i was unable to see any difference in the LSB, but very little in the MSB [on a 16bit image decomposed using nativetostack16, with 8bit image i didn't saw any difference at all].

Probably i made my tests in an erroneous way, so i'd like to know your opinion if the difference are really so unnoticeable or very little differences can make an image looks better

I used this script for my tests and the first two exr frames from BBB
Code:
src = core.imwri.Read("C:/Users/MonoS/Desktop/%04d.exr", firstnum=1).fmtc.bitdepth(flt=1)

yuv = core.fmtc.matrix(src, mats="RGB", matd="709", bits=32, col_fam=vs.YUV)

core.std.MakeDiff(core.fmtc.bitdepth(yuv, flt=0, bits=16, dmode=7, fulls=False, fulld=False).fmtc.nativetostack16(),\
 core.fmtc.bitdepth(yuv, flt=0, bits=16, dmode=4, fulls=False, fulld=False).fmtc.nativetostack16()).set_output()
MonoS is offline   Reply With Quote
Old 14th February 2015, 18:19   #76  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
You are trying to dither floating point data to 16 bits, the difference between dithering methods will be insignificant. Actually I don’t even bother dithering when converting down to 16 bits. If you want to see the difference, dither to 8 bits. And even at 8 bits, it will be quite hard to spot any quality difference. Only Bayer dithering can really stand out on low-res pictures because of its specific pattern.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 14th February 2015, 19:16   #77  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Try something like this:
Code:
import vapoursynth as vs

c = vs.get_core()

c.std.LoadPlugin(".libs/vszimg.so")

shades = []

fmt = c.register_format(color_family=vs.RGB, sample_type=vs.INTEGER, bits_per_sample=14, subsampling_w=0, subsampling_h=0)

for i in range(1200):
    shades.append(c.std.BlankClip(width=1, height=120, format=fmt.id, color=[i] * 3, length=1))

src = c.std.StackHorizontal(shades)

none = c.z.Depth(src, depth=8, dither="none").text.Text("none")
ordered = c.z.Depth(src, depth=8, dither="ordered").text.Text("ordered")
random = c.z.Depth(src, depth=8, dither="random").text.Text("random")
ed = c.z.Depth(src, depth=8, dither="error_diffusion").text.Text("error diffusion")

src = c.std.StackVertical([none, ordered, random, ed])

src.set_output()
With some minor changes, you can replace z.Depth with fmtc.bitdepth. The differences between the dithering methods will be visible.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 14th February 2015, 19:19   #78  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
Quote:
Originally Posted by cretindesalpes View Post
You are trying to dither floating point data to 16 bits, the difference between dithering methods will be insignificant. Actually I don’t even bother dithering when converting down to 16 bits. If you want to see the difference, dither to 8 bits. And even at 8 bits, it will be quite hard to spot any quality difference. Only Bayer dithering can really stand out on low-res pictures because of its specific pattern.
At least with BBB i saw no difference at all using 8bit, so i preferred comparing the 16bit version [redoing it using hist.Luma i can see some differences].

So in the end, if i understood correctly, it's better to use a compression resilient algo if i really need to dither down and only for 8bit output [but i usually pipe the 16bit video directly to x264/5], at 16bit differences are almost unnoticeable and i can use the one i like most.

If so, why bother implementing 7 different algos??
MonoS is offline   Reply With Quote
Old 14th February 2015, 19:50   #79  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
Thanks jackoneill, i was able to see some difference between the different algos, my favorite remain the stucki ED, it seems pretty similar to Ostromoukhov and Sierra 2-4A, but stucki seemed to be a bit more random in adding dithering and maybe is a plus, the other ones seemed to generate some artifact [like the worm like "artifact" of Atkinson].

Are my observation right in some sense??
MonoS is offline   Reply With Quote
Old 7th March 2015, 14:58   #80  |  Link
metyo
Registered User
 
Join Date: Feb 2015
Posts: 8
interlocked:181 assertion failed

Hi everybody,
I made a fresh install to try the vapoursynth plus HAvsFunc.
the compiling from git was success.
When i try to use the fmtc functions it gives Assertion failed:

vspipe --y4m zod.vpy - | ffplay -i pipe:
-----
vspipe: ./conc/Interlocked.hpp:181: static int64_t conc::Interlocked::cas(volatile int64_t&, int64_t, int64_t): Assertion `is_ptr_aligned_nz (&dest)' failed
----

archlinux 32bit, ubuntu 32bit as well

my script is simple :
-----------------------------------
import vapoursynth as vs
core = vs.get_core()
c = core.std.BlankClip(width=100, height=200, format=vs.YUV420P8, color=[64, 64, 64])
c = core.fmtc.resample(c, w=100, h=100)
c.set_output()
------------------------------

when I leave the original size :
c = core.fmtc.resample(c, w=100, h=200)
I see the green box


what can I miss ?

thanx -- metyo

/* EDIT : AchLinux x86_64 , packages from AUR everything works ok ! thank sl1pkn07 for maintaning */

Last edited by metyo; 16th March 2015 at 21:43.
metyo is offline   Reply With Quote
Reply


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 18:27.


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