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 Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 22nd February 2021, 20:30   #581  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Thanks for investigating.

I'm sorry that it's not easy migrating to Python 3.

I think most MS tools support BOM but generally BOM is not very popular, it's fine as an option but should be avoided as the default choice.
stax76 is offline   Reply With Quote
Old 22nd February 2021, 22:13   #582  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 1,001
Quote:
Originally Posted by stax76 View Post
Thanks for investigating.

I'm sorry that it's not easy migrating to Python 3.

I think most MS tools support BOM but generally BOM is not very popular, it's fine as an option but should be avoided as the default choice.
AvsPmod has always saved new scripts in utf-8. Only other programs do not recognize this until there are characters outside of the ASCII table.
When I set the bom the script is recognized as utf-8 with bom. Ascii is just the same as utf-8 Latin1, therefore Ansi is recognized by other programs.
Or the python encoder refuses to encode utf-8 if the characters are only within Ascii

You can test it.
Paste a few Japanese characters into a new script and save it. It is recognized as utf-8 with bom.

Why you don't accept Ansi in your tools? It is not a problem to process both. Isn't a hassle.

Edit:
Save a file with only Ascii characters with Notepad++ as utf-8 without bom. And then open it, Ansi is displayed as the coding.

Edit 2:
https://github.com/staxrip/staxrip/w...indows-10-1903
How do you want to recognize Ansi?
Code:
On Windows 10 1903 or higher all these apps expect AviSynth scripts to be UTF-8 encoded, ANSI encoded scripts will cause errors.
__________________
Live and let live

Last edited by gispos; 23rd February 2021 at 17:29.
gispos is offline   Reply With Quote
Old 22nd February 2021, 23:26   #583  |  Link
Fjord
Registered User
 
Join Date: Dec 2005
Location: Denmark
Posts: 52
RESOLVED: HBD restoration script crashes AvsPmod, but runs ok in VD2

EDIT1: The crash was due to a bug in RemoveDirt 0.9.2, corrected by pinterf in RemoveDirt 0.9.3. The script shown here does not crash with the new RemoveDirt.dll 0.9.3.
--------------------
I started getting crashes when I added a resizer at the start of my film restoration script for ProRes HQ 10-bit scans. It turns out not related to the input or the resizer, but rather the width of the clip going through the script. Height doesn't seem to cause the crash. I have boiled it down to the following script, with ColorBarsHD as input, which crashes AvsPmod (v2.6.6.6 or .7 x64), but runs ok in VirtualDub2 (build 44282 x64) -- both using AviSynth+ 3.7.0 (r3382 x64). Since this appears to be an AvsPmod issue, I post here -- Let me know if I should be posting somewhere else.

AvsPmod crashes hard (access violation) on the following simplified film restoration script, for 10-bit source (ie YUV444P10, YUV422P10, YUV420P10), when frame width is multiple of 2 or 4. AvsPmod exits abruptly when F5 is pressed, or with first advance to next frame.

However, it runs fine in VirturalDub2, or when frame width is multiple of 8 -- or the source is 8-bit. The frame height doesn't seem to matter. The crashes don't seem to leave a useful traceback, and I am not familiar with AviSynth/AvsPmod debugging, so I don't know where the problem occurs.

Plugins used are latest pinterf x64 versions of MVTools2 (v2.7.44 20201214), RGTools (v1.1 20210104), RemoveDirt (v0.9.2 20190324) -- loaded manually, directly from the unzipped downloads.

The only error information I get are an AvsPmod error pop-up (most times). The first occurs if AvsPmod opens and runs the script on startup:



The second is when the script is run using F5 key:


I did get the following AviSynth warning message on one test run, when I enabled logging with SetLogParams(), but mostly no error messages or warnings for crashes.
Code:
WARNING: A plugin or the host application might be causing memory leaks.
I removed all other code and filters in the script that didn't make a difference for this example.

Does this cause a crash for anyone else?
What steps should I take to find the cause of the crash?

Stripped-down reproducible error script.
Code:
/*

This script crashes AvsPmod (v2.6.6.7 x64), but runs ok in VirtualDub2 build 44282
both running AviSynth+ 3.7.0 (r3382, 3.7, x86_64)

This script is a stripped-down version of a johnmeyer film restoration script, adapted for high bit depth (10-bit)

*/

ClearAutoloadDirs()		# clear autoloader list, to manually load plugins

PluginsFolder = "C:\Users\DRC\Documents\8mm\AVISynth\Plugins"

LoadPlugin(PluginsFolder + "MVtools2\mvtools-2.7.44-with-depans20201214\x64\mvtools2.dll")
				# pinterf v2.7.44 (20201214) x64

LoadPlugin(PluginsFolder + "RgTools\RgTools-v1.1\x64_LLVM_build\RgTools.dll")
				# pinterf v1.1 (20210104) x64 LLVM Clang

LoadPlugin(PluginsFolder + "RemoveDirt\RemoveDirt-0.9.2\x64\RemoveDirt.dll")
				# pinterf v0.9.2 (20190324) x64

#~ Wsrc2 = 888   Hsrc2 = 640		# 888x640 runs ok  -- width 888 & height 640 multiples of 8
#~ Wsrc2 = 890   Hsrc2 = 640		# 890x640 CRASHES AvsPmod  -- width 890 is multiple of 2, height 640 multiples of 8
Wsrc2 = 892   Hsrc2 = 640		# 892x640 CRASHES AvsPmod  -- width 892 is multiple of 4, height 640 multiples of 8

src2 = colorbarsHD( Wsrc2, Hsrc2, pixel_type="YUV444P10" ).killaudio()

stabcrop = RemoveDirtMC( src2, limit=51, _grey=FALSE, show=FALSE )

return stabcrop

#===================================================================================================

function RemoveDirtMC( clip input, int "limit", bool "_grey", bool "show" )
{

	prefiltered = RemoveGrain( input, 2 )
	superfilt = MSuper( prefiltered, hpad=32, vpad=32, pel=2 )
	super = MSuper( input, hpad=32, vpad=32, pel=2 )

	bv1 = MAnalyse( superfilt, isb=true,  blksize=16, overlap=2, delta=1, truemotion=true )
	fv1 = MAnalyse( superfilt, isb=false, blksize=16, overlap=2, delta=1, truemotion=true )
 
	backw = MFlow( input, super, bv1 )	
	forw  = MFlow( input, super, fv1 )

	clp = interleave( forw, input, backw )
	  
	clensed = clp.Clense()
	alt = clp.RemoveGrain( 2 )

	clp = RestoreMotionBlocks( clensed, clp, alternative=alt,	\
				pthreshold=6, cthreshold=8, gmthreshold=40,	\
				dist=3, dmode=2, debug=false, noise=limit, noisy=4, grey=_grey )
								
	clp = clp.SelectEvery( 3, 1 )	# select every third frame, starting at frame 1 (second frame)
	
	return clp
}
When I verified the crash with the above code, using load script in a clean AvsPmod (no other tabs), it does crash, and interestingly the preview window is corrupted and shows some slider/toggles that I did not create, and have not seen before:


Where did these come from?
EDIT2: The spurious slider toggles came from forum [URL=...] [IMG] and [CODE] tags in my avs script comments, that AvsPmod parsed as slider tags.

Last edited by Fjord; 23rd February 2021 at 21:38. Reason: 1) Mark as resolved. 2) Explain unexpected slider toggles.
Fjord is offline   Reply With Quote
Old 23rd February 2021, 17:14   #584  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 1,001
Hello Fjord,
I just tested it, like you crashed.
In VirtualDub it works, with 8 bit it works that put me on the right track. Because internally AvsPmod only works with 8 bits, so errors caused by a different bit color resolution are hardly possible.

VirtualDub2 uses a different avisynth interface (vfw).
So I tried AviSource with success.

In a new script (tab) open your script with AviSource("your script")
The error must probably come from avisynth.
__________________
Live and let live
gispos is offline   Reply With Quote
Old 23rd February 2021, 17:52   #585  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
More specifically the error comes from RemoveDirt.dll, which I'm gonna fix soon (an SSE2 load from unaligned address caused a C0000005 exception there)
EDIT: check https://github.com/pinterf/RemoveDirt/releases

Last edited by pinterf; 23rd February 2021 at 18:17.
pinterf is offline   Reply With Quote
Old 23rd February 2021, 18:56   #586  |  Link
Fjord
Registered User
 
Join Date: Dec 2005
Location: Denmark
Posts: 52
Thanks gispos for confirming the crash and clarifying that AvsPmod only uses 8-bits.
Thanks Ferenc for identifying RemoveDirt.dll (RepairMotionBlocks) as the cause of the crash, and the super quick fix -- new version of RemoveDirt 0.9.3.

My script now runs fine, also with odd frame dimensions (non-mod2) for YUV444P10. (mod2 of course required for YUV422P10 or YUV420P10).
I will mark my crash post as resolved.
Fjord is offline   Reply With Quote
Old 23rd February 2021, 18:58   #587  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 1,001
That was fast
__________________
Live and let live
gispos is offline   Reply With Quote
Old 23rd February 2021, 19:34   #588  |  Link
Fjord
Registered User
 
Join Date: Dec 2005
Location: Denmark
Posts: 52
gispos, I figured out where the odd slider/toggles came from, at the bottom of my crash post above. It's a markup conflict.

To verify my script in the crash post, I literally pasted my entire Doom9 post from the post edit window into a new .avs file, and marked the non-code text as comments with # or /*. When I ran the script in AvsPmod, AvsPmod interpreted the URL, IMG and CODE post markup (in brackets) in the post as AvsPmod slider toggle codes!

I can't show how this now looks in the script, because Doom9 interprets them as post markup. But now there are "URL=1" and "IMG=1" (in brackets) in the script, where the URL= and IMG markup had been for my images. Weird!

(anybody know how to display a literal bracket character in a Doom9 post without being interpreted as start of a post markup?)
Fjord is offline   Reply With Quote
Old 23rd February 2021, 20:59   #589  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Here are some escaped brackets: [lala]

Use the noparse tag around the desired text.
videoh is offline   Reply With Quote
Old 23rd February 2021, 21:24   #590  |  Link
Fjord
Registered User
 
Join Date: Dec 2005
Location: Denmark
Posts: 52
Thanks videoh for the noparse tip: [noparse]xxx[/noparse]

Is there a similar "noparse" escape in AvsPmod, to "comment out" slider tags, so they don't get used? Even better, a noparse toggle, to turn off and on display of slider sections?
Fjord is offline   Reply With Quote
Old 23rd February 2021, 21:33   #591  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Don't know about AvsPmod. Hopefully author will enlighten us.
videoh is offline   Reply With Quote
Old 24th February 2021, 17:23   #592  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 1,001
Quote:
Originally Posted by Fjord View Post
Thanks videoh for the noparse tip: [noparse]xxx[/noparse]

Is there a similar "noparse" escape in AvsPmod, to "comment out" slider tags, so they don't get used? Even better, a noparse toggle, to turn off and on display of slider sections?
Ok, /* (Block comment) will be ignored. # (Comment) works corectly.
Seems to be a minor bug or was ignored. This is placed at the very end of the todo list.

You just have to stick to certain rules and [< >] is reserved for user sliders. It's not an HTML editor.
__________________
Live and let live
gispos is offline   Reply With Quote
Old 24th February 2021, 18:35   #593  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
Quote:
Originally Posted by gispos View Post
Ok, /* (Block comment) will be ignored. # (Comment) works corectly.
Seems to be a minor bug or was ignored. This is placed at the very end of the todo list.
Wait, what?

I generally use

Code:
Some code

#this is a comment

some code
however when I have to comment out large parts of a huge script, I use

Code:
Some code

/*
commented out stuff
commented out stuff
commented out stuff
*/

some code

Are you actually saying that you're planning to remove /* */ support or did I get it wrong?
'cause so far it has been working like a charm for me.
FranceBB is offline   Reply With Quote
Old 24th February 2021, 22:09   #594  |  Link
Fjord
Registered User
 
Join Date: Dec 2005
Location: Denmark
Posts: 52
Slider tags are active in block comments /* */

The forum tags in my script were definitely unintentional, so I have no interest in protecting that sort of tag. The forum tags were in a block comment in my script, and were parsed as section toggle tags by AvsPmod.

I checked the parsing of slider tags in script comments, and confirm that slider, separator and section toggle tags [< >] and [ ] [/ ], are active inside block comments /* */ as well as in script code. They are not active in # or #~ comments.
Fjord is offline   Reply With Quote
Old 24th February 2021, 23:44   #595  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 1,001
Quote:
Originally Posted by FranceBB View Post
Wait, what?

I generally use

Code:
Some code

#this is a comment

some code
however when I have to comment out large parts of a huge script, I use

Code:
Some code

/*
commented out stuff
commented out stuff
commented out stuff
*/

some code

Are you actually saying that you're planning to remove /* */ support or did I get it wrong?
'cause so far it has been working like a charm for me.
No, no no fear.
It's about the user slider characters [< >] which are also incorrectly found in a /* block comment.
__________________
Live and let live
gispos is offline   Reply With Quote
Old 25th February 2021, 09:19   #596  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
Ah, got it. No problem then.
FranceBB is offline   Reply With Quote
Old 25th February 2021, 21:53   #597  |  Link
pcroland
Registered User
 
Join Date: Mar 2014
Location: Hungary
Posts: 115
Hi!

I updated to the latest version (2.6.6.7) and noticed that framestepping with the arrow keys is really slow. I'm working on a project where I have tons of plugins and scripts being used so the initial load takes a long time, but playing the script works fine (with ~25fps). In the current version playing it works fine but framestepping is really slow, like 2-3fps (holding down arrow). I checked some versions and 2.6.6.0 introduced the slowdown. I tried turning off "Constantly update video while dragging", "Refresh preview automaticaly" and "Video > Video play > Use separate thread" but none of them solved the issue.

Also, could someone explain what "Constantly update video while dragging" and "Refresh preview automaticaly" actually do? The first reloads all the plugins for any kind of frame step and the second one also but when I switch tabs?

I noticed that "Load fonts and colors backup" does not restore the ticked monospace fonts option. Is that on purpose?

Another bug is when you open the sidebar with a lot of plugins, it's really laggy to scroll in them with both the mouse wheel and dragging the bar. Resizing the image window is also laggy if the sidebar is opened: https://i.kek.sh/rzVUZxLMrjB.gif

And I have a suggestion btw: It would be nice if the FPS value would be a little more precise. For example when I have 23.976fps, you can't know if it's proper 24000/1001 or 23976/1000 FPS just by looking at the FPS number.

Last edited by pcroland; 26th February 2021 at 01:37.
pcroland is offline   Reply With Quote
Old 26th February 2021, 18:51   #598  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 1,001
Quote:
Originally Posted by pcroland View Post
Hi!

I updated to the latest version (2.6.6.7) and noticed that framestepping with the arrow keys is really slow. I'm working on a project where I have tons of plugins and scripts being used so the initial load takes a long time, but playing the script works fine (with ~25fps). In the current version playing it works fine but framestepping is really slow, like 2-3fps (holding down arrow). I checked some versions and 2.6.6.0 introduced the slowdown. I tried turning off "Constantly update video while dragging", "Refresh preview automaticaly" and "Video > Video play > Use separate thread" but none of them solved the issue.
It's not going any slower than usual for me.
But I look at that. Try turning off the zoom 'Antialiasing'
Edit:
Test that with a fresh AvsPmod.
Maybe something got mixed up with the keyboard shortcuts and two functions are carried out.
Quote:
Originally Posted by pcroland View Post
Also, could someone explain what "Constantly update video while dragging" and "Refresh preview automaticaly" actually do? The first reloads all the plugins for any kind of frame step and the second one also but when I switch tabs?
Constantly update video while dragging. This is available as a tooltip when you move the mouse over it.
'Update the video constantly when dragging the frame slider'

Refresh preview automatically. This is available as a tooltip when you move the mouse over it.
'Refresh preview when switch focus on video window or change a value in slider window'
open eyes
Quote:
Originally Posted by pcroland View Post
I noticed that "Load fonts and colors backup" does not restore the ticked monospace fonts option. Is that on purpose?
Well if I have time to spare.
Quote:
Originally Posted by pcroland View Post
Another bug is when you open the sidebar with a lot of plugins, it's really laggy to scroll in them with both the mouse wheel and dragging the bar. Resizing the image window is also laggy if the sidebar is opened: https://i.kek.sh/rzVUZxLMrjB.gif
I've just tried 100 entries. I expanded all entries so that there were 300 entries.
Everything runs smoothly for me, there is no jerking (Win7). I suspect that your system is causing the problem.
But I'll look at it again.
Quote:
Originally Posted by pcroland View Post
And I have a suggestion btw: It would be nice if the FPS value would be a little more precise. For example when I have 23.976fps, you can't know if it's proper 24000/1001 or 23976/1000 FPS just by looking at the FPS number.
Video> Video information, as it is specified in more detail.

And now I almost forgot:
Please go to the options for the user sliders and enter 'trim' in the text field below. And enter all filters (with spaces) that do not necessarily have to be displayed in the sliders. You can still show them later 'Context menu Slider window'
__________________
Live and let live

Last edited by gispos; 26th February 2021 at 19:20.
gispos is offline   Reply With Quote
Old 26th February 2021, 20:17   #599  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
Hi gispos,
I'm not sure whether this fits into AVSPmod or Avisynth Development, but... I'm not sure which one is to "blame".
I was trying ASSRender and I noticed an odd behavior about something else.
I have a video in HuffYUV encoded as NV12 (so a particular version of yv12), which is semi-planar as it has two planes instead of three: one for luma and another plane for both the two chroma components which are interleaved.
Now, when I indexed it with FFMpegSource2, it worked just fine, but here is the thing: AVSPmod was showing "yv12" instead of "NV12", so I thought it was actually yv12, so a proper 4:2:0 planar (instead of an half-interleaved crap) at 8bit and I used assrender with the appropriate subtitle track. Of course, it reported the issue about the colorspace not being supported.
As I convert it to yv24 for instance, it works like a charm.
Same goes if I use ConvertBits(10), it works like a charm as Avisynth internally brings it to 4:2:0 planar 10bit.
So, I thought AVSPmod was to "blame" for reporting it as yv12 instead of as NV12, but here's the thing: as I tried to convert it to yv12 with Converttoyv12(), the command was simply ignored by Avisynth, the NV12 was passed through and assrender prompted the colorspace not supported issue.
So... in a nutshell, who is to blame?

1) AVSPmod for not reporting NV12 and reporting it as YV12?
2) Avisynth for not signalling that it's actually NV12 thus making AVSPmod report it incorrectly?
3) FFMpegSource2 for telling Avisynth "yeah, fine, go ahead, it's yv12" while it's really serving an NV12?

Just asking, 'cause it felt weird.
I'm using the latest version of AVSPmod and the very latest version of Avisynth+ x86.
FranceBB is offline   Reply With Quote
Old 26th February 2021, 21:13   #600  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 1,001
The color space name is taken directly from avisynth plus. Only if nothing is returned the video information is used, i.e. vi.is_yv12()
Whether avisynth or FFMpegSource2 is the culprit I can not tell you, but I am 99% sure that it is not AvsPmod.
__________________
Live and let live
gispos is offline   Reply With Quote
Reply


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 20:50.


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