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. |
24th February 2019, 08:05 | #3261 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
It's probably some filter with a memory leak.
Memory consumption doesn't run amok here when using 'QTGMC(Input=clip, Preset="Fast", TFF=True, opencl=True)', stays at around 4.3GB for Blu-ray content. What QTGMC setting do you use? Cu Selur |
24th February 2019, 20:37 | #3262 | Link |
Registered User
Join Date: May 2011
Posts: 321
|
Just Preset = "Slow"and TFF=True, but I am not complaining because I test things on my laptops which have ridiculous 4GB RAM. On the contrary by limiting RAM I am surprised that it works. Mostly there is about 1GB available for Vapoursynth. Sure performance is perhaps severely limited. Not sure now about workstation, but anyway for all scripts I limit RAM usage first, checking how much is available and setting available cache as a rule. So I might not even know, if RAM was leaking somewhere. I do not know how much control can Vapoursynth have above all those DLL's out there. Scripts are not crashing so I gather it kind of works.
Last edited by _Al_; 24th February 2019 at 20:39. |
25th February 2019, 16:17 | #3263 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
I can't reproduce on x64 after 10 min . It just hovers around 1.2-1.3 GB RAM . Does not have characteristics of a memory leak Maybe a problem with one of your plugin/filter dependencies ? |
|
2nd March 2019, 19:06 | #3264 | Link |
Registered User
Join Date: May 2011
Posts: 321
|
There might be, I'm also one version behind with Vapoursyth and Python 3.6. Simple script to deinterlace avchd.M2TS with about 1GB available, it takes about couple of seconds to freeze. If cache is limited, no problem.
Code:
file = r'C:\vid\avchd.M2TS' from vapoursynth import core import havsfunc as haf #core.max_cache_size = 800 #this works clip = core.lsmas.LWLibavSource(file) clip = haf.QTGMC(clip, Preset='Slow', TFF=True) clip.set_output() |
2nd March 2019, 20:27 | #3265 | Link | |
Registered User
Join Date: May 2005
Posts: 1,462
|
Quote:
No memory leaks here on my end whatsoever. And I use QTGMC on a daily basis. P.S. I see you're using 'opencl=True'. Interesting. Shouldn't be needed when you have 'Denoiser="KNLMeansCL"' in the parameters, though, right? Or does it something else too?
__________________
Gorgeous, delicious, deculture! |
|
2nd March 2019, 22:29 | #3266 | Link | ||
unsigned int
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
|
Quote:
Quote:
(The default max_cache_size is 4 GB on 64 bit systems and 1 GB on 32 bit systems.)
__________________
Buy me a "coffee" and/or hire me to write code! |
||
3rd March 2019, 09:04 | #3268 | Link | |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
Quote:
|
|
3rd March 2019, 11:43 | #3269 | Link | |
Registered User
Join Date: May 2005
Posts: 1,462
|
Quote:
__________________
Gorgeous, delicious, deculture! |
|
4th March 2019, 15:40 | #3271 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
One way is to append a path in python in your script:
Code:
scriptPath = os.getcwd() + "/../scripts" sys.path.append(os.path.abspath(scriptPath)) If you're using a python embedded zip you can set a path in python37._pth
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
4th March 2019, 16:08 | #3272 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,361
|
I'm unable to load them, my scripts are in "C:\Program Files (x86)\VapourSynth_R45(x64)\vapoursynth64\scripts"
so I write in python37._pth the following. Code:
vapoursynth64\scripts Scripts Lib\site-packages python37.zip . # Uncomment to run site.main() automatically #import site Code:
import vapoursynth as vs import havsfunc as haf core = vs.get_core() clip = core.ffms2.Source(r'D:\source.mp4') clip = core.haf.SMDegrain(clip) clip.set_output() Edit2: Ok, ok, it's clip = haf.SMDegrain(clip) without the core. Last edited by Dogway; 4th March 2019 at 16:13. |
4th March 2019, 16:54 | #3273 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
And where is your python installation located? Have you tried with a full path?
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database Last edited by ChaosKing; 4th March 2019 at 17:30. |
4th March 2019, 17:27 | #3274 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,361
|
It's inside VapourSynth_R45(x64), embedded. It worked I just had to omit the core. namespace.
Too bad I didn't find your fatpack earlier, should be sticky. I will probably change to that once you update it to 2019 version. I have a question though. When you load avisynth plugins or scripts into VapourSynth, will the performance be limited to that of avisynth or you get the benefits of better VS multithreading? |
4th March 2019, 17:34 | #3275 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
Depends on the plugin. You will often see a msg with something like using slow method blah blah. Solution: use avsw.Eval() instead.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
13th March 2019, 11:36 | #3276 | Link |
Registered User
Join Date: May 2005
Posts: 1,462
|
Odd. I have a source file of 624x354. But getting the following returned:
... line 3159, in MCTemporalDenoise return core.std.Crop(smP, **crop_args) File "src\cython\vapoursynth.pyx", line 1833, in vapoursynth.Function.__call__ vapoursynth.Error: Crop: cropped area needs to have mod 2 height offset Wait, 354 is mod2, right?! Or am I going crazy?
__________________
Gorgeous, delicious, deculture! |
13th March 2019, 11:38 | #3277 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
13th March 2019, 11:47 | #3278 | Link | |
Registered User
Join Date: May 2005
Posts: 1,462
|
Quote:
Since this pertains to a pre-cropped area of a larger, 1080p source (so I can 'Oyster' it in several parts), I tried a 356 swatch, which didn't generate the error. So, I'll just go with that (it's mainly an overscan area anyway, as I only need a 346 height).
__________________
Gorgeous, delicious, deculture! |
|
14th March 2019, 22:07 | #3279 | Link |
Registered User
Join Date: May 2011
Posts: 321
|
Encoding using clip.output() right from vapoursynth script itself, where input video is ANY anamorphic video like HDV camcorder M2T video or NTSC DV or VOB gives jagged lines. As soon as there is resize involved , say to square pixel it is OK. If some odd resize is given , say 1000,600, again it might fail and jagged lines appear. That is not that important though because square pixel , resize to 16:9 (M2T video) or 4:3 (DVavi, VOB) seem to work. It encodes alright. Point is, without resize, just using SAR flag in encoder, gives jagged lines as presented in attachment.
Interlacing seem have nothing to do with it, using QTGMC or even assuming it as progressive using setFrameProp would not help. This behavior is also same using different source plugins. Code:
import vapoursynth as vs from vapoursynth import core d2v_file = r"path to file ..." clip = core.d2v.Source(d2v_file) #sourse was mpeg2 HDV camcorder video import subprocess import shutil output = r'F:/Destination/test.264' x264 = shutil.which('x264') x264_cmd = [x264, '--frames', f'{len(clip)}', '--input-csp', 'i420', '--demuxer', 'raw', '--sar', '4:3', '--input-depth', '8', '--input-res', f'{clip.width}x{clip.height}', '--fps', f'{clip.fps_num}/{clip.fps_den}', '--crf', '18', '--colorprim', 'bt709', '--transfer', 'bt709', '--colormatrix', 'bt709', '--output', output, '-'] process = subprocess.Popen(x264_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE) clip.output(process.stdin) process.communicate() Code:
x265_cmd = [x265, '--frames', f'{len(clip)}', #'--input-csp', 'i420', '--y4m', '--input-depth', f'{clip.format.bits_per_sample}', '--output-depth', f'{clip.format.bits_per_sample}', '--input-res', f'{clip.width}x{clip.height}', '--fps', f'{clip.fps_num}/{clip.fps_den}', '--crf', f'{str(crf)}', '--output', output, '-'] process = subprocess.Popen(x265_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE) clip.output(process.stdin, y4m = True, progress_update=progressupdate) process.communicate() Last edited by _Al_; 14th March 2019 at 22:34. |
15th March 2019, 07:00 | #3280 | Link |
Registered User
Join Date: May 2011
Posts: 321
|
I might found a culprit, but not sure what to do with it or how to fix it.
for example NTSC video there is 1 byte per sample, if I get_stride for all three planes: f = clip.get_frame(0) print(f.get_stride(0),f.get_stride(1),f.get_stride(2)) I get: 736 384 384 (expected: 720 360 360) for HDV video from HDV tape camcorder (shooting 1440x1080) I get: 1440 736 736 (expected: 1440 720 720) after resize I get even values, like resizing NTSC video to 640x480 I'd get: 640 320 320 or resizing that HDV video to 1920x1080, I'd get: 1920 960 960 Those are expected numbers and encoding is also ok, so this looks like a cause to offset the output if resizing is not done. If I resize to the same resolution values stay the same, it would not help. Is there any way to get those values even without resizing? What are those data that are trailing (or preceding) each line in plane array? If it is not stride itself (wrong value) that offsets things. Last edited by _Al_; 15th March 2019 at 07:45. |
Tags |
speed, vaporware, vapoursynth |
|
|