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. |
![]() |
#2501 | Link | |
Registered User
Join Date: Aug 2016
Posts: 516
|
Quote:
|
|
![]() |
![]() |
![]() |
#2502 | Link | |
Registered User
Join Date: Oct 2018
Location: Germany
Posts: 918
|
Quote:
With the previous one I had to put a ConvertBits(8) in front. Thanks for the new version! A big improvement would be if the mod 64 could be scaled down. I have a new Pre-Release that works with both DLL versions. https://drive.google.com/drive/folde...usp=share_link
__________________
Live and let live |
|
![]() |
![]() |
![]() |
#2503 | Link |
Registered User
Join Date: Jul 2018
Posts: 980
|
Here is attempt to process all widths - https://github.com/DTL2020/ConvertYU...ases/tag/0.3.1
It looks with 64 samples per pass it is not compatible with max mod64 bytes rows strides ? So the last columns up to 63 are processed with simple C-scalar program. At UHD frame 3840+60 width and at i3-9100T CPU it looks not add significant penalty - 3840 width 313 fps 3840+60 width 308 fps. It is not tested with all possible frame widths so some bugs may happen. "the new version runs faster even with YUV420P16 than the previous one with only YUV420P8. " From ver 0.3.0 I set cs default to false as I see it typically make storing data faster and users may be lazy to test best setting of true/false at current host. Last edited by DTL; 21st May 2023 at 15:04. |
![]() |
![]() |
![]() |
#2504 | Link | |
Registered User
Join Date: Oct 2018
Location: Germany
Posts: 918
|
Quote:
Tried all dimensions and no error received so far. 4K ColorBar YUV420P10 with AvsPmod 'Resample Filter' and option 'Prefetch display conversion' resized to 1980 x 1080 runs in playback with ~153 fps shrunk to 1280 x 720 it is ~189 fps ColorBar 1920 x 1080 YUV420P10 ~196 fps in the playback with display drawing. I've spent a few hours optimizing everything, at least it was worth it. Thanks!
__________________
Live and let live Last edited by gispos; 21st May 2023 at 21:00. |
|
![]() |
![]() |
![]() |
#2505 | Link | ||
Registered User
Join Date: Aug 2016
Posts: 516
|
Quote:
So I am stuck with a huge memory leak - around 2MB/sec in my case ![]() Is there perhaps some way to manually "clear the string heap"? |
||
![]() |
![]() |
![]() |
#2506 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,807
|
Quote:
What are you trying to do, post what you attempted. EDIT: You can still use globals even when Local = true. Must use eg Code:
Global SomeVar = WhateverVar (You are calcing current frame, based on previous frame, which is also based on frame before it, etc. Not possible to just "throw away" prev temp frames as re-seek requires every frame before it to be available.) EDIT: I have tried many times (and find hard to accept the futility) to try find solution for what it is I think that you are trying to do, even this attempt at solution failed. FrameStore v0.03 - Avs+ x86/x64 - 15 Jan 2019 https://forum.doom9.org/showthread.php?t=175212
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 27th May 2023 at 13:08. |
|
![]() |
![]() |
![]() |
#2507 | Link |
Registered User
Join Date: Aug 2016
Posts: 516
|
This is leaking around 1.3MB/sec for 30fps video on my system (too big to paste on forum): https://pastebin.com/raw/pKfBJ26Q
This however produces no leak: https://pastebin.com/raw/PGWtzubz But it won't allow runtime funcs like this: Code:
ScriptClip( last, \ function [] (c) { diff = YDifferenceToNext(c, -1) # requires local=true, else error message c } , after_frame=true, local=false) Code:
global PrevFrameNumber = 0 ScriptClip( last, \ function [] (c) { global PrevFrameNumber = PrevFrameNumber + 1 # doesn't work, just stays at 1 c.SubTitle(String(PrevFrameNumber)) } , after_frame=true, local=true) |
![]() |
![]() |
![]() |
#2508 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,807
|
Sorry, I aint got a clue about that new fangled "Function [] (c)" stuff, old dog and new trick thingy.
Quote:
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
|
![]() |
![]() |
![]() |
#2509 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,807
|
Is this what you are tryin' to do with that there new fangled stuff ?
Code:
/* ScriptClip( last, \ function [] (c) { # EDIT: "Plane Difference: this filter can only be used within run-time filters. diff = YDifferenceToNext(c, -1) # requires local=true, else error message c } , after_frame=true, local=false) */ Colorbars.Killaudio.ConvertToYV12 Function func(clip c) { diff = YDifferenceToNext(c, -1) # EDIT: Works. Does NOT require local=true c.Subtitle(String(diff)) } SSS = """ func() """ ScriptClip( SSS , after_frame=true, local=false) Code:
/* ScriptClip( last, function [] (c) { global PrevFrameNumber = PrevFrameNumber + 1 # doesn't work, just stays at 1 c.SubTitle(String(PrevFrameNumber)) } , after_frame=true, local=true) */ Colorbars.Killaudio.ConvertToYV12 Global PrevFrameNumber = 0 Function func(clip c) { Global PrevFrameNumber = PrevFrameNumber + 1 # EDIT: Works, Does NOT stay at 1 c.SubTitle(String(PrevFrameNumber)) } SSS = """ func() """ ScriptClip( SSS , after_frame=true, local=true)
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 27th May 2023 at 18:50. |
![]() |
![]() |
![]() |
#2510 | Link |
Registered User
Join Date: Oct 2021
Posts: 21
|
Code:
path = "C:\Video\" v0 = FFmpegSource(path + "video.mp4") v1 = ImageSource(path + "Colors Gradient Horizontal 1920x1080.jpg", fps=50, end = 299).crop(0,980,0,0) v2 = ImageSource(path + "BW Gradient Horizontal 1920x1080.jpg", fps=50, end = 299).crop(0,980,0,0) StackVertical(v0, v1, v2) How do i make it work? Source files https://www.upload.ee/files/15277223/video.zip.html |
![]() |
![]() |
![]() |
#2512 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,664
|
Easy peasy lemon squeezy: a simple Converttoyv12() after you index the images will do it.
![]() Code:
FFMPEGSource2("D:\video\video.mp4", fpsnum=50000, fpsden=1000, atrack=-1) img1=ImageSource("D:\video\Colors Gradient Horizontal 1920x1080.jpg", fps=50, end=212).crop(0, 980, 0, 0).Converttoyv12() img2=ImageSource("D:\video\BW Gradient Horizontal 1920x1080.jpg", fps=50, end=212).crop(0, 980, 0, 0).Converttoyv12() StackVertical(last, img1, img2) ![]() Explanation: when you stack together different clips, they must all be the same, so you need to convert either the original video file you're indexing to reflect the two jpg you're trying to add on OR the other way around. In the example, I've done the opposite, so I've converted the two images to yv12 (4:2:0 planar 8bit). I can now shut down my computer and go to bed :P |
![]() |
![]() |
![]() |
#2513 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,807
|
Quote:
EDIT: Re-checked and both do work OK here. Perhaps others with either version could verify results.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 28th May 2023 at 05:43. |
|
![]() |
![]() |
![]() |
#2514 | Link | |
Registered User
Join Date: Aug 2016
Posts: 516
|
Quote:
Code:
global count = 0 ScriptClip(last, "MyFunc(last, current_frame)", after_frame=true, local=false) function MyFunc(clip c, int current_frame) { global count = count + 1 diff = YDifferenceToNext(c, -1) c.SubTitle(string(diff) + ", " + string(count)) } Hopefully there is no other weird side effect of doing it this way, but I've got a feeling it's going to be weird about something. |
|
![]() |
![]() |
![]() |
#2515 | Link | ||
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,807
|
Also, the first of the scripts [works for me, not for you], kinda surprised me,
I was under the impression that current_frame did not survive when calling a function, stangely it worked for me in that script where I might have expected it not to. [perhaps something strange in the version I'm currently using]. Quote:
https://forum.doom9.org/showthread.p...42#post1986042 Quote:
Code:
Function SomeFunc(clip c, int current_frame)
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 28th May 2023 at 11:32. |
||
![]() |
![]() |
![]() |
#2516 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,430
|
Quote:
In GRunT (unlike vanilla Avisynth 2.x), current_frame is a global variable (though still of course only visible inside the run-time environment). Avs+ has incorporated some functions of GRunT, but I'm not sure if this one applies there. |
|
![]() |
![]() |
![]() |
#2517 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,807
|
Quote:
1st script produces error report. 2nd script, shows subtitle '1' for all frames. Cheers Gavin. [nice Welsh name].
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
|
![]() |
![]() |
![]() |
#2518 | Link |
Registered User
Join Date: Jul 2018
Posts: 980
|
Made new version of converter to RGB32 - https://github.com/DTL2020/ConvertYU...ases/tag/0.4.0
It is finally more correct processing in 16bit intermediates and in narrow range the resudual error only about +1LSB. After gained to Full range - at some colours may reach error of 2LSB. Also when compared to ConvertToRGB32(matrix="PC.709") it was found that matrix (coefficients ?) in AVS core is somehow broken: At script: Code:
ColorBarsHD(640, 480, pixel_type="YV24") ConvertToYV12() ConvertToRGB32(chromaresample="point", matrix="PC.709") Yellow 181, 180, 12 Cyan 12, 181, 180 Green 13, 181, 12 Magenta 183, 15, 184 Red 184, 15, 16 Blue 15, 16, 184 The DecodeYUVtoRGB with narrow range mapping (gain=64 and offset=16) keep output in 15..17 and 179..181 range. It was found with math simulation the 8bit YUV can not be decoded to ideal 16 and 180 RGB at all colours because or already rounding errors in 8bit YUV. So only with 10bit and more it can be reach ideal 16 and 180 levels output. Also added 32bit immediates processing mode - it run 2+ times slower at AVX2 and provide only slightly better precision in the Full range mapping (error looks like +-1LSB). And close to no better in narrow range. So it looks 32bit immediate processing only required for >8bit sources and results. And can make a bit better precision with 8bit output only if input is >8bit. For some possible future of fastest 16bit immediate processing engine for YV12 to RGB32 it is possible to play with coefficients tweaking and rounders tweaking and may be reduce average error over all possible range of YUV input 8bit values - using some math simulator engine. But it require programmer of such optimizing engine. Also added x86_32 build if someone still use 32bit Windows. It runs only slightly slower (register file size in 32bit CPU mode is 1/2 of size and compiler make more data temporal store/load from cache). Last edited by DTL; 28th May 2023 at 23:31. |
![]() |
![]() |
![]() |
#2520 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,258
|
Note that "PC matrices" are not quite the same thing as "Studio RGB", or "limited range RGB" used in broadcast or some NLE's
The equivalent way in avisynth as what's used a Studio RGB NLE (like vegas) for 8bit for that example above would be Code:
ColorBarsHD(640, 480, pixel_type="YV24") ConvertToYV12() Levels(0,1,255,16,235, coring=false) ConvertToRGB32(chromaresample="point", matrix="rec709") C 16,181,179 G 16,179,14 M 179,16,181 R 180,16,17 B 15,16,180 There was an old dedicated "studio RGB" function by "trevlac" for avisynth EDIT: It should be coring=false . Limiting (for example 0,255) is separate . Nominal Black to white is defined as 16 to 235 for studio RGB, but you can have superblack, superwhite . If you clip it in the levels (coring=true), you never get superblack or superwhite Last edited by poisondeathray; 31st May 2023 at 05:10. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|