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 8th July 2016, 21:34   #21  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by feisty2 View Post
uhmm, I could compile an x86 binary if you need that, this thing consumes A LOT OF ram, so that probably won't work anyway, you got that 4GB upper limit on x86 programs
well I think that's a bad idea then, my machine has only 16G RAM and my video is 1080
lansing is offline   Reply With Quote
Old 9th July 2016, 02:29   #22  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
I haven't looked at your code, but if it does a lot of temporal filtering, this can be a big time and memory hog, since filters upstream of a temporal filter get called repeatedly (unless they are cached, but in your case the cache is exhausted quickly). This problem really blows up with multiple temporal filters. The same frame could be processed with the same filter dozens of times. You can see this by inserting temporary WriteFile(current_frame) statements. You should be able to save time and memory by splitting the process into parts, with lossless intermediate files, so expensive operations early in the chain only need to get executed once per frame.
raffriff42 is offline   Reply With Quote
Old 19th August 2016, 15:56   #23  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
r4:
strict sanity check in every single function, a lot more user friendly and should be ok to work like any typical module now
added some temporal padding to KNLMeansCL
re-licensed to LGPL v3.0
trivial modifications to the doc
.gitignore
feisty2 is offline   Reply With Quote
Old 22nd August 2016, 14:44   #24  |  Link
WolframRhodium
Registered User
 
Join Date: Jan 2016
Posts: 162
lWhy not use BM3D in cutoff?
And what's your reason for changing from gauss_resample to DFTTest? Maybe because DFTTest is a spatial-temporal filter(while gauss_resample is just a spatial filter) so that it works theoretically better in most cases?

Last edited by WolframRhodium; 22nd August 2016 at 15:46.
WolframRhodium is offline   Reply With Quote
Old 22nd August 2016, 16:20   #25  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by WolframRhodium View Post
lWhy not use BM3D in cutoff?
And what's your reason for changing from gauss_resample to DFTTest? Maybe because DFTTest is a spatial-temporal filter(while gauss_resample is just a spatial filter) so that it works theoretically better in most cases?
there's no "cutoff" parameter in Oyster, I assume your were talking about "lowpass"
"lowpass" works as a noise dumper, it separates components with possibility to carry certain noise from components with no noise at all.
and no, DFTTest here is completely spatial(tbsize=0), I picked it because wiener filter works better than Gaussian blur on noise separation
feisty2 is offline   Reply With Quote
Old 23rd August 2016, 00:26   #26  |  Link
WolframRhodium
Registered User
 
Join Date: Jan 2016
Posts: 162
Quote:
Originally Posted by feisty2 View Post
there's no "cutoff" parameter in Oyster, I assume your were talking about "lowpass"
"lowpass" works as a noise dumper, it separates components with possibility to carry certain noise from components with no noise at all.
and no, DFTTest here is completely spatial(tbsize=0), I picked it because wiener filter works better than Gaussian blur on noise separation
oh that is freq_merge, I confuse it with your other script...
Then you mean using DFTTest in things like freq_merge and gaussian blur in cutoff?
WolframRhodium is offline   Reply With Quote
Old 24th August 2016, 18:08   #27  |  Link
groucho86
Registered User
 
Join Date: Apr 2016
Posts: 85
KNLMeansCL fatal error

Hey feisty2 , I'm not sure if this is a graphics card issue, lack of RAM or something else.

My source file is ProRes 422HQ.

I'm trying to run the following code:
Code:
import vapoursynth as vs
import havsfunc as haf
import mvsfunc as mvf
import mvmulti
import Oyster

core = vs.get_core()

core.std.LoadPlugin("/usr/local/lib/libmvtoolssf.dylib")
core.std.LoadPlugin("/usr/local/lib/libfmtconv.dylib")
core.std.LoadPlugin("/usr/local/lib/libscenechange.dylib")
core.std.LoadPlugin("/usr/local/lib/libtemporalsoften2.dylib")
core.std.LoadPlugin("/usr/local/lib/libffms2.4.dylib")


clip = core.lsmas.LibavSMASHSource(source="/Volumes/OFFLINE/prores422hq.mov")

clip = mvf.ToRGB(input = clip, depth=32)
y = core.std.ShufflePlanes(clip,0,vs.GRAY)

ref = Oyster.Basic(y, Oyster.Super (y))

y = Oyster.Deblocking(y, ref, block_step=2)
y = Oyster.Deringing(clip, ref, sigma=24.0, h=10.8, block_step=2)

clip =  core.std.ShufflePlanes([y,clip], [0,1,2], vs.YUV)

clip.set_output()
VapourSynth Editor returns the following error:
Code:
Failed to evaluate the script:
Python exception: knlm.KNLMeansCL: fatal error!
 (clCreateImage(d.mem_in[0]): CL_IMAGE_FORMAT_NOT_SUPPORTED)
Traceback (most recent call last):
  File "src/cython/vapoursynth.pyx", line 1491, in vapoursynth.vpy_evaluateScript (build/temp.macosx-10.9-x86_64-3.5/pyrex/vapoursynth.c:26897)
  File "/Volumes/VG_SHUTTLE04/oyster01.vpy", line 23, in <module>
    y = Oyster.Deblocking(y, ref, block_step=2)
  File "/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/Oyster.py", line 448, in Deblocking
    lowpass, color, matrix)
  File "/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/Oyster.py", line 193, in deblocking
    cleansed        = helpers.nlmeans(ref, radius, block_size, 4, h, ref, color)
  File "/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/Oyster.py", line 45, in nlmeans
    nlm             = KNLMeansCL(pad, d=d, a=a, s=s, h=h, cmode=color, wref=1.0, rclip=rclip)
  File "src/cython/vapoursynth.pyx", line 1383, in vapoursynth.Function.__call__ (build/temp.macosx-10.9-x86_64-3.5/pyrex/vapoursynth.c:25204)
vapoursynth.Error: knlm.KNLMeansCL: fatal error!
 (clCreateImage(d.mem_in[0]): CL_IMAGE_FORMAT_NOT_SUPPORTED)
My graphics card is an ATI Radeon HD 5770. Not entirely sure if it's supported. I tried downgrading KNLMeansCL to 0.6.11 but the issue persists.

Thank you for your help!
groucho86 is offline   Reply With Quote
Old 24th August 2016, 18:15   #28  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by groucho86 View Post
Hey feisty2 , I'm not sure if this is a graphics card issue, lack of RAM or something else.

My source file is ProRes 422HQ.

I'm trying to run the following code:
Code:
import vapoursynth as vs
import havsfunc as haf
import mvsfunc as mvf
import mvmulti
import Oyster

core = vs.get_core()

core.std.LoadPlugin("/usr/local/lib/libmvtoolssf.dylib")
core.std.LoadPlugin("/usr/local/lib/libfmtconv.dylib")
core.std.LoadPlugin("/usr/local/lib/libscenechange.dylib")
core.std.LoadPlugin("/usr/local/lib/libtemporalsoften2.dylib")
core.std.LoadPlugin("/usr/local/lib/libffms2.4.dylib")


clip = core.lsmas.LibavSMASHSource(source="/Volumes/OFFLINE/prores422hq.mov")

clip = mvf.ToRGB(input = clip, depth=32)
y = core.std.ShufflePlanes(clip,0,vs.GRAY)

ref = Oyster.Basic(y, Oyster.Super (y))

y = Oyster.Deblocking(y, ref, block_step=2)
y = Oyster.Deringing(clip, ref, sigma=24.0, h=10.8, block_step=2)

clip =  core.std.ShufflePlanes([y,clip], [0,1,2], vs.YUV)

clip.set_output()
VapourSynth Editor returns the following error:
Code:
Failed to evaluate the script:
Python exception: knlm.KNLMeansCL: fatal error!
 (clCreateImage(d.mem_in[0]): CL_IMAGE_FORMAT_NOT_SUPPORTED)
Traceback (most recent call last):
  File "src/cython/vapoursynth.pyx", line 1491, in vapoursynth.vpy_evaluateScript (build/temp.macosx-10.9-x86_64-3.5/pyrex/vapoursynth.c:26897)
  File "/Volumes/VG_SHUTTLE04/oyster01.vpy", line 23, in <module>
    y = Oyster.Deblocking(y, ref, block_step=2)
  File "/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/Oyster.py", line 448, in Deblocking
    lowpass, color, matrix)
  File "/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/Oyster.py", line 193, in deblocking
    cleansed        = helpers.nlmeans(ref, radius, block_size, 4, h, ref, color)
  File "/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/Oyster.py", line 45, in nlmeans
    nlm             = KNLMeansCL(pad, d=d, a=a, s=s, h=h, cmode=color, wref=1.0, rclip=rclip)
  File "src/cython/vapoursynth.pyx", line 1383, in vapoursynth.Function.__call__ (build/temp.macosx-10.9-x86_64-3.5/pyrex/vapoursynth.c:25204)
vapoursynth.Error: knlm.KNLMeansCL: fatal error!
 (clCreateImage(d.mem_in[0]): CL_IMAGE_FORMAT_NOT_SUPPORTED)
My graphics card is an ATI Radeon HD 5770. Not entirely sure if it's supported. I tried downgrading KNLMeansCL to 0.6.11 but the issue persists.

Thank you for your help!
are you sure that you need this on ProRes422HQ which is already pretty close to lossless compression...
ProRes422HQ does not produce compression artifacts
feisty2 is offline   Reply With Quote
Old 24th August 2016, 18:26   #29  |  Link
groucho86
Registered User
 
Join Date: Apr 2016
Posts: 85
...If only it were true ProRes 422HQ!

This is for a documentary. I'm dealing with a variety of non-conformed archival elements (Getty, AP, youtube videos, etc.)
My first step usually involves media managing (to ProRes) the assets with 1 second handles using either Resolve or Premiere (maintaining original frame size and frame rate).

From there I use Vapoursynth to convert everything to 1080p23.976.
groucho86 is offline   Reply With Quote
Old 24th August 2016, 18:39   #30  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by groucho86 View Post
...If only it were true ProRes 422HQ!

This is for a documentary. I'm dealing with a variety of non-conformed archival elements (Getty, AP, youtube videos, etc.)
My first step usually involves media managing (to ProRes) the assets with 1 second handles using either Resolve or Premiere (maintaining original frame size and frame rate).

From there I use Vapoursynth to convert everything to 1080p23.976.
okay, first you must not convert it to RGB if it's not native RGB or YCbCr 4:4:4
Quote:
DO NOT upsample your video to YUV 4:4:4 or RGB before processing if it's not natively full-sampled, just pass Y as a gray clip and merge the result with UV from the source clip, low-res chroma will jeopardize the correctness of weight calculation (fatal, especially to NLMeans).
do
Code:
clip = core.fmtc.bitdepth(clip,bits=32,fulls=False,fulld=True)
instead of
Code:
clip = mvf.ToRGB(input = clip, depth=32)
and Radeon HD 5770 is a bit too low-end for Oyster, try something at least like GTX970 or better graphic cards.

edit: I think you forgot to correct maybe something during the copy-paste
try
Code:
clip = core.lsmas.LibavSMASHSource(source="/Volumes/OFFLINE/prores422hq.mov")

clip = core.fmtc.bitdepth(clip,bits=32,fulls=False,fulld=True)
y = core.std.ShufflePlanes(clip,0,vs.GRAY)

ref = Oyster.Basic(y, Oyster.Super (y))

y = Oyster.Deblocking(y, ref, block_step=2)
y = Oyster.Deringing(y, ref, sigma=24.0, h=10.8, block_step=2)

clip =  core.std.ShufflePlanes([y,clip], [0,1,2], vs.YUV)

clip.set_output()

Last edited by feisty2; 24th August 2016 at 18:44.
feisty2 is offline   Reply With Quote
Old 24th August 2016, 18:46   #31  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
and also take a look at #20 if you're then running out of memory..
feisty2 is offline   Reply With Quote
Old 24th August 2016, 19:35   #32  |  Link
groucho86
Registered User
 
Join Date: Apr 2016
Posts: 85
Thank you for your detailed response and for the syntax-example to properly pass Y (I was looking for such an example on the forum and probably copy-pasted from someone who was doing it wrong...)

The "CL_IMAGE_FORMAT_NOT_SUPPORTED" error persists. Not quite sure when I'll be able to test with a better graphics card. When I do, I'll be sure to post the results.

Thanks!
groucho86 is offline   Reply With Quote
Old 5th November 2016, 13:32   #33  |  Link
dipje
Registered User
 
Join Date: Oct 2014
Posts: 268
@groucho86 Are you running that HD5770 with the 'beta' Crimson test drivers for legacy cards instead of the old fashioned 'AMD Catalyst' ?. OpenCL is broken for legacy cards in the Crimson driver so you need the regular Catalyst drivers
dipje is offline   Reply With Quote
Old 7th November 2016, 22:18   #34  |  Link
groucho86
Registered User
 
Join Date: Apr 2016
Posts: 85
Quote:
Originally Posted by dipje View Post
@groucho86 Are you running that HD5770 with the 'beta' Crimson test drivers for legacy cards instead of the old fashioned 'AMD Catalyst' ?. OpenCL is broken for legacy cards in the Crimson driver so you need the regular Catalyst drivers
Interesting. I wasn't even aware there were test drivers available. This was the default drivers that (I assume) come with Mac OS 10.9.5.
groucho86 is offline   Reply With Quote
Old 8th November 2016, 02:31   #35  |  Link
dipje
Registered User
 
Join Date: Oct 2014
Posts: 268
Hmm, I was assuming Windows. No clue how drivers and/or opencl work in macos
dipje is offline   Reply With Quote
Old 29th November 2016, 20:36   #36  |  Link
cork_OS
Registered User
 
cork_OS's Avatar
 
Join Date: Mar 2016
Posts: 160
Deringing samples are very impressive!
cork_OS is offline   Reply With Quote
Old 9th January 2017, 08:28   #37  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
r5:
redid the basic estimation and brought a new parameter "short_time"

short_time
with short_time = True, starts motion estimation at the block size of 8x8 and gradually refines it to 2x2 (optimized for maximum spatial resolution), short_time = False starts motion estimation at 16x16 and gradually refines it to 4x4 (optimized for maximum frequency resolution). short_time = True is meant for Deringing and short_time = False is for Destaircase and Deblocking
edit:typo

Last edited by feisty2; 9th January 2017 at 10:23.
feisty2 is offline   Reply With Quote
Old 6th February 2017, 14:18   #38  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
r6:
redesigned motion estimation when short_time = False (adaptive block size from 128x128 to 4x4)
feisty2 is offline   Reply With Quote
Old 12th February 2017, 22:18   #39  |  Link
bebs
Registered User
 
Join Date: Oct 2015
Location: Switzerland
Posts: 6
Hello,

I tried to use Oyster on a de-interlaced PAL clip (768x576), and it failed with :
Code:
Failed to evaluate the script:
Python exception: BlankClip: color value out of range
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1712, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:34991)
File "C:/Video/Ori/Capture OK/WES-2003/WES 2003.vpy", line 167, in 
y= Oyster.Destaircase(src, ref)
File "C:\Program Files\Python36\lib\site-packages\Oyster.py", line 383, in Destaircase
thr, elast, lowpass, matrix)
File "C:\Program Files\Python36\lib\site-packages\Oyster.py", line 173, in destaircase
mask = core.GenBlockMask(core.ShufflePlanes(src, 0, vs.GRAY))
File "C:\Program Files\Python36\lib\site-packages\Oyster.py", line 89, in GenBlockMask
clip = self.BlankClip(src, 24, 24, color=0.0)
File "src\cython\vapoursynth.pyx", line 1604, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:33131)
vapoursynth.Error: BlankClip: color value out of range
My script is :
Code:
VidBN = core.fmtc.bitdepth(VidBN,bits=32,fulls=False,fulld=True)
y = core.std.ShufflePlanes(VidBN,0,vs.GRAY)
ref = Oyster.Basic(y, Oyster.Super (y))
y= Oyster.Destaircase(y, ref)
VidBN =  core.std.ShufflePlanes([y,VidBN], [0,1,2], vs.YUV)
VidBN.set_output()
What's the problem ?
bebs is offline   Reply With Quote
Old 13th February 2017, 08:27   #40  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by bebs View Post
I tried to use Oyster on a de-interlaced PAL clip (768x576)
PAL should be 720(or probably something less than 720)x576, apply Oyster BEFORE resizing.

and I can't reproduce the error, are you using an outdated version of vaporsynth?
feisty2 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 08:56.


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