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 > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th June 2019, 20:40   #4721  |  Link
LouieChuckyMerry
Registered User
 
LouieChuckyMerry's Avatar
 
Join Date: Feb 2014
Posts: 311
Quote:
Originally Posted by Zetti View Post
LouieChuckyMerry is offline   Reply With Quote
Old 19th June 2019, 14:28   #4722  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 1,769
converttoyv24, converttoyv16, converttoyv12, converttoy8 don't do quite what they claim, in that they don't alter the bit depth (the 24 and 8 indicating how many bits per pixel). Deliberately confusing, or confusingly accidental?
__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 19th June 2019 at 14:49.
wonkey_monkey is offline   Reply With Quote
Old 19th June 2019, 14:42   #4723  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 877
Quote:
Originally Posted by wonkey_monkey View Post
converttoyv24, converttoyv16, and converttoyv12 don't do quite what they claim, in that they don't alter the bit depth (the 24 and 8 indicating how many bits per pixel). Deliberately confusing, or confusingly accidental?
You can unconfuse yourself here http://avisynth.nl/index.php/Convert
ChaosKing is offline   Reply With Quote
Old 19th June 2019, 14:50   #4724  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,218
Quote:
Originally Posted by wonkey_monkey View Post
converttoyv24, converttoyv16, and converttoyv12 don't do quite what they claim, in that they don't alter the bit depth (the 24 and 8 indicating how many bits per pixel). Deliberately confusing, or confusingly accidental?
Perhaps once it did then from one point it didn't, when it was mapped directly to ConvertToYUV420 (and ...422, ...444). It should throw an error for non-8 bit colorspaces.
pinterf is offline   Reply With Quote
Old 19th June 2019, 14:56   #4725  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 1,769
Quote:
Originally Posted by ChaosKing View Post
You can unconfuse yourself here http://avisynth.nl/index.php/Convert
Nope, still just as confusing. Nothing on the page indicates whether a change in bit depth should be expected or not with those functions. I've also added converttoy8 to the list, as you really shouldn't expect this after using it:


Quote:
Originally Posted by pinterf View Post
Perhaps once it did then from one point it didn't, when it was mapped directly to ConvertToYUV420 (and ...422, ...444). It should throw an error for non-8 bit colorspaces.
converttoyuy2 still does, presumably as it doesn't have a comparable function to be remapped to.
__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 19th June 2019 at 15:18.
wonkey_monkey is offline   Reply With Quote
Old 19th June 2019, 15:20   #4726  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 877
There is also a table if you click on avisynth+ formats http://avisynth.nl/index.php/Avisynthplus_color_formats

As you can see YV12 is a shortcut for YUV420P8. Y10 is Luma channel in 10bit. But yes this shit is confusing and I have to look it up too. What's why I like this notation more YUV420P8.

But I guess it makes a bit more sense with this graphic:

YV12 needs 12bytes for storage. (https://en.wikipedia.org/wiki/YUV)

Last edited by ChaosKing; 19th June 2019 at 15:26.
ChaosKing is offline   Reply With Quote
Old 20th June 2019, 01:46   #4727  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,042
Quote:
Originally Posted by ChaosKing View Post
There is also a table if you click on avisynth+ formats http://avisynth.nl/index.php/Avisynthplus_color_formats

As you can see YV12 is a shortcut for YUV420P8. Y10 is Luma channel in 10bit. But yes this shit is confusing and I have to look it up too. What's why I like this notation more YUV420P8.

But I guess it makes a bit more sense with this graphic:

YV12 needs 12bytes for storage. (https://en.wikipedia.org/wiki/YUV)
The point wonkey_monkey was making was that you can do:
Code:
Version()
ConvertToPlanarRGB()
ConvertBits(10)
ConvertToYV12()
and this results in YUV420P10. Which is not YV12, and trying to use ConvertToYV12 should have errored out in this case.

The reason is, as pinterf noted, the old ConvertTo[Y8|YV12|YV16|YV24] functions from 2.5 (YV12) and 2.6 (the other three) were turned into aliases for the subsampling-oriented ConvertTo[Y|YUV420|YUV422|YUV444] functions when high bit depth support was added in Summer 2016. There aren't individual functions to go directly to X color format @ specified bit depth, apart from the ones for packed RGB (ConvertToRGB[24|A32|48|A64]).

ConvertToYUY2 is still 8-bit-only because YUY2 is a packed format, and there is no support for packed YUV422 formats for >8bit. They literally don't exist in the AviSynth+ source code (the global option OPT_Enable_V210 notwithstanding, but that's a separate thing done on output through Video for Windows only).

Last edited by qyot27; 20th June 2019 at 01:51.
qyot27 is offline   Reply With Quote
Old 20th June 2019, 22:52   #4728  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 1,769
Deleted because I solved it. It was caused by a timing issue with a lookup table in my filter. Typical that I figure it out after posting about it!
__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 20th June 2019 at 23:30.
wonkey_monkey is offline   Reply With Quote
Old 21st June 2019, 09:18   #4729  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,218
Quote:
Originally Posted by qyot27 View Post
and this results in YUV420P10. Which is not YV12, and trying to use ConvertToYV12 should have errored out in this case.
Fixed in source on my github repo.
Code:
- Fix: ConvertToY8, ConvertToYV12, ConvertToYV16, ConvertToYV24 are now allowed only for 8 bit inputs.
  Formerly these functions were allowed for 10+ bit colorspaces but were not converted to real 8 bit Y8/YV12/16/24.
  Use ConvertToY, ConvertToYUV420, ConvertToYUV422, ConvertToYUV444 instead which are bit depth independent
pinterf is offline   Reply With Quote
Old 21st June 2019, 09:25   #4730  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 877
Maybe now it is time for a new release?
ChaosKing is offline   Reply With Quote
Old 21st June 2019, 09:48   #4731  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,218
Quote:
Originally Posted by ChaosKing View Post
Maybe now it is time for a new release?
Yep, since months, I will do it as soon as I have time. Probably soon.

And then? Since ultim recently gave us access to the original Avisynth+ repo, we'll have to think about what to do next.
pinterf is offline   Reply With Quote
Old 21st June 2019, 10:28   #4732  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 877
Does this mean http://avs-plus.net can be updated too?
ChaosKing is offline   Reply With Quote
Old 21st June 2019, 10:31   #4733  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,218
Quote:
Originally Posted by ChaosKing View Post
Does this mean http://avs-plus.net can be updated too?
We'll discuss the topic as well.
pinterf is offline   Reply With Quote
Old 21st June 2019, 11:52   #4734  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 1,769
Quote:
Originally Posted by pinterf View Post
ultim recently gave us access to the original Avisynth+ repo
What a time to be alive. Thanks for all the hard work, pinterf!
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 21st June 2019, 12:04   #4735  |  Link
Groucho2004
 
Groucho2004's Avatar
 
Join Date: Mar 2006
Location: A wretched hive of scum and villainy
Posts: 4,288
Quote:
Originally Posted by wonkey_monkey View Post
Thanks for all the hard work, pinterf!
Indeed, thanks for keeping Avisynth alive and the updates for mvtools2, masktools and many more.

__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 22nd June 2019, 21:11   #4736  |  Link
VoodooFX
Registered User
 
Join Date: Sep 2008
Posts: 45
Any idea why InpaintFunc.avs(1.13-1.15) crash AviSynth+ r2772? "Inpaint" mode works ok, "Deblend" and "Both" modes instantly crash AviSynth+.
No problems with AviSynth 2.6.

How to quickly test it:
1) video file (short!)
2) bmp file (RGB24, same resolution as video, all solid black and small solid white "blob" at top-left corner.
3) InpaintFunc.avs and AVSInpaint.dll ( http://avisynth.nl/index.php/InpaintFunc )
4) script:
LoadCplugin("C:\AVSInpaint.dll")
Import("C:\InpaintFunc.avs")
InpaintFunc(mask="c:\test.bmp", loc="tl",mode="Inpaint",speed=1)


Report from AVSMeter:
AviSynth+ 0.1 (r2772, MT, i386) (0.1.0.0)
Exception 0xC0000005 [STATUS_ACCESS_VIOLATION]
Module: C:\Windows\SysWOW64\VCRUNTIME140.dll
Address: 0x72DC282E

Quote:
Originally Posted by Groucho2004 View Post
I can reproduce this, VDub also reports an access violation. However, my culprit is avisynth.dll, not VCRUNTIME140.dll.

Works fine with classic Avisynth 2.6. You should post this in the AVS+ thread.
VoodooFX is offline   Reply With Quote
Old 24th June 2019, 09:15   #4737  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,218
Quote:
Originally Posted by VoodooFX View Post
Any idea why InpaintFunc.avs(1.13-1.15) crash AviSynth+ r2772? "Inpaint" mode works ok, "Deblend" and "Both" modes instantly crash AviSynth+.
No problems with AviSynth 2.6.

How to quickly test it:
1) video file (short!)
2) bmp file (RGB24, same resolution as video, all solid black and small solid white "blob" at top-left corner.
3) InpaintFunc.avs and AVSInpaint.dll ( http://avisynth.nl/index.php/InpaintFunc )
4) script:
LoadCplugin("C:\AVSInpaint.dll")
Import("C:\InpaintFunc.avs")
InpaintFunc(mask="c:\test.bmp", loc="tl",mode="Inpaint",speed=1)
I could not reproduce. Could you upload your samples and send me a links? Mask and probably a small video.
pinterf is offline   Reply With Quote
Old 24th June 2019, 14:10   #4738  |  Link
VoodooFX
Registered User
 
Join Date: Sep 2008
Posts: 45
Quote:
Originally Posted by pinterf View Post
I could not reproduce. Could you upload your samples and send me a links? Mask and probably a small video.
Did you changed mode="Inpaint" to mode="Deblend" to check if it crash? ("Inpaint" doesn't crash)
VoodooFX is offline   Reply With Quote
Old 24th June 2019, 14:37   #4739  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,218
Quote:
Originally Posted by VoodooFX View Post
Did you changed mode="Inpaint" to mode="Deblend" to check if it crash? ("Inpaint" doesn't crash)
It worked O.K.
But when I was trying to call it more than once
Code:
InpaintFunc(mask="test.bmp", loc="tl",mode="Deblend",speed=1) 
InpaintFunc(mask="test.bmp", loc="tl",mode="Both",speed=1)
Now it crashes, we are happy now

EDIT: The plugin somehow clears or is overwriting an existing framebuffer pointer?
The crash itself occurs at an internal RGB24-RGB32 conversion but since the destination frame does not exist (zero pointer) it will show "access violation".
I'll have a look at the dll source.

Last edited by pinterf; 24th June 2019 at 14:51.
pinterf is offline   Reply With Quote
Old 24th June 2019, 15:03   #4740  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,042
Quote:
Originally Posted by pinterf View Post
I could not reproduce. Could you upload your samples and send me a links? Mask and probably a small video.
They can be artificially generated:

Video:
Code:
ffmpeg -f lavfi -i testsrc -vcodec libx264 -preset ultrafast -crf 18 -t 10 test.mkv
Mask script:
Code:
v1=BlankClip(1,320,240).KillAudio()
v2=v1.Invert().PointResize(60,60)
Overlay(v1,v2,mode="blend")
Mask:
Code:
ffmpeg -i maskscript.avs test.bmp
The (not helpful, because all the binaries in the chain have been stripped) output of gdb seems to point at the cause of the Deblend and Both modes segfaulting being within DevIL, but some of the build warnings when compiling AVSInpaint itself may point more to internal API usage not being correct in those modes when used with modern AviSynth.

This is what happens when building it with only the minimal amount of fixes (avsplus r2883/7c334a0/HEAD header/lib, adjusting the Makefile to use 32-bit lib and -m32 flag, fix typo in AVSInpaint.c avs_is_yuy->avs_is_yuv):
Code:
$ make
gcc -m32 -fdiagnostics-show-location=once  -funsigned-char -mthreads  -Wextra -pedantic -Wall -Wdeclaration-after-statement -Wundef -Wpointer-arith -Wstrict-prototypes -Wredundant-decls  -O2 -fomit-frame-pointer -malign-double -s -march=i386  -c  -o AVSInpaint.obj  AVSInpaint.c
In file included from AVSInpaint.c:94:
AviSynth_C.h:99:21: warning: enumerator value for 'AVS_CS_PLANAR' is not an integer constant expression [-Wpedantic]
   99 |     AVS_CS_PLANAR = 1 << 31,
      |                     ^
In file included from AVSInpaint.c:94:
AviSynth_C.h:690:1: warning: missing initializer for field 'array_size' of 'AVS_Value' {aka 'const struct AVS_Value'} [-Wmissing-field-initializers]
  690 | static const AVS_Value avs_void = {'v'};
      | ^~~~~~
AviSynth_C.h:675:9: note: 'array_size' declared here
  675 |   short array_size;
      |         ^~~~~~~~~~
AVSInpaint.c: In function 'Inpaint_Create':
AVSInpaint.c:254:93: warning: unused parameter 'Data' [-Wunused-parameter]
  254 | AVS_Value  AVSC_CC  Inpaint_Create(AVS_ScriptEnvironment *  Env,  AVS_Value  Args,  void *  Data)
      |                                                                                     ~~~~~~~~^~~~
AVSInpaint.c: In function 'Deblend_Create':
AVSInpaint.c:929:93: warning: unused parameter 'Data' [-Wunused-parameter]
  929 | AVS_Value  AVSC_CC  Deblend_Create(AVS_ScriptEnvironment *  Env,  AVS_Value  Args,  void *  Data)
      |                                                                                     ~~~~~~~~^~~~
AVSInpaint.c: In function 'Analyze_Create':
AVSInpaint.c:1245:93: warning: unused parameter 'Data' [-Wunused-parameter]
 1245 | AVS_Value  AVSC_CC  Analyze_Create(AVS_ScriptEnvironment *  Env,  AVS_Value  Args,  void *  Data)
      |                                                                                     ~~~~~~~~^~~~
AVSInpaint.c: In function 'Analyze_GetFrame':
AVSInpaint.c:1432:81: warning: unused parameter 'FrameNo' [-Wunused-parameter]
 1432 | AVS_VideoFrame *  AVSC_CC  Analyze_GetFrame(AVS_FilterInfo *  FilterInfo,  int  FrameNo)
      |                                                                            ~~~~~^~~~~~~
AVSInpaint.c: In function 'DistanceFunction_Create':
AVSInpaint.c:1449:102: warning: unused parameter 'Data' [-Wunused-parameter]
 1449 | AVS_Value  AVSC_CC  DistanceFunction_Create(AVS_ScriptEnvironment *  Env,  AVS_Value  Args,  void *  Data)
      |                                                                                              ~~~~~~~~^~~~
AVSInpaint.c: In function 'CreateGaussKernel':
AVSInpaint.c:2415:49: warning: using integer absolute value function 'abs' when argument is of floating point type 'double' [-Wabsolute-value]
 2415 |     for (k=-Size ; k<=Size ; k++)  Kernel[k] = (abs(Center-k)<1.0)?(1.0-abs(Center-k)):0.0;
      |                                                 ^~~
AVSInpaint.c:2415:73: warning: using integer absolute value function 'abs' when argument is of floating point type 'double' [-Wabsolute-value]
 2415 |     for (k=-Size ; k<=Size ; k++)  Kernel[k] = (abs(Center-k)<1.0)?(1.0-abs(Center-k)):0.0;
      |                                                                         ^~~
gcc -m32 -fdiagnostics-show-location=once  -funsigned-char -mthreads  -Wextra -pedantic -Wall -Wdeclaration-after-statement -Wundef -Wpointer-arith -Wstrict-prototypes -Wredundant-decls  -O2 -fomit-frame-pointer -malign-double -s -march=i386  -shared  -o AVSInpaint.dll  AVSInpaint.obj AviSynth32.lib

In one build test a day or two ago, I did notice a warning emitted concerning avs_is_same_colorspace, which given what pinterf just noted about the RGB24/32 conversion, might be where this is coming from.
qyot27 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 21:28.


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