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 14th July 2005, 03:14   #181  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
axsd,

Oops looks like I lost a line of code. Try this replacment avisynth.dll, just replace the one in your windows system directory.

IanB
IanB is offline   Reply With Quote
Old 14th July 2005, 03:53   #182  |  Link
azsd
6502 fan
 
azsd's Avatar
 
Join Date: Sep 2004
Location: forest
Posts: 131
tested.
parse speed get allright now.

thx IanB!
azsd is offline   Reply With Quote
Old 15th July 2005, 00:15   #183  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,219
I believe I have found a bug in the Normalize() filter.
If you do something like DirectShowSource("file.avi").Normalize() then the audio output will be silent. If you do Avisource("file.avi"), or DirectShowSource("file.mpg") then it works fine. Seems to be an issue with loading avi through directshowsource.
Zarxrax is offline   Reply With Quote
Old 15th July 2005, 03:23   #184  |  Link
azsd
6502 fan
 
azsd's Avatar
 
Join Date: Sep 2004
Location: forest
Posts: 131
I have same slient result with load some mp2 files with DirectShowSource() .
the problem is reproduce,but occured with special audio file,not all audio clip failed in normalize,it may cause by you audio content in your avi between mpg,or matrix mixer pluged in dshow graphic but not in vfw render path.
azsd is offline   Reply With Quote
Old 15th July 2005, 04:11   #185  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
Do a Normalize(show=true).Info()

1. What is the calculated normalizing factor.
2. What is the peaks frame number.
3. What is the audio sample type.
4. What is the total frame count.

IanB

P.S. Is the audio codec being used capable of seeking? If it cannot then this is the expected behaviour. Normalize reads all the audio samples looking for the maximum value then tries to seek back to the begining, if seeking is not supported DSS just returns silence.

Last edited by IanB; 15th July 2005 at 14:19.
IanB is offline   Reply With Quote
Old 15th July 2005, 19:57   #186  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,219
Amplify Factor: 1.1262
Amplify DB: 1.0323
At frame: 383

Sample Type: Integer 16 bit
Total Frame Count: 650
Audio Codec: PCM
Zarxrax is offline   Reply With Quote
Old 16th July 2005, 08:10   #187  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
It's DirectShowSource() bug:- Reading the very end of the audio stream sets the internal "end_of_stream" flag. The read code checks this on entry and bails when it's set. Nothing ever resets this flag. Fix coming slowly

IanB

Edit: After hitting the end of the stream, and seeking back to the begining the stream does not render correctly, it sort of has jitter between the returned block of samples. Much research required....

Last edited by IanB; 17th July 2005 at 15:05.
IanB is offline   Reply With Quote
Old 17th July 2005, 14:11   #188  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
bug-report: http://forum.doom9.org/showthread.ph...962#post687962

The script crashes (ie VDub just quits when loading the script) with v2.56b3 and beyond.
Wilbert is offline   Reply With Quote
Old 17th July 2005, 17:44   #189  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
Wilbert,

Was stack overflow from Invoke, fix in CVS, see .../core/avisynth.cpp v1.25

IanB
IanB is offline   Reply With Quote
Old 18th July 2005, 02:47   #190  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,219
Quote:
Originally Posted by IanB
It's DirectShowSource() bug:- Reading the very end of the audio stream sets the internal "end_of_stream" flag. The read code checks this on entry and bails when it's set. Nothing ever resets this flag. Fix coming slowly


IanB

Edit: After hitting the end of the stream, and seeking back to the begining the stream does not render correctly, it sort of has jitter between the returned block of samples. Much research required....
Sorry to trouble you more, but I have come across a few files that also don't return any audio after using normalize while using Avisource(), so perhaps this is a problem in avisource too. One of the files used ADPCM codec, the other is MP3.
Zarxrax is offline   Reply With Quote
Old 18th July 2005, 04:01   #191  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
I noticed that with avisource as well. It's because fZeroRead gets set and is never reset. Also, with the directshowsource fix, wouldn't it be better to be setting end_of_stream=false before calling StartGraph() at the end of the seek method? Otherwise, it just sits there until startgraphs WaitForSingleObject call times out because receive returns immediately while end_of_stream is still set to true and it never sets the event... at least that is what happens on my comp.

Also, there seems to be a typo in avisynth_c.h. Two lines at the beginning use "ACSC_USE_STDCALL" while throughout the rest of avisynth_c.h and avisynth_c.cpp it is checking "#ifndef AVSC_USE_STDCALL" notice the C and V switch. I think this was pointed out once in an old thread but it is still there. Or is it really suppose to be that way for some odd reason ?

Last edited by tritical; 18th July 2005 at 04:12.
tritical is offline   Reply With Quote
Old 18th July 2005, 04:24   #192  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
Not sure what to do about these stuffed ACM (and DirectShow) codecs. I tried a simple cheat in Normalize() of not getting the last sample, but it doesn't help, you have to avoid having the codec access and decode the last segment. This can mean stopping a few 10,000 samples before the end for a codec with good compression.

May be a float option specifying seconds from the the end to stop the pass 1 scan, but this is horribly ugly and cludgey.

Thorts anybody?

@tritical,

fZeroRead good observation.

Before StartGraph() make sense.

"A[CV]SC_USE_STDCALL" hmmm it's certainly confusing but changing it will change the entrypoint name it searches for.

ACSC_USE_STDCALL is defined, so AVSC_CC = "__stdcall"

AVSC_USE_STDCALL is not, so entrypoint is "avisynth_c_plugin_init"

Guess we need to survey the C pluggins and see whats being done.

Never just rains but it sure does pour.

IanB

Last edited by IanB; 18th July 2005 at 06:46.
IanB is offline   Reply With Quote
Old 20th July 2005, 07:48   #193  |  Link
cweb
Registered User
 
cweb's Avatar
 
Join Date: Oct 2002
Location: The Pandorica
Posts: 527
Is using avisource safe in this version, if you don't do a Normalize?
__________________
PC specs for bug reports: Intel Core i7-4790K @4Ghz Win10(Linux VM) PCI express NVIDIA RTX 2060 SUPER graphics card
http://twitter.com/cwebdesign
cweb is offline   Reply With Quote
Old 20th July 2005, 10:17   #194  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
It should be no different to previous version regarding the audio source statements, (I haven't worked on them, yet). As far as I can tell they have always been broken after accessing the end of the stream in some mode or other.

Normalize has been given a full rework, so now surely trips up the other latent bug. But now it will correctly normalize all formats and channels. Previously it only normalized 1/(number of channels) of the data, hence only tripped the bug for mono audio.

As a work around, run Normalize(show=true) and then edit your script to use Amplify(number displayed), this also has the benefit of not having to reparse the audio track every time you reload the script, it can take several minutes.

IanB
IanB is offline   Reply With Quote
Old 20th July 2005, 18:13   #195  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,219
Quote:
Originally Posted by IanB
Normalize has been given a full rework, so now surely trips up the other latent bug. But now it will correctly normalize all formats and channels. Previously it only normalized 1/(number of channels) of the data, hence only tripped the bug for mono audio.

IanB
Does this mean that for stereo tracks, normalize is silencing one channel and leaving only mono audio? Or does it leave both channels intact?
I ask because I'm currently working on a project intended for public viewing which involves nearly 400 video clips, each with their own avisynth script using the normalize function, so I can't really afford to be screwing up all the audio.
Zarxrax is offline   Reply With Quote
Old 22nd July 2005, 00:29   #196  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
@Zarxrax,

No, on the sampling pass it only looked at 1/n samples, hence possibly/probably missed the highest peak. On the amplify pass it processed all the data in all the channels but possibly using the wrong factor. If you are interested have a look at the CVS diffs for audio.cpp

IanB
IanB is offline   Reply With Quote
Old 7th August 2005, 23:17   #197  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
return to cache_range question.
What i must set in plugin for pure spatial processing:
child->SetCacheHints(CACHE_RANGE, 0);
or
child->SetCacheHints(CACHE_RANGE, 1);
or
child->SetCacheHints(CACHE_NOTHING, 0);
or
nothing ?

and what for temporal procesing (use prev, cur, next frames):
child->SetCacheHints(CACHE_RANGE, 3); ?
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Old 8th August 2005, 02:24   #198  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
@Fizick,

For pure spatial processing do nothing, the default is optimized for this case. Only diagnostic filters like the time measuring ones should ever use CACHE_NOTHING. Remember the case in scripts with 2+ filters attaching to 1 other filter.

The CACHE_RANGE value is currently a diameter to match the behaviour of previous AVS versions, so 3 is the right value. Around post #170 tritical and myself briefly discussed the issue, it is still unresolved, please express your (and everybody else) thoughts on the matter.

IanB
IanB is offline   Reply With Quote
Old 8th August 2005, 20:12   #199  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
Of course, i read your discussion with Tritical.
O.K., here is my thoughts.
1. For pure spatial we must use child->SetCacheHints(CACHE_RANGE, 0);
Almost all old spatial filters use this settings.
2. Yes, i suspect of some old bug with cache.
Firstly I set CACHE_RANGE to radius (in old avisynth versions). But later i discover, that the speed of my temporal filters was decresead. So, I usually experimentally increase the range to increase the speed. So, now i understand, that i empirically use it as diameter. But some my filters probably use not optimal setting. Degrainmedian and DeSpot use range=2, because of range=1 result in slowdown (probably 3 will better for prev, currennt and next frame?) But in DePan I increased it some more (reserve).
IMHO, old avisynth (2.5.5) do not strictly consider cache range as diameter,
it was some mix (bugs).
So, It is really not easy issue.
Of course, i can recompile my plugins.
IMHO, the most important problem is not using new plugins in old avisynth versions,
but using old plugins in new avisynth.
However, if new cache strategy is more tolerant to wrong cache range setting,
it is not issue.
So, we must test new super-cache strategy.
But when I look to cache.cpp in CVS, i see that all cache_range code is disabled (commented), and some debug messages is there.
Is it the same code as in 2.5.6beta4 ?
4. sorry for my long and stange post.
Can we
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Old 9th August 2005, 08:41   #200  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
Quote:
Originally Posted by Fizick
1. For pure spatial we must use child->SetCacheHints(CACHE_RANGE, 0);
Almost all old spatial filters use this settings.
You should not do this, this is very bad, particularly for the older AVS versions, the new cache is somewhat defensive about this but not completely immune.
Code:
V1=AviSource("blah.avi")
V2=V1.SomeFilter()  # This is a bad filter, it does (CACHE_RANGE, 0)
V3=V1.OtherFilter() # Because of the above all frames must be built
ThirdFilter(V2, V3)   # at least 2 times
I have thought about catching crazy Hint settings, my initial cut is to just nail excessive values but I can see I should also defend against uselessly low values as well. For all AVS versions in general non-temporal filters should not play with the cache hinting. Doing nothing says I am a normal spacial domain only filter.
Quote:
2. Yes, i suspect of some old bug with cache.
Firstly I ... experimentally increase the range to increase the speed. So, now i understand, that i empirically use it as diameter. But some my filters probably use not optimal setting. Degrainmedian and DeSpot use range=2, because of range=1 result in slowdown (probably 3 will better for prev, current and next frame?) But in DePan I increased it some more (reserve).
Practically it turns out to be Diameter. For the classic "Prev, Current and Next" case a range of 2 is appropriate if the filter askes for the frames in the right order, i.e. Prev (last current), Current (last next) and the Next (built a new, trashes prev). If you ask for Next 1st then you need a range of 3 and of course the user can always use the Reverse() filter which inverts the above argument, so you should probably use 3.
Quote:
So, It is really not easy issue.
Amen! Keeping consistancy of interface make things like this very difficult
Quote:
Of course, i can recompile my plugins.
This generally won't help much, the problems are in the various versions of AviSynth.Dll, but fixes like range from 2 to 3 can't hurt.
Quote:
IMHO, the most important problem is not using new plugins in old avisynth versions,
but using old plugins in new avisynth.
However, if new cache strategy is more tolerant to wrong cache range setting,
it is not issue.
Hence the ultimate decission to go with Diameter. This make all filters old and new as consistant as possible across all AVS versions.
Quote:
So, we must test new super-cache strategy. But when I look to cache.cpp in CVS, i see that all cache_range code is disabled (commented), and some debug messages is there. Is it the same code as in 2.5.6beta4 ?
Testing, now there is a really good idea and of course reporting.

The cache_range functionality (protected VFB's) is folded into the main code now, the old code, commented out, is for reference so as problems or short commings get reported I can compare easily old and new code. I will probably delete it in the final released version of 2.56.

IanB
IanB 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 12:31.


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