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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 11th March 2020, 22:41   #5221  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,527
In Python 3 the result is floating point
pinterf is offline  
Old 11th March 2020, 22:48   #5222  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
Maybe, and that is why you used integer divide, but not so in Avs,

Quote:
Originally Posted by StainlessS View Post
Aint that exactly the same where two integers involved ???

EDIT: All these are int
Code:
intmuldiv = (x * targetmax + half_for_rounding) / sourcemax
EDIT: And approx is just bit shifts, no divide, but 233 rather than 234 diffs.
EDIT: Maybe altmuldiv is no better than intmuldiv, only where numbers involved, multiplier and divider are 2 ^ n - 1,
it should though be generally better [occasionally].


Code:
    intmuldiv = (x * targetmax   +  (sourcemax/2)) / sourcemax            # intermediate precision loss of least significant bit at stage (sourcemax/2)
    altmuldiv = (x * targetmax*2 +      sourcemax) / (sourcemax*2)
EDIT: Above is absolute rubbish, altmuldiv always produces same answer as intmuldiv.
Could only possibly work better if sourcemax is odd, and as ((x * targetmax*2) + sourcemax) would be odd, and (sourcemax*2) would be even
so would always lose the same least significant (odd) bit in the final result.
Arh well, it seemed like a good idea at the time.
__________________
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; 12th March 2020 at 09:13.
StainlessS is offline  
Old 13th March 2020, 12:44   #5223  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,501
So, a general PSA:

In Windows 10, it is possible to actually set the locale to UTF-8 for the entire OS, the way basically every OS other than Windows handles this issue. Apparently this has been possible for close to two years. Doing so will allow AviSynth+ (and probably even classic 2.6, although I haven't tried) to handle international characters without any special workarounds like utf8=true or juggling MultiByteToWideChar/WideCharToMultiByte in the program loader.
qyot27 is offline  
Old 13th March 2020, 15:31   #5224  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,857
Can be enabled at:

Time & Language > Language > Administrative Language > Language for non unicode programs > check UTF-8 checkbox > reboot

Works fine so far.
stax76 is offline  
Old 13th March 2020, 15:54   #5225  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,527
Actually I was courious as well and was thinking about a build that would allow omitting 'utf8=true' parameters for Import, SubTitle, Text and AviSource and handle utf8 instead of ANSI.
I suppose classic substring and character position helper functions will not work as they did before for non-ascii-only strings
pinterf is offline  
Old 15th March 2020, 23:44   #5226  |  Link
foobar2000
Registered User
 
Join Date: Aug 2018
Posts: 25
I have a problem regarding .avsi files, you can delete .avsi files during encoding (like by accident)

but you can't delete .dll during encoding (while in use), I'm using Simple x264 Launcher and I've been encoding something, and I deleted QTGMC.avsi but put it back later

the avs script requires QTGMC.avsi, does this (deleted but put it back) affect the output? it doesn't show errors, do I need to worry? thanks

or the .avsi will store and run in RAM once the task starts?
foobar2000 is offline  
Old 16th March 2020, 00:22   #5227  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,857
Quote:
does this (deleted but put it back) affect the output? it doesn't show errors, do I need to worry?
It does not affect the output and you don't have to worry.
stax76 is offline  
Old 16th March 2020, 09:45   #5228  |  Link
r0lZ
PgcEdit daemon
 
r0lZ's Avatar
 
Join Date: Jul 2003
Posts: 7,524
Quote:
Originally Posted by stax76 View Post
Can be enabled at:

Time & Language > Language > Administrative Language > Language for non unicode programs > check UTF-8 checkbox > reboot

Works fine so far.
At least one CLI tool crashes with an access violation when that option is enabled: MVCPlanes2OFS.exe (used indirectly by BD3D2MK3D). So, use that beta option with caution !
__________________
r0lZ
PgcEdit homepage (hosted by VideoHelp)
BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV
r0lZ is offline  
Old 16th March 2020, 12:10   #5229  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,857
It has caused a small issue in the stable release of staxrip which I fixed by removing non ASCII chars from the code and adding an automated test to prevent it from happening again.
stax76 is offline  
Old 16th March 2020, 14:13   #5230  |  Link
Nico8583
Registered User
 
Join Date: Jan 2010
Location: France
Posts: 851
Quote:
Originally Posted by stax76 View Post
It has caused a small issue in the stable release of staxrip which I fixed by removing non ASCII chars from the code and adding an automated test to prevent it from happening again.
Hi, what kind of non ASCII chars have you removed from your app ? Thank you.
Nico8583 is offline  
Old 16th March 2020, 15:33   #5231  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,857
This one was shown in the crop dialog:

±

https://en.wikipedia.org/wiki/Plus%E2%80%93minus_sign


This was in the x265 dialog:

Level 1 + intra/inter modes, ref’s

Changed to ref's


A popular non ASCII char used in apps is this:

©

Using (C) instead.


I know that it's no problem and nothing wrong to use Unicode in apps, Microsoft usually works with Unicode files with BOM but the most popular way nowadays is UTF8 without BOM, I think it's the default everywhere in .NET Core. I usually prefer simple solutions, ASCII and UTF8 without BOM are compatible.

AviSynth headers are part of the staxrip source code so my test applies, it's pure ASCII.
stax76 is offline  
Old 17th March 2020, 00:32   #5232  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
Exist() is now broken in 3.5. [on folders]

z.avs
Code:
fn="D:\ME"                          # Directory this file is in
RT_DebugF("%s %s",Exist(fn),fn)     # False
fn="D:\ME\z.avs"                    # This file
RT_DebugF("%s %s",Exist(fn),fn)     # True
MessageClip ("Done")
Code:
00000265	0.13369642	[3052] RT_DebugF: False D:\ME	
00000266	0.13383374	[3052] RT_DebugF: True D:\ME\z.avs
Note, (below in code block so that backslash dont disappear on-site)
Code:
"D:\ME\"
also fails, but then it always did [maybe not necessary to fix, current robust scripts will remove trailing slash before Exist() check on folder name with trailing slash].

Heads up, AvsInit.avsi now fails due to above [MACHINE conditional AutoLoad dll stuff].

EDIT: AviSynthPlus_3.4.0_20191020.exe Works ok, AvisynthPlus-r3.5test_20200207-filesonly.7z dont.
__________________
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; 17th March 2020 at 01:38.
StainlessS is offline  
Old 17th March 2020, 06:10   #5233  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,527
Quote:
Originally Posted by StainlessS View Post
Exist() is now broken in 3.5. [on folders]

z.avs
Code:
fn="D:\ME"                          # Directory this file is in
RT_DebugF("%s %s",Exist(fn),fn)     # False
fn="D:\ME\z.avs"                    # This file
RT_DebugF("%s %s",Exist(fn),fn)     # True
MessageClip ("Done")

Code:
00000265	0.13369642	[3052] RT_DebugF: False D:\ME	
00000266	0.13383374	[3052] RT_DebugF: True D:\ME\z.avs
Note, (below in code block so that backslash dont disappear on-site)
Code:
"D:\ME\"
also fails, but then it always did [maybe not necessary to fix, current robust scripts will remove trailing slash before Exist() check on folder name with trailing slash].

Heads up, AvsInit.avsi now fails due to above [MACHINE conditional AutoLoad dll stuff].

EDIT: AviSynthPlus_3.4.0_20191020.exe Works ok, AvisynthPlus-r3.5test_20200207-filesonly.7z dont.
Got it. Perfect task for home office.
pinterf is offline  
Old 19th March 2020, 06:39   #5234  |  Link
CrendKing
Registered User
 
Join Date: May 2019
Posts: 42
Is there a way to flush the cache without destroying the whole environment?

I'm developing a AviSynth DirectShow filter (similar to what ffdshow does). As you may know, when seeking happens, the whole stream will reset its reference time to 0. This means when the filter recreate the frames, all its frame number starts from 0 again. This completely messes up AviSynth' internal cache, causing it to return those "old" frames (because they have the same old frame numbers).

What I'm asking is that is there an API to invalidate all frame buffers? I read from http://www.avisynth.nl/index.php/Fil...deoFrameBuffer:

Quote:
a VideoFrameBuffer once new'd generally is not released until the IScriptEnvironment is deleted
so I'm currently deleting the clips and IScriptEnvironment and re-instantiating them, which seems unnecessary.

Last edited by CrendKing; 19th March 2020 at 06:47.
CrendKing is offline  
Old 19th March 2020, 09:13   #5235  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,527
They are valid until IScriptEnvironment delete.
pinterf is offline  
Old 19th March 2020, 09:15   #5236  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,527
Quote:
Originally Posted by StainlessS View Post
Exist() is now broken in 3.5. [on folders]
Behaviour on folders is fixed, plus added a new bool utf8 parameter.
pinterf is offline  
Old 22nd March 2020, 10:42   #5237  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,527
Test build, because there were huge internal changes along with some bug fixes.

With cherry-picking from Neo's early multithreading and ScriptClip fixes, old problems got solved.
And there was a week that I spent on Text filter having multiple sized fonts (mainly for helping Linux builds)

https://drive.google.com/open?id=1EI...AP5FF1uqKzWXyy

Code:
- Fix: Multithreading enhancements and fixes (Nekopanda, from Neo fork)
  - Fix old ScriptClip (runtime filters) issue 
    In this example "current_frame" variable was not seen by YDifferenceFromPrevious scripted within SubTitle
    resulting in "ERROR: Plane Difference: This filter can only be used within run-time filters" message
    Now this script finally works:
      SetLogParams("log.txt", LOG_DEBUG)
      ColorBars(width=640, height=480, pixel_type="yv12")
      ScriptClip(last, "Subtitle(String(YDifferenceFromPrevious))")
      Prefetch(4)
  - Fix deadlock of ScriptClip on MT
  - MT improvement
    - Allow multiple Prefetchers
    - Add argument to Prefetch to change # of prefetch frames without changing # of threads
    
    Prefetch (clip c, int threads, int "frames")
    
    In the original Plus, you could use only one Prefetch, but you can use any number of CUDA versions.
    Also, an argument has been added to specify the number of frames to prefetch.
    Prefetch (1,4) # Make 1 thread stand and prefetch 4 frames
    By doing so, flexible parallelization configuration is possible, such as pipeline parallelization.

    threads
    Number of threads. If it is 0, it passes without doing anything.

    frames
    Number of frames to prefetch.
    Again, if it is 0, it passes without doing anything.
- Fix: BuildPixelType: chroma subsampling of sample clip was ignored.
- POSIX: better behaviour under non-Windows because of having multiple sized fixed fonts, not only a single size=20 one.
  e.g. MessageClip(), Info(), Version(), ColorYUV "show", internal ApplyMessage
- Text filter: 
  - font types with 
    - "Terminus" fixed fonts added (12-14-16-18-20-22-24-28-32, regular + bold)
    - "Info_h" good old 10x20 fixed font kept under this name
  - much more international unicode characters (1354), use utf8=true under Windows
  - use fontname parameter (default "Terminus", other choice is "info_h")
  - use font_filename parameter (accepts BDF fonts at the moment - import is probably not too smart but worked for Terminus)
  - use size parameter (12 to 32, if no size is available, a smaller one is chosen but at least the smallest one)
  - new parameter: bold (default false)
- Info() filter: when parameter "size" < 0, font is automatically enlarged over 640x480
  (POSIX limit: minimum size is 12, maximum size is 32 - limited by available fixed fonts)")
- SIL OPEN FONT LICENSE added because of usage of Terminus fonts)
- able to build w/o GDI and font rendering engine under Windows, so that text-overlay filters 
  work like in POSIX version of AviSynth+ (mainly for my development test)
  Use with NO_WIN_GDI define.
- Fix: ReplaceStr when the pattern string to be replaced is empty
- New: 
  Exist() to have bool utf8 parameter
  This is another function to have utf8 option:
  Usage: b = Exist("Здравствуй.mkv",utf8=true). Avs file is saved as utf8 w/o BOM
- Fix: broken Exist for directories (regression appeared in 3.5.0)
- Fix: ColorYUV: really disable variable search when parameter "conditional" is false
- Development: 
  ScriptEnvironment::VSprintf: parameter (void *) is changed back to va_list.
  May affect C interface (avs_vsprintf) and CPP interface (ScriptEnvironment::VSprintf)
- Enhanced: Planar RGB to YUV 444 10-14 bits: more precision (32 bit float internally)
- Enhanced: Planar RGB to YUV 444 10-16 bits: AVX2 (speed improvement)
pinterf is offline  
Old 22nd March 2020, 18:16   #5238  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
Exist(), ReplaceStr(), Prefetch/Global stuff probs all gone, cheers P.

You are clearly self isolating, maybe current COVID-19 situation aint all bad

[I've just been coughing a little bit(just a couple of coughs), and throat is a bit dry, maybe just hypochondria, I can feel a bit of paranoia coming on]

EDIT: Gonna gobble up a few raw garlic cloves and a lump of ginger, probably of little use.

EDIT:
World Health Organization: Coronavirus disease (COVID-19) advice for the public: Myth busters
Quote:
Can eating garlic help prevent infection with the new coronavirus?

Garlic is a healthy food that may have some antimicrobial properties.
However, there is no evidence from the current outbreak that eating garlic has protected people from the new coronavirus.
https://www.who.int/emergencies/dise...c/myth-busters
__________________
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; 22nd March 2020 at 18:31.
StainlessS is offline  
Old 22nd March 2020, 18:27   #5239  |  Link
DJATOM
Registered User
 
DJATOM's Avatar
 
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 377
Quote:
Originally Posted by StainlessS View Post
You are clearly self isolating
Me too. Usually sitting at home, sometimes going to local mart to buy fresh food. No covid19 symptoms spotted so far, but last week I felt like I'd get sick soon, fortunately I'm fine now.
__________________
Me on GitHub
PC Specs: Ryzen 5950X, 64 GB RAM, RTX 2070
Notebook: Ryzen 7945HX, 64 GB RAM, RTX 4060, 17'' @ 240Hz @ 1440p
DJATOM is offline  
Old 22nd March 2020, 18:28   #5240  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by StainlessS View Post
I've just been coughing a little bit(just a couple of coughs), and throat is a bit dry, maybe just hypochondria, I can feel a bit of paranoia coming on
Same here.
Quote:
Originally Posted by StainlessS View Post
Gonna gobble up a few raw garlic cloves and a luma of ginger, probably of little use.
Some people recommended gargling with bleach. I'm sure it kills the virus but the side effects are apparently severe (death).
__________________
Groucho's Avisynth Stuff

Last edited by Groucho2004; 22nd March 2020 at 19:10.
Groucho2004 is offline  
Closed Thread

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 06:34.


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