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

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 12th February 2017, 23:04   #3021  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by vinnytx View Post
I have problems with Avisynth+ latest versions and Potplayer.
[...]
Another problem with Potplayer is that I can't hear audio unless I remove TimeStretch.dll plugin.
It appears this error message
[...]
Also, I had to remove ImageSeq.dll plugin because I had many Potplayer crashes with it
These Avisynth+ plugins that are normally found in plugins+ directory, are planned to be used together with specific avs+ version. From time to time, internal interface can change, not too frequently but changes. Since 17xx version there was two or three jumps in IScriptEnvirontment2 (this is that special interface), maybe these external plugins rely on that and break if e.g. an old external avs+ plugin is used with a new avs+ core.
That's why after a lot of dev build I made a release on r2420 and compiled those plugins again and have put them into the pack.

Well, but if you have handled the dll's together with avs+ core, and the problem still occurs then ... I don't know. Maybe Groucho's excellent AVSMeter tool can show you other issues with your plugins or installation.
pinterf is offline  
Old 13th February 2017, 00:21   #3022  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Quote:
Originally Posted by pinterf View Post
Thanks, fixed.
Converting String to VideoInfo:: pixel_type integer: Invoke this script function:
int ColorSpaceNameToPixelType (string ColorSpaceName)
That function already exists? What versions of Avisynth support it?

Because I have to write code that works both on Avisynth 2.6 and Avisynth+.

Also need the opposite: int to string. I guess calling Clip.PixelType does the job, since VideoInfo only returns an int.
MysteryX is offline  
Old 13th February 2017, 00:34   #3023  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Out of curiosity, what is the performance cost of calling a function via env->Invoke, in comparison to, say, a conversion via reflection in .NET?
MysteryX is offline  
Old 13th February 2017, 01:14   #3024  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
If env->Invoke called in your constructor then no problem, however if filter then it's constructor called at every invocation and so will
perform similar to within ScriptClip, with constructor overhead at every frame if called from within GetFrame().
No idea about .NET stuff.

EDIT: But without the script parsing overhead of ScriptClip.
__________________
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 ???
StainlessS is offline  
Old 13th February 2017, 06:33   #3025  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
MysteryX

I think PixelType() is what you want, can work in avs26 and avs+ and return string
__________________
See My Avisynth Stuff
real.finder is offline  
Old 13th February 2017, 20:41   #3026  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Quote:
Originally Posted by pinterf View Post
Weird means ........ /fill the missing words/
It's hard to find the words but... I think "weird" is the right word.


Code:
ConvertToRGB24()
CombinePlanes(planes="YUV", source_planes="RGB", pixel_type="YUV444P8")


Destination format complains if you specify a non-planar format, so it would be consistent to apply the same restriction for the input format.

Quote:
Originally Posted by pinterf View Post
Converting String to VideoInfo:: pixel_type integer: Invoke this script function:
int ColorSpaceNameToPixelType (string ColorSpaceName)
I still don't know if Avisynth 2.6 supports this but this is not something that should need to be exposed to the script interface. Scripts work purely with format as string and never see the underlying int. Only the c++ interface needs to work with the int value, so the only place that makes sense to do such a conversion is in the header file or custom c++ code.

Quote:
Originally Posted by real.finder View Post
I think PixelType() is what you want, can work in avs26 and avs+ and return string
Yes this has been mentioned already. Converting the other way to get an int, however, is different.

Also, ConvertToYV24() on YUVA444P8 isn't converting it to YUV444P8.

By the way, CombinePlanes is making things a lot easier for me. I wasn't sure about the components order in AvisynthShader... it is RGBA in 8-bit and BGRA in 16-bit. Now that's easy to deal with.

Last edited by MysteryX; 13th February 2017 at 21:21.
MysteryX is offline  
Old 13th February 2017, 21:59   #3027  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by MysteryX View Post
It's hard to find the words but... I think "weird" is the right word.
Code:
ConvertToRGB24()
CombinePlanes(planes="YUV", source_planes="RGB", pixel_type="YUV444P8")
Destination format complains if you specify a non-planar format, so it would be consistent to apply the same restriction for the input format.
Ahhh, thanks, good catch, never tried CombinePlanes with packed rgb inputs, while giving a different, but planar output type.
I decided that packed RGB inputs will be silently converted to planar rgb variant, to make the function transparent for the user. (The same logic is already working in ExtractR,G,B,A)
pinterf is offline  
Old 14th February 2017, 12:13   #3028  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
@pinterf
I was doing some testing with AVS+ last night and noticed that some error messages thrown in case of plugin problems are still very cryptic and not helpful.
For example, the same error message ("There is no function named...") is thrown if:

A function from 64 bit plugin in the 32 bit auto-load directory is used
*or*
The runtimes for a specific plugin are not installed

Tracking the error can be difficult, especially for people who are not so technically versed. There are hundreds of posts on this forum that can be traced back to missing runtimes. It's not difficult to test for bitness and missing dependencies prior to Loadplugin()/LoadLibraryEx(). If you are interested in implementing these tests you are welcome to re-use the code I already have in AVSMeter.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline  
Old 14th February 2017, 12:48   #3029  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
Plus, I just had a case of an error 0xc1 loading LSMASHSource.dll in MeGUI (using AviSynth+ as internal copy) in the German doom9/Gleitz forum, which could be solved by forcing a re-installation of L-SMASH Works in the MeGUI updater; the reason was a bit unclear, may have been a manual substitution with a 64-bit version of the DLL while MeGUI uses a 32-bit environment.

Until now, I was not even successful in discovering which category of errors this code 0xc1 belongs to. (May it be similar to Pascal's DosError?)
_

P.S.: Searching for the decimal value (193): MSDN System Error Codes

Quote:
ERROR_BAD_EXE_FORMAT
193 (0xC1)

%1 is not a valid Win32 application.
Apparently confirms.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid

Last edited by LigH; 14th February 2017 at 12:53.
LigH is offline  
Old 14th February 2017, 22:55   #3030  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Now this is weird.

My script plays fine in MPC-HC or VirtualDub. When opening in Windows Media Player, however, it crashes.

Code:
LWLibavVideoSource("video.mp4", cache=False)
ConvertToShader()
Script error: Invalid arguments to function 'ConvertToShader'. !?? It plays perfectly fine in MPC-HC. What's going on here?

That error might be of something else going on within the filter as it was crashing on the constructor at this line so I commented it

Code:
if (!vi.IsY() && !vi.Is420() && !vi.Is422() && !vi.Is444() && !vi.IsRGB())
	env->ThrowError("ConvertToShader: Source format is not supported.");
Source is YV12.

Last edited by MysteryX; 14th February 2017 at 22:57.
MysteryX is offline  
Old 15th February 2017, 14:25   #3031  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
378.66 Nvidia drivers and 10/12 bit decoding

New Features

Code:
[…]

Video SDK 8.0

High-bit-depth (10/12-bit) decoding (VP9/HEVC)
Another mosaic tile?
__________________
@turment on Telegram
tormento is offline  
Old 16th February 2017, 18:50   #3032  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
ConvertAudioToFloat

After applying ConvertAudioToFloat the audio still appears as 16-bit integer in VirtualDub.
Can it output PCM_FLOAT format? Tried with r2375.
__________________
VirtualDub2
shekh is offline  
Old 16th February 2017, 18:54   #3033  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by shekh View Post
After applying ConvertAudioToFloat the audio still appears as 16-bit integer in VirtualDub.
What does AVSMeter report (AVSMeter script.avs -i)?
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline  
Old 16th February 2017, 19:07   #3034  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Quote:
Originally Posted by Groucho2004 View Post
What does AVSMeter report (AVSMeter script.avs -i)?
Code:
AVSMeter 2.4.9 (x86) - Copyright (c) 2012-2017, Groucho2004
Query Avisynth info...                                                                                                   
AviSynth+ 0.1 (r2375, MT, i386) (0.1.0.0)
Query system info...                                                                                                     
Loading script...                                                                                                        
Number of frames:                  720
Length (hh:mm:ss.ms):     00:00:30.030
Frame width:                       720
Frame height:                      400
Framerate:                      23.976 (2500000/104271)
Colorspace:                      BGR64
Audio channels:                      6
Audio bits/sample:                  32 (Float)
Audio sample rate:               48000
Audio samples:                 1441442
__________________
VirtualDub2
shekh is offline  
Old 16th February 2017, 19:23   #3035  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
It may be the same problem I had in AVSMeter where it did not return the correct audio bits/sample in some cases. I'm now using VideoInfo::sample_type which seems to work fine.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline  
Old 16th February 2017, 19:29   #3036  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
I am looking at vfw interface where format is described by WAVEFORMATEX.
__________________
VirtualDub2
shekh is offline  
Old 16th February 2017, 20:08   #3037  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by shekh View Post
After applying ConvertAudioToFloat the audio still appears as 16-bit integer in VirtualDub.
Can it output PCM_FLOAT format? Tried with r2375.
Shekh, is below what you are after ?

Code:
OPT_AllowFloatAudio
global OPT_AllowFloatAudio = True  
This option enables WAVE_FORMAT_IEEE_FLOAT audio output. The default is to autoconvert Float audio to 16 bit. 

OPT_UseWaveExtensible
global OPT_UseWaveExtensible = True  
This option enables WAVE_FORMAT_EXTENSIBLE audio output. The default is WAVE_FORMAT_EX.
Note: The default DirectShow component for .AVS files, "AVI/WAV File Source", does not correctly implement WAVE_FORMAT_EXTENSIBLE
processing, so many application may not be able to detect the audio track. There are third party DirectShow readers that do work correctly. 
Intermediate work files written using the AVIFile interface for later DirectShow processing will work correctly if they use the DirectShow "File 
Source (async)" component or equivalent.

OPT_VDubPlanarHack
global OPT_VDubPlanarHack = True   v2.60
This option enables flipped YV24 and YV16 chroma planes. This is an hack for early versions of Virtualdub with YV24/YV16 support.

OPT_dwChannelMask
global OPT_dwChannelMask(int v)   v2.60
This option enables you to set ChannelMask. It overrides WAVEFORMATEXTENSIBLE.dwChannelMask[[1] which is set according to this table
0x00004, // 1   -- -- Cf
0x00003, // 2   Lf Rf
0x00007, // 3   Lf Rf Cf
0x00033, // 4   Lf Rf -- -- Lr Rr
0x00037, // 5   Lf Rf Cf -- Lr Rr
0x0003F, // 5.1 Lf Rf Cf Sw Lr Rr
0x0013F, // 6.1 Lf Rf Cf Sw Lr Rr -- -- Cr
0x0063F, // 7.1 Lf Rf Cf Sw Lr Rr -- -- -- Ls Rs
On Wiki:-
http://avisynth.nl/index.php/Interna...llowFloatAudio

EDIT: Snippet from TwriteAVI doc
Code:
See also Avisynth settings for WaveExtensible and Float output for compatible players (otherwise audio may be converted to 16bit on output
from avisynth to a player).

# For Float/WaveExtensible player eg MPC-HC (Else comment out below if Player not capable)
    Global OPT_UseWaveExtensible = (AudioChannels>2||AudioBits>16)      # If more than 2 channels or > 16 bit, set true (Also Float, ie > 16 bits).
    Global OPT_AllowFloatAudio   = (IsAudioFloat)                       # Must be set true to play in eg Media Player Classic - Home Cinema
__________________
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; 16th February 2017 at 20:14.
StainlessS is offline  
Old 16th February 2017, 20:25   #3038  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Quote:
Originally Posted by StainlessS View Post
OPT_AllowFloatAudio
Cool, problem solved
__________________
VirtualDub2
shekh is offline  
Old 18th February 2017, 23:10   #3039  |  Link
bxyhxyh
Registered User
 
Join Date: Dec 2011
Posts: 354
Hello. I'm not always online, so I don't know the progress of AVS+ with AvsPmod. Please tell me about it.

AvsPmod from this post gives error and crashes when it's starting to launch.
Code:
Traceback (most recent call last):
  File "run.py", line 49, in <module>
  File "avsp.pyo", line 18881, in main
  File "wx\_core.pyo", line 7981, in __init__
  File "wx\_core.pyo", line 7555, in _BootstrapApp
  File "avsp.pyo", line 18868, in OnInit
  File "avsp.pyo", line 5229, in __init__
  File "avsp.pyo", line 6290, in defineFilterInfo
  File "avsp.pyo", line 6648, in getFilterInfoFromAvisynth
IndexError: string index out of range
Normal AvsPmod doesn't crash. But it either gives me error "Error loading Avisynth" or red frame when I call ConvertTo16bit()
Is it how it is now? Or there is problem on my end?

Last edited by bxyhxyh; 19th February 2017 at 00:12.
bxyhxyh is offline  
Old 18th February 2017, 23:20   #3040  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Quote:
Originally Posted by bxyhxyh View Post
Hello. I'm not always online, so I don't know the progress of AVS+ with AvsPmod. Please tell me about it.

AvsPmod from this post gives error and crashes.
Code:
Traceback (most recent call last):
  File "run.py", line 49, in <module>
  File "avsp.pyo", line 18881, in main
  File "wx\_core.pyo", line 7981, in __init__
  File "wx\_core.pyo", line 7555, in _BootstrapApp
  File "avsp.pyo", line 18868, in OnInit
  File "avsp.pyo", line 5229, in __init__
  File "avsp.pyo", line 6290, in defineFilterInfo
  File "avsp.pyo", line 6648, in getFilterInfoFromAvisynth
IndexError: string index out of range
Normal AvsPmod doesn't crash. But it either gives me error "Error loading Avisynth" or red frame when I call ConvertTo16bit()
Is it how is it now? Or there is problem on my end?
Maybe because AvspMod has not been updated to support AVS+ high bit depth colorspaces. Does your script work if the output is 8-bit.

---

A while back on IRC, Line0 mentioned something about adding high bit depth support to AvsPmod but I don't know if there's been any progress made. Here's an old pull request: https://github.com/AvsPmod/AvsPmod/pull/28
Reel.Deel 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 23:44.


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