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. |
25th May 2015, 10:41 | #161 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
I approve of this insanity. My idea for solving the reading (not tested but works in theory):
Code:
import vapoursynth as vs c = vs.get_core() src = c.ffms2.Source("rule6.avi") superclip = c.mv.Super(src) analysis = c.mv.Analyse(superclip, delta=1, isb=True) vf = open("/stored/vectors.bin") vector_width = analysis.get_frame(0).width vector_template_clip = c.std.BlankClip(analysis, height=1, width=vector_width) def vector_read(n, f): vf.seek(n * f.width) vector_data = vf.read(f.width) fout = f.copy() view = fout.get_write_array(0) for x in range(fout.width): view[0,x] = vector_data[x] return fout vector_clip = c.std.ModifyFrame(clip=vector_template_clip, clips=vector_template_clip, selector=vector_read) vector_clip.set_output()
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet Last edited by Myrsloik; 25th May 2015 at 21:53. Reason: now with tested solution |
25th May 2015, 15:09 | #164 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
line 16 should be:
view = fout.get_write_array(0)
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
25th May 2015, 15:31 | #166 | Link |
Registered User
Join Date: Aug 2012
Posts: 203
|
I humbly suggest to add an extra parameter to vector_read for selecting which file to read from.
Something like Code:
vecFile = "/tmp/vectors.bin" def vector_read(n, f, file): vf= open("file", "rb") vf.seek(n * f.width) # etc... return fout vector_clip = core.std.ModifyFrame(clip=vector_template_clip, clips=vector_template_clip, selector=functools.partial(vector_read, file=vecFile) |
25th May 2015, 21:57 | #168 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
I updated my previous post with a fixed script.
It's basically how you write a raw source filter using only python. Actually you probably could replace most of this with chikuzen's raw source...
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
26th May 2015, 07:25 | #169 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
so I decide to take the easiest way
simply this works Code:
vw = vec.get_frame(0).width vecr=core.raws.Source(r"D:\test\vectors.bin", vw, 1, src_fmt="Y8") vecr.set_output() writing part vw = vec.get_frame(0).width log = open(r"D:\test\log.txt", "w").write (repr (vw)) reading part w=int (open(r"D:\test\log.txt", "r").read ()) vecr=core.raws.Source(r"D:\test\vectors.bin", w, 1, src_fmt="Y8") vecr.set_output() Last edited by feisty2; 26th May 2015 at 08:30. |
26th May 2015, 09:54 | #172 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
The answer is mostly not but with a bit of yes. Some formats can have +-1 differences due to rounding I think. Try it with something lossless like utvideo or huffyuv as input and see if it's still different.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
26th May 2015, 10:48 | #173 | Link | |
unsigned int
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
|
Quote:
Edit: Nevermind. I think it's just a little unused memory that never gets initialised.
__________________
Buy me a "coffee" and/or hire me to write code! Last edited by jackoneill; 26th May 2015 at 11:15. |
|
29th May 2015, 16:33 | #174 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
Do "thsad" and "thscd1/2" have a varying range related to bit depth like "limit" in mv.degrain or they stay in some fixed certain range (always "400" as default whatever input depth is) ?
Last edited by feisty2; 29th May 2015 at 16:44. |
30th May 2015, 00:49 | #176 | Link |
ангел смерти
Join Date: Nov 2004
Location: Lost
Posts: 9,558
|
I'm convinced this is the proper mode of operations for all filters, which should take fractional values instead of requiring the user to know what bit depth they're in anytime a filter is called. I'm glad havs does the heavy lifting for the filters that don't scale input. (Although it's going to have to be done all over again for anything that wants 0...1.0 in float. rean has the right idea there.)
|
17th June 2015, 05:42 | #179 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
okay then, how do I make all this work, like how, should I modify the cpp code to add support for float point clips? a short and simple guide like that "python removegrain19", can I ask for one plz?
I been running from C/CPP like, forever, cuz they are obscure and simply look like machine code to me, and I've always favored stuff easier like python or that "home grown avisynth language" but that's officially over now, guess it's just, well, time to face the devil finally. |
17th June 2015, 07:30 | #180 | Link | |
unsigned int
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
|
Quote:
__________________
Buy me a "coffee" and/or hire me to write code! |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|