Log in

View Full Version : AviSynth Q&A


Pages : 1 2 3 [4] 5

DTL
8th December 2020, 22:16
It is possible to insert Unicode char into text, rendered by Subtitle() function ?

Trying
Subtitle(c, +Chr($2022),font="Arial",size=isize,x=10,y=20,halo_color=$FF000000, text_color=$00e0e0e0,utf8=true) to rasterize 'bullet' char with code 0x2022 and it prints " - symbol with code 0x22. I.e. it ignores first byte. May I need somehow StrToUTF8() ? I set font to Arial and looks for the char code in the Insert->Symbol window.

Using Avisynth+.

wonkey_monkey
8th December 2020, 22:50
Not in general, it seems (edit: wrong, see below), but that particular character does exist in whatever the default Windows ASCII character set is these days, and can be typed directly into your script with "ALT+7".

EDIT: Got it. You can do it, but you have to use the full UTF-8 encoding spelled out in bytes, and specify utf8 = true:

subtitle(chr($E2) + chr($80) + chr($A2), utf8 = true)

Or you change the encoding of your script in your text editor to "UTF-8 no BOM" and type or copy/paste directly into your script:

subtitle("•", utf8 = true)

StainlessS
8th December 2020, 23:08
Try Chr($95)


Function SubtitleCharSet() {
S=""
for(y=0,15) {
s=s+"$"+RT_Hex(y*16,2)+ " "
for(x=0,15) {
n=y*16+x
c=(n<32) ? "." : Chr(n)
s=s+c
}
s=s+"\n"
}
S
}

colorbars(width=360,height=512).Trim(0,-1).KillAudio
s=RT_StrReplace(SubtitleCharSet,Chr(10),"\n")
Subtitle(s,font="Courier New",size=32,lsp=0)
return Last


EDIT:
https://i.postimg.cc/hjkvX4nK/subs-00.jpg (https://postimages.org/)

EDIT

BlankClip(Length=1,width=20,height=20)
Bullet=Chr($95)
Subtitle(Bullet)
return last

https://i.postimg.cc/WpSbR7F2/subs-01.jpg (https://postimages.org/)


BlankClip(Length=1,width=20,height=20)
Bullet=Chr($95)
Subtitle(Bullet)
BilinearResize(80,80)
return last

https://i.postimg.cc/jq8K3dm2/subs-02.jpg (https://postimages.org/)

wonkey_monkey
8th December 2020, 23:37
Wait, something's not right there... $80 is the Euro symbol, that's correct, but the ellipsis (…) should be $85. Your graphic shows it at position 84.

Likewise the • symbol sould be $95, but it's at position $94.

Characters $90 and $81 do not encode to anything. There are other missing characters too.

StainlessS
8th December 2020, 23:49
It depends upon Character Set [EDIT: Font] , I used Courier New [which is MonoSpaced to maintain format of the hex/ascii block]

StainlessS
8th December 2020, 23:56
WingDings

Function SubtitleCharSet() {
S=""
for(y=0,15) {
s=s+"$"+RT_Hex(y*16,2)+ " "
for(x=0,15) {
n=y*16+x
c=(n<32) ? "." : Chr(n)
s=s+c
}
s=s+"\n"
}
S
}

colorbars(width=880,height=512).Trim(0,-1).KillAudio
s=RT_StrReplace(SubtitleCharSet,Chr(10),"\n")
#Subtitle(s,font="Courier New",size=32,lsp=0)
Subtitle(s,font="Wingdings",size=32,lsp=0)
return Last

https://i.postimg.cc/pL3KfvR1/subs-03.jpg (https://postimages.org/)

EDIT:
Default Character sets of Subtitle(), RT_Subtitle() and RT_DebugF() are all different outside of $20 -> $7E range.

EDIT: The Hex/Ascii block prints out chars below 32($20) as '.' as they are usually control characters,
some Subtitle() fonts may actually have valid characters for those chars, but we just printed same as '.',
as in Hex/ASCII block.
Also, the similar-ish stuff on the Left above in Windigs block, are Digits in the hex/ascii block.

EDIT:
Wait, something's not right there... $80 is the Euro symbol, that's correct, but the ellipsis (…) should be $85.
You miscounted the characters, There is a comma after Euro symbol which you failed to count, and same on line below it.
[Mentally align with the characters above the euro line]
EDIT: hang on. you're right, maybe something strange there.
I reccon that something on $80 line prints nothing, dont offhand know which character. [there are spaces at end of line]

StainlessS
9th December 2020, 00:35
Here is the answer,


SZ=20
BlankClip(width=80,height=360).Trim(0,-1)
For(n=$80,$8F) {
s = RT_String("$%02X %s",n,Chr(n))
RT_DebugF("%s",S)
Subtitle(s,font="Courier New",size=SZ,y=(n-$80)*SZ)
}

Return Last

https://i.postimg.cc/KcsW6KNK/subs-Copy-00.jpg (https://postimages.org/)

StainlessS
9th December 2020, 03:26
OK, This should produce (more or less) good results whatever charset.
We have fixed numbers (sizes) so that both Courier New and WingDings fonts look OK-ish.


########
# Mod ADD_Y and ADD_X to give more or less spacing to characters in Characterset grid (at least 0)

############### Try eg SIZE_Y=40 SIZE_X=32 ADD_Y=0 ADD_X=32
SIZE_Y = 20 # Font size (For Hex Numbers)
SIZE_X = 16 # Font size (For Hex Numbers [actually spacing allotted])
ADD_Y = 0 # Additional vertical spacing for character grid (over and above hex number font)
ADD_X = 16 # Additional horizontal spacing for character grid (over and above hex number font)
CELL_H = SIZE_Y+ADD_Y # Character Box Height
CELL_W = SIZE_X+ADD_X # Character Box Width (Adjust for font)
VLINE_W = 2 # Vertical grid lines thickness
HLINE_H = 2 # Horizontal grid lines thickness
LINECOL =$808080 # grid color
BORDCOL= $FF0000 # outer lines color
#Font = "Courier New" # Character set Font name (Numbers always done in "Courier New")
Font = "WingDings"
#Font = "Symbol"
#Font = "OpenSymbol"
#Font = "Times New Roman"
#Font = "WebDings"
#######################
HexDigit = "0123456789ABCDEF"
T=BlankClip(Length=1,width=CELL_W,height=CELL_H)

# Do Character Set grid
for(y=0,15) {
For(x=0,15) {
n = y * 16 + x
char = Chr(n)
charC = T.Subtitle(char,font=FONT,size=SIZE_Y)
xclip = (x==0) ? charC : xclip.StackHorizontal(charC.AddBorders(VLINE_W,0,0,0,LINECOL))
}
CHARSET = (y==0) ? xclip : CHARSET.StackVertical(xclip.AddBorders(0,HLINE_H,0,0,LINECOL))
}
#return charset

# Vertical Hex Numbers
TV=T.BlankClip(Width=SIZE_X*3)
for(y=0,15) {
numC = TV.Subtitle("$"+HexDigit.MidStr(y+1,1)+"0",font="Courier New",size=SIZE_Y)
yNumC = (y==0) ? numC : yNumC.StackVertical(numC.Addborders(0,HLINE_H,0,0,LINECOL))
}
#return yNumC

for(x=0,15) {
numC = T.Subtitle(HexDigit.MidStr(x+1,1),font="Courier New",size=SIZE_Y)
xNumC = (x==0) ? numC : xNumC.StackHorizontal(numC.Addborders(VLINE_W,0,0,0,LINECOL))
}
#return xNumC

yNumC = yNumC.AddBorders(0,0,VLINE_W,0,LINECOL) # Line between vertical numbers and charset
xNumC = xNumC.AddBorders(0,0,0,HLINE_H,LINECOL) # Line between horizontal numbers and charset

Corner= T.BlankClip(Width=SIZE_X*3).AddBorders(0,0,VLINE_W,HLINE_H,LINECOL) # Top LHS corner

TOP = Corner.StackHorizontal(xnumC)
BOT = yNumC.StackHorizontal(CHARSET)
StackVertical(TOP,BOT) # Glue the whole lot together

AddBorders(VLINE_W,HLINE_H,VLINE_W,HLINE_H,BORDCOL) # Add Outer border

Return Last



Font = "Courier New"
https://i.postimg.cc/8PVm7MTf/subs-00.jpg (https://postimages.org/)

Font = "WingDings"
https://i.postimg.cc/jSx6XTws/subs-01.jpg (https://postimages.org/)

Win7 Symbol
https://i.postimg.cc/287jYRHL/W7-Symbol.jpg (https://postimages.org/)

Win7 OpenSymbol
https://i.postimg.cc/nzqb1Bg9/W7-Open-Symbol.jpg (https://postimages.org/)

Font = "Times New Roman"
https://i.postimg.cc/mDjVRrF6/Times-New-Roman.jpg (https://postimages.org/)

Font = "WebDings"
https://i.postimg.cc/FzfSqFbS/Webdings.jpg (https://postimages.org/)

Font ="WingDings" # BIG with mods

SIZE_Y = 40 # Font size (For Hex Numbers)
SIZE_X = 32 # Font size (For Hex Numbers [actually spacing allotted])
ADD_Y = 0 # Additional vertical spacing for character grid (over and above hex number font)
ADD_X = 32 # Additional horizontal spacing for character grid (over and above hex number font)

https://i.postimg.cc/5yNJNjKH/Wing-Dings-BIG.jpg (https://postimages.org/)

WebDings Big
https://i.postimg.cc/2yXskGBJ/Web-Dings-Big.jpg (https://postimages.org/)

Spot any more probs Wonkey ?

EDIT:We seem to have a "Bullet" at chr(7) [Bell control code character] in both Courier New and Wingdings.

qyot27
9th December 2020, 05:23
Or you change the encoding of your script in your text editor to "UTF-8 no BOM" and type or copy/paste directly into your script:

subtitle("•", utf8 = true)
Or change the Windows 10 system locale to UTF-8 and drop the utf8=true parameter, because it's not necessary in that scenario (this tactic works with 2.6 as well). (https://forum.doom9.org/showpost.php?p=1909790&postcount=9)

StainlessS
9th December 2020, 06:06
Previous post removed RT_Stats requirement, only AVS+ required.

Converterted to Function, might want to create muiltiple example font frames.

eg SubtitleCharacterSet("Symbol") ++ SubtitleCharacterSet("webdings")++SubtitleCharacterSet("Times New Roman")

SubtitleCharacterSet.avsi

# SubtitleCharacterSet.avsi

/*
SubtitleCharacterSet() ::: by StainlessS @ https://forum.doom9.org/showthread.php?p=1930308#post1930308

Req Avs+

Produces an RGB32 single frame showing characterset for a particular Subtitle font, in Hex/ASCII table.

SubtitleCharacterSet(
String Font, [* Font Name, Not Optional, Default Arial if "" or invalid font *]
Int "Size_y" =20, [* Height of Hex numbers [Courier New) *]
Int "Size_X" =16, [* Width of Hex numbers [Courier New) *]
Int "Add_Y" =0, [* Vertical Spacing to add for Font characterset, over and obove that allotted for Hex Numbers *]
Int "Add_X" =16, [* Hoizontal Spacing to add for Font characterset, over and obove that allotted for Hex Numbers *]
Int "VLine_W"=2, [* Width of Vertical lines in grid *]
Int "HLine_H"=2, [* Height of Horizontal lines in grid *]
Int "LineCol"=$808080, [* Color of Lines in grid *]
Int "BordCol"=$FF0000, [* Color of border line *]
Bool "Title "=True [* Show Font title on top of frame *]
)

eg
SubtitleCharacterSet("Arial")
SubtitleCharacterSet("Courier New")
SubtitleCharacterSet("Symbol")
SubtitleCharacterSet("OpenSymbol")
SubtitleCharacterSet("Times New Roman")
SubtitleCharacterSet("WebDings")
SubtitleCharacterSet("WingDings")
SubtitleCharacterSet("WebDings" ,Size_Y=40,Size_X=32,Add_Y=0,Add_X=32)
SubtitleCharacterSet("WingDings",Size_Y=40,Size_X=32,Add_Y=0,Add_X=32)
SubtitleCharacterSet("Symbol") ++ SubtitleCharacterSet("webdings")++SubtitleCharacterSet("Times New Roman")

*/

Function SubtitleCharacterSet(String Font,Int "Size_y",Int "Size_X",Int "Add_Y",Int "Add_X",
\ Int "VLine_W", Int "HLine_H",
\ Int "LineCol",Int "BordCol",
\ Bool "Title"
\ ) {
Size_Y = Default(Size_Y,20)
Size_X = Default(Size_X,16)
Add_Y = Default(Add_Y, 0)
Add_X = Default(Add_X, 16)
VLine_W = Default(VLine_W,2)
HLine_H = Default(HLine_H,2)
LineCol = Default(LineCol,$808080)
BordCol = Default(BordCol,$FF0000)
Title = Default(Title,True)
#
CELL_H = SIZE_Y+ADD_Y # Character Box Height
CELL_W = SIZE_X+ADD_X # Character Box Width (Adjust for font)
T=BlankClip(Length=1,width=CELL_W,height=CELL_H)
HexDigit = "0123456789ABCDEF"
# Do Character Set grid
for(y=0,15) {
For(x=0,15) {
n = y * 16 + x
char = Chr(n)
charC = T.Subtitle(char,font=FONT,size=SIZE_Y)
xclip = (x==0) ? charC : xclip.StackHorizontal(charC.AddBorders(VLINE_W,0,0,0,LINECOL))
}
CHARSET = (y==0) ? xclip : CHARSET.StackVertical(xclip.AddBorders(0,HLINE_H,0,0,LINECOL))
}
# Vertical Hex Numbers
TV=T.BlankClip(Width=SIZE_X*3)
for(y=0,15) {
numC = TV.Subtitle("$"+HexDigit.MidStr(y+1,1)+"0",font="Courier New",size=SIZE_Y)
yNumC = (y==0) ? numC : yNumC.StackVertical(numC.Addborders(0,HLINE_H,0,0,LINECOL))
}
for(x=0,15) {
numC = T.Subtitle(HexDigit.MidStr(x+1,1),font="Courier New",size=SIZE_Y)
xNumC = (x==0) ? numC : xNumC.StackHorizontal(numC.Addborders(VLINE_W,0,0,0,LINECOL))
}
yNumC = yNumC.AddBorders(0,0,VLINE_W,0,LINECOL) # Line between vertical numbers and charset
xNumC = xNumC.AddBorders(0,0,0,HLINE_H,LINECOL) # Line between horizontal numbers and charset
Corner= T.BlankClip(Width=SIZE_X*3).AddBorders(0,0,VLINE_W,HLINE_H,LINECOL) # Top LHS corner
TOP = Corner.StackHorizontal(xnumC)
BOT = yNumC.StackHorizontal(CHARSET)
StackVertical(TOP,BOT) # Glue the whole lot together
AddBorders(VLINE_W,HLINE_H,VLINE_W,HLINE_H,BORDCOL) # Add Outer border
(TITLE)
\ ? Last.BlankClip(Height=SIZE_Y).StackVertical(Last).Subtitle(Font,font="Courier New",size=SIZE_Y).AddBorders(VLINE_W,HLINE_H,VLINE_W,0,BORDCOL)
\ : Last
Return Last
}

EDIT: Added in BLUE

[* Font Name, Not Optional, Default Arial if "" or invalid font *]

EDIT:
script with the SubtitleCharacterSet.avsi in plugins.

StackVertical(SubtitleCharacterSet("Symbol"),SubtitleCharacterSet("webdings"))

https://i.postimg.cc/L85vzPb9/Stack-Symbols.jpg (https://postimages.cc/)


EDIT: UK NumberPlate font (Charles Write font):- https://forum.doom9.org/showpost.php?p=1817708&postcount=25
See StainlessS below in sig, DATA folder for font.
https://i.postimg.cc/ZnbF6nb9/Subtitle-Character-Set-00.jpg (https://postimages.org/)

DTL
9th December 2020, 08:42
Or change the Windows 10 system locale to UTF-8 and drop the utf8=true parameter, because it's not necessary in that scenario (this tactic works with 2.6 as well). (https://forum.doom9.org/showpost.php?p=1909790&postcount=9)

Well - I see I am lucky to have 'bullet' symbol in typically lower bytes like Chr(7) or Chr($95). But I usually use simplest and I think ANSI text editor from FAR file manager and think there were way to enter multi-byte characters by its codes to text if we have functions like utf8=true in rasterizer and some convert like StrToUTF8().

Like:
1. Create empty string.
2. Convert it to UTF8 so it is now treated as UTF8 encoded string.
3. + (add) to it our required char code like +CHR($2022).
4. Use it in Subtitle.

So to use UTF-8 symbols and strings we need to operate avisynth script as UTF-8 encoded file ? And from 8-bit ANSI text files we can call only 256-symbols part of fonts ?

wonkey_monkey
9th December 2020, 15:17
You can enter multibyte characters using CHR, but you have to use the UTF-8 encoding (0xE2 0x80 0xA2), not the Unicode code point (0x2022).

... + chr($E2) + chr($80) + chr($A2) ...

DTL
9th December 2020, 16:30
You can enter multibyte characters using CHR, but you have to use the UTF-8 encoding (0xE2 0x80 0xA2), not the Unicode code point (0x2022).

... + chr($E2) + chr($80) + chr($A2) ...

Oh - now I undrstand. It is Ms Word that shows in the single window named 'code word' 0x95 for ASCII hex 'bullet' and unicode hex 0x2022 for the Unicode 'bullet', but they are very different numbers. And I need to found somewhere convertor of 'Unicode code point' into real byte sequence to enter it using CHR().

StainlessS
9th December 2020, 20:13
I'm guessin' that MidStr() et al cannot cope with UTF-8. [?]

DTL
30th December 2020, 17:29
Because this forum is mostly about moving pictures I finally made script for creating source data for testing resizers. Based on the 'bullet' symbol because it is closer to 'elementary moving picture object' like elementary 'dot'.


function SourceObject(clip c, float fArg)
{
xpos_rot = c.width/3+(10*Sin(Pi()*fArg/(50)))
ypos_rot = c.width/3-(10*Cos(Pi()*fArg/(50)))

xpos_diag = c.width*2/3+(10*Sin(Pi()*fArg/(50)))
ypos_diag = c.width*2/3-(10*Sin(Pi()*fArg/(50)))

xpos_h = c.width*2/3+(10*Sin(Pi()*fArg/(50)))
ypos_h = c.width/3

xpos_v = c.width/3
ypos_v = c.width*2/3+(10*Sin(Pi()*fArg/(50)))

ch_size = (Int(fArg/100))+1

xpos_rot_i=Int(xpos_rot)
ypos_rot_i=Int(ypos_rot)

xpos_diag_i=Int(xpos_diag)
ypos_diag_i=Int(ypos_diag)

xpos_h_i=Int(xpos_h)
ypos_h_i=Int(ypos_h)

xpos_v_i=Int(xpos_v)
ypos_v_i=Int(ypos_v)

c=Subtitle(c, CHR($95),font="Arial",size=ch_size,x=xpos_rot_i,y=ypos_rot_i,halo_color=$FF000000, text_color=$00e0e0e0)
c=Subtitle(c, CHR($95),font="Arial",size=ch_size,x=xpos_diag_i,y=ypos_diag_i,halo_color=$FF000000, text_color=$00e0e0e0)
c=Subtitle(c, CHR($95),font="Arial",size=ch_size,x=xpos_h_i,y=ypos_h_i,halo_color=$FF000000, text_color=$00e0e0e0)
c=Subtitle(c, CHR($95),font="Arial",size=ch_size,x=xpos_v_i,y=ypos_v_i,halo_color=$FF000000, text_color=$00e0e0e0)

return c

}

BlankClip(30000,800,800,"RGB24",25,color=$00202020)

Animate(last, 0,30000,"SourceObject", 0, 30000)

ConvertToYV24()

# production-downsizing
#SinPowResizeMT(last,width/10,height/10,p=2.6)
GaussResize(last,width/10,height/10,p=12)
#JincResize(width/10,height/10,tap=5)
#LanczosResizeMT(last,width/10,height/10,taps=8)

#restoring vewing-upsizing
#SincLin2ResizeMT(width*8,height*8,taps=8)
SincResize(width*8,height*8,taps=5)
#JincResize(width*8,height*8,tap=5)

#Levels(25, 1, 55, 0, 255) # can be used for better viewing of processing errors


It feeds to resizers the number of test objects at various positions with step about 0.1 of sampling grid size and size of object with 0.1 step. After getting good result with one dot - other more complicated symbols may be tested.

StainlessS
8th March 2021, 21:05
Added UK Numberplate font image to post #164.
Also added font in zip, StainlessS@MediaFire in sig, DATA folder.

GAP
28th April 2021, 12:53
What is a good way to practice making these scripts? Someone recommend another method to resize videos and they suggested that I use a AVISynth script to do that. Can anyone tell what is a good way to start? Or even have a dictionary/guide/etc. to get em started?

StainlessS
28th April 2021, 16:12
Where it says "New To Avisynth - Start Here"
http://avisynth.nl/index.php/Main_Page

GAP
2nd May 2021, 07:34
Can you have AVIsynth and AVISynth + on the same computer?

StainlessS
2nd May 2021, 11:48
Can you have AVIsynth and AVISynth + on the same computer?
Yes but only one can be "Active" at any one time [can have x86 and x64 at same time)
Universal Avisynth Installer:- https://forum.doom9.org/showthread.php?t=172124
Easy to switch, just execute the CMD file, and select which version you want to activate.

where both x86 and x64 active, use eg VDub2 x86 for x86 AVS, and VDub2 x64 for x64 AVS.

x86 VD2 requires x86 Avisynth and x86 plugins, x64 VD2 requires x64 Avisynth and x64 plugins.

GAP
1st June 2021, 07:27
Does anyone here have an AVISynth "cheat sheet"? I am not looking for anything complicated,just something simple that I can use to get me started.

Reel.Deel
1st June 2021, 12:00
Does anyone here have an AVISynth "cheat sheet"? I am not looking for anything complicated,just something simple that I can use to get me started.

Take a look at the AviSynth wiki page. There's a section on the front page titled "New to AviSynth – Start Here", there you will find lots of good information on how to get started. The guides page (http://avisynth.nl/index.php/Guides) should be really helpful.

FranceBB
2nd June 2021, 09:59
Does anyone here have an AVISynth "cheat sheet"? I am not looking for anything complicated,just something simple that I can use to get me started.

Avisynth Wiki - External Filters with the relative documentation: http://avisynth.nl/index.php/External_filters


My personal Avisynth Cheat Sheet to use when I'm too lazy and I just want to copy-paste: https://github.com/FranceBB/FranceBB_Sample-Avisynth-Script

kedautinh12
2nd June 2021, 11:02
Thank France

GAP
2nd June 2021, 12:10
Thanks from me too.

chmars
3rd June 2021, 06:53
Thanks
Reel.deel, I had missed the guides page. Nice.
FranceBB, these are super good starting points to experiment from a already working base and learn fast.

DTL
1st October 2021, 23:15
Are there exist any built-in or plugin way of direct samples sequence setting (in 4:4:4 and sub-sampled interleaved or planar format) from text-line (or array) defined arguments to function ?
Something like

Line(pix_fmt="YUV422P10",Y="64,64,940,940",U="512,512",V="512,512")

return clip 4*1 size (with some default fps and frame num) of the requested pix_fmt and with defined samples values ? Or may be script function ?

poisondeathray
1st October 2021, 23:31
Are there exist any built-in or plugin way of direct samples sequence setting (in 4:4:4 and sub-sampled interleaved or planar format) from text-line (or array) defined arguments to function ?
Something like

Line(pix_fmt="YUV422P10",Y="64,64,940,940",U="512,512",V="512,512")

return clip 4*1 size (with some default fps and frame num) of the requested pix_fmt and with defined samples values ? Or may be script function ?

One way is BlankClip and Expr

eg.

BlankClip(length=300, fps=24, width=4, height=1, pixel_type="YUV444P10")
Expr("64","512","512")
KillAudio()

wonkey_monkey
1st October 2021, 23:40
You can use Expr:

Blankclip(width = 4, height = 1, pixel_type="YUV422P10").Expr("
sx 0 == 64
sx 1 == 64
sx 2 == 940
940 ? ? ?
","
sx 0 == 512
512 ?
","
sx 0 == 512
512 ?
")

The "sx" lines are acting like C "case" statements, with the final line being the last/default value.

DTL
2nd October 2021, 05:08
My example was short for simplicity. I mean setting exact sequencies of samples values of longer length. For typical transient description I need to set about 8..10 Y values and 4..5 UV values. And for sustained borders I can use simple AddBorders.
For long non-fully scripting way I have a set of external simple program to wrtie UYVY set of samples and RawSource plugin. But it long way. So may be ask to add simple Debug-group function close to BlankClip but with extended color param (like array of values instead of one colour).
So currently no way to set/get samples values at given (x,y) coordinate of framebuffer ?
The hackway with StackHorizontal(BlankClip(width=2,height=1,color=2_UYVY_samples),second_blankclip_with second 2 UYVY) may not work with 10bit ? And not short form for defining string of 10 Y and 5+5 UV samples.

If even use Expr() for 4:2:2 2*1 size clips (for further hor stacking) - how to set 2 different Y values of first and second Y samples ?

poisondeathray
2nd October 2021, 05:25
So currently no way to set/get samples values at given (x,y) coordinate of framebuffer ?



Reading sample value at x,y is easier with vapoursynth editor, because it supports different pixel formats, bitdepths . You mouse over any location and it reads off x,y coordindate and corresponding Y,Cb,Cr or R,G,B value , 8,10,12,16bit, float. AVSPmod is good, but unfortunately only reads 8bit values. Even if you're not familiar with vapoursynth, you can load most avs scripts into vapoursynth and use vsedit to "see" the proper pixel values

Not sure of a good way of setting pixel values at x,y . Maybe overlay as a workaround method


The hackway with StackHorizontal(BlankClip(width=2,height=1,color=2_UYVY_samples),second_blankclip_with second 2 UYVY) may not work with 10bit ? And not short form for defining string of 10 Y and 5+5 UV samples.


"UYVY" fourcc is 8bit422, so it does not work with 10bit per channel

If you meant U, V in v210 or p210 (10bit 422 interleaved, and planar), then it will work

poisondeathray
2nd October 2021, 05:32
If even use Expr() for 4:2:2 2*1 size clips (for further hor stacking) - how to set 2 different Y values of first and second Y samples ?

Untested, but maybe perform your manipulations with grayscale planes of Y, U, V and then combineplanes . StackHorizontal for 2 Y samples

DTL
2nd October 2021, 06:20
Same question - how to set sequence of (exact and different) Y-only samples to 'grey' plane. And 10bit greatly wanted for HDR like PQ transfer.
Possibly without 'stacking' of 1*1 samples Y10 or Y16 clips. That is too long. No way with 'arrays' of new avisynth versions available ?
Can array be argument of user function ?
Can enviroment return number of members in array so may be loop of BlankClip(width=1,height=1,pix_fmt="Y10") and StackHorizontal possible to fill the line of samples of grey-plane from simple provided sequence of numbers ?

wonkey_monkey
2nd October 2021, 13:36
If even use Expr() for 4:2:2 2*1 size clips (for further hor stacking) - how to set 2 different Y values of first and second Y samples ?

See my post just before yours.

Alternatively: perhaps there is an image source filter which will read Netpbm (https://en.wikipedia.org/wiki/Netpbm) files.

DTL
2nd October 2021, 14:23
"See my post just before yours."

Oh - thank you - it really works for required 10x1 4:2:2 clip like

plY=Blankclip(width = 10, height = 1, pixel_type="Y10").Expr("sx 0 == 509 sx 1 == 509 sx 2 == 509 sx 3 == 509 sx 4 == 509 sx 5 = 498 sx 6 = 446 sx 7 == 361 sx 8 == 292 276 ? ? ? ? ? ? ? ? ?")
plU=Blankclip(width = 5, height = 1, pixel_type="Y10").Expr("sx 0 == 270 sx 1 == 263 sx 2 == 330 sx 3 == 761 754 ? ? ? ?")
plV=Blankclip(width = 5, height = 1, pixel_type="Y10").Expr("sx 0 == 203 sx 1 == 224 sx 2 == 271 sx 3 == 832 821 ? ? ? ?")
CombinePlanes(plY, plU, plV, "YUV", "YYY", pixel_type="YUV422P10")


And another question - are there ways to define >8bit YUV colour for AddBorders() ? Or only create separate 2x1 clip with same way and point-resize to required size and StackHorizontal ?

GAP
6th December 2021, 13:04
How do you merge files together in AVIsynth? And with programs like AVSPMod or MeGUI?

VoodooFX
6th December 2021, 13:22
How do you merge files together in AVIsynth? And with programs like AVSPMod or MeGUI?

a=YourPreferedSourcePlugin("D:\yourvideo1.mkv")
b=YourPreferedSourcePlugin("D:\yourvideo2.mkv")
a++b

Btw, this is wrong thread to ask questions about Avisynth:
Do NOT use this thread for discussion of specific Avisynth problems you may have. Post those in a separate thread. This thread is for suggesting new FAQs and discussing existing ones.

GAP
7th December 2021, 06:01
Oh sorry about that.

FranceBB
7th December 2021, 08:33
@VoodooFX is right, you use append, so you set your file to a variable, your other file to another variable and then you append them together with ++.
Now, here's the catch: they must be exactly the same, namely they must be with the same resolution, framerate, color sampling, bit depth and if they have audio, that should be the same too, like, you cannot append a clip with audio to another which doesn't have it.
Of course, as a user and encoder writing a script, it's your duty to make sure those match, hence performing conversions. ;)

VoodooFX
6th May 2022, 17:01
This thread is about wiki:

Do NOT use this thread for discussion of specific Avisynth problems you may have. Post those in a separate thread. This thread is for suggesting new FAQs and discussing existing ones.

GAP
22nd September 2022, 04:21
How do you update AVISynth and/or AVISynth +? How to you know when you need to update it?

kedautinh12
22nd September 2022, 04:57
How do you update AVISynth and/or AVISynth +? How to you know when you need to update it?

Latest ver here:
https://gitlab.com/uvz/AviSynthPlus-Builds

FranceBB
3rd October 2022, 16:24
Just FYI, I raised an issue here https://github.com/AviSynth/AviSynthPlus/issues/302 'cause apparently WAVSource() cannot index files larger than 4 GB and that affected my supply chain... :(

LeXXuz
14th October 2022, 10:27
I have trouble on my Windows 11 machine with the default plugin folders of Avisynth+. It seems they don't get recognized and the plugins stored in
"C:\Program Files (x86)\AviSynth+\plugins64+" f.e. do not get auto-loaded. How can I fix that? Re-install of Avisynth+ did not help.
Right now I have to import all my filters manually from that folder which is a little annoying.

kedautinh12
14th October 2022, 10:30
I have trouble on my Windows 11 machine with the default plugin folders of Avisynth+. It seems they don't get recognized and the plugins stored in
"C:\Program Files (x86)\AviSynth+\plugins64+" f.e. do not get auto-loaded. How can I fix that? Re-install of Avisynth+ did not help.
Right now I have to import all my filters manually from that folder which is a little annoying.

Strange, my Windows is win 11 too and didn't got that problem

FranceBB
14th October 2022, 11:23
Mine didn't get that problem either. They were loaded automatically just fine, as they should.
Could it be some permission issues about the Program Files folder? Or perhaps Windows Defender blocking it? Dunno. It works on my end, I cannot reproduce it.

LeXXuz
14th October 2022, 12:37
Folder permissions seem fine. Maybe something wrong with the path variables if Avisynth uses any.

EDIT: Found it. The plugin folder was not set correctly within the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Avisynth. No idea why.

LeXXuz
6th December 2022, 16:06
Probably a pretty silly question but how do I perform a simple exponential math function in Avisynth? Something like x=2^n for example. :o

poisondeathray
6th December 2022, 16:14
Probably a pretty silly question but how do I perform a simple exponential math function in Avisynth? Something like x=2^n for example. :o


One way is expr
http://avisynth.nl/index.php/Expr

e.g. In a YUV clip change all values in Y channel to power of 2 , copy Cb, Cr
expr("x 2 ^", "x", "x")

kedautinh12
6th December 2022, 16:14
x = pow(2,n) (maybe) :D