StainlessS
8th June 2023, 21:01
CashTest(), Debug tool.
Originally prompted by this thread:- https://forum.doom9.org/showthread.php?p=1682827#post1682827
And earlier version:- https://forum.doom9.org/showthread.php?p=1744232#post1744232
And recent user Flossy_Cake similar-ish avs script to do the same:- https://forum.doom9.org/showthread.php?p=1988156#post1988156
CacheTest(), by StainlessS @ Doom9.
CacheTest(clip c, String "text"="", String DvChar="", Bool "Always"=False, Bool "Silent"=False)
CacheTest() Sends text message to DebugView when requested frame is "Out Of Sync", ie not previous frame + 1.
Insert between filters to see if there are any repeat requests for frame, or out of sync frame requests.
Requires DebugView, [ DebugView v4.90, @ Micro$oft:- https://learn.microsoft.com/en-us/sysinternals/downloads/debugview ]
DebugView captures debug messages on your local machine (or network) and shows them in a window, can also save to file.
These messages may be output by the system, or eg graphics card driver, or some other program on a machine.
[really annoying when nVidia floods debug logs in some supposedly non beta drivers].
You can add a DebugView Filter via DebugView Edit menu, to only capture debug message lines containing some substring eg ":",
so that you only see the lines containing that substring, but you would then need to ensure that your debug messages also contain ":".
NOTE, RT_Stats plugin has RT_Debug() and RT_DebugF() functions for outputting script debug Info in real time during Filter Graph creation
stage, or during frameserving from within the Runtime environment (eg ScriptClip).
All RT_Debug/RT_DebugF messages contain a COLON character.
Args:
Text, Default "".
Allows add some kind of text label to the Title string that is output to DebugView.
Where CacheTest filter Instance is 3, and Text="PorridgeOats", and DvChar="", then
the Title output would be "CacheTest_0003_PorridgeOats:". (Ends with SINGLE COLON, ':')
DvChar, Default "".
Where CacheTest filter Instance is 3, and Text="PorridgeOats", and DvChar=":", then
the Title output would be "CacheTest_0003_PorridgeOats::". (Ends with DOUBLE COLON, ':')
The DvChar is inserted after the always present 1st ":" character, it allows to set
a more specific DebugView filter string, so as to only see CacheTest debug messages in DebugView.
Some messages sent to DebugView may not involve a COLON, some do use a COLON, you can eg set
DvChar to ":" so that only DebugView messages containing "::" will be captured, or can set some other character following ':'.
(You could even set DebugView filter to eg "CacheTest" if required, or even "PorridgeOats").
Always, Default False.
True = Output all frame requests debugview.
Silent, Default False.
True = switch off ALL messages (overrides ALWAYS).
Leaves an additional Cache between filters, without writing messages to DebugView.
Shows messages as in
"CacheTest_0005_Node_A1: 1001] *** REPEAT REQUEST {RepeatCnt=7, OSyncCnt=21}"
where there is a repeat request for CacheTest instance 0005 where Text="Node_A1",
@ frame 1001, and total Repeat Count = 7, and Out Of Sync Count = 21.
OR,
"CacheTest_0003_Marmalade: 873] *** OUT OF SYNC REQUEST, Previous=884 {RepeatCnt=7, OSyncCnt=21}"
where there is an Out Of Sync request for CacheTest instance 0003 where Text="Marmalade",
@ frame 873, where previous request was for frame 884, and total Repeat Count = 7, and Out Of Sync Count = 21.
############################################
Example:
Return Colorbars(Pixel_type="YV12").KillAudio.CacheTest()
CashTest_Test.avs
TEXT = "Marmalade"
DVCHAR = "" # Or maybe try eg ":"
ALWAYS = False # True = Output frame requests at every frame.
SILENT = False # NOT NORMALLY USED, NEARLY ALWAYS FALSE.
#Colorbars(Pixel_type="YV12").KillAudio
AVISource("D:\TEST.avi")
ORG=Last
CacheTest(Text=TEXT, DvChar=DVCHAR, Always=ALWAYS, Silent=SILENT) # OR Just CacheTest()
return Last
Some results for manually jumping about a bit [ Just using CacheTest() ]
00001691 0.22455139 [10788] CacheTest_0001: 0] *** Initialized to frame 0 {RepeatCnt=0, oSyncCnt=0}
00001692 1.09279370 [10788] CacheTest_0001: 0] *** REPEAT REQUEST (ReSeek to 0, Player starts to play ???), {RepeatCnt=0, oSyncCnt=0}
00001693 4.92930794 [10788] CacheTest_0001: 89] *** OUT OF SYNC REQUEST, Previous=122 {RepeatCnt=0, oSyncCnt=1}
00001694 4.93385696 [10788] CacheTest_0001: 2582] *** OUT OF SYNC REQUEST, Previous=89 {RepeatCnt=0, oSyncCnt=2}
00001695 10.90573597 [10788] CacheTest_0001: 2722] *** OUT OF SYNC REQUEST, Previous=2755 {RepeatCnt=0, oSyncCnt=3}
00001696 13.87600136 [10788] CacheTest_0001: 14400] *** OUT OF SYNC REQUEST, Previous=2722 {RepeatCnt=0, oSyncCnt=4}
00001697 16.37423706 [10788] CacheTest_0001: 0] *** Rewind to frame 0, Previous=14400, Counts RESET {RepeatCnt=0, oSyncCnt=0}
00001698 46.82066727 [10788] CacheTest_0001: 674] *** OUT OF SYNC REQUEST, Previous=707 {RepeatCnt=0, oSyncCnt=1}
00001699 47.55070114 [10788] CacheTest_0001: 708] *** OUT OF SYNC REQUEST, Previous=705 {RepeatCnt=0, oSyncCnt=2}
EDIT: If you use Always=True, and message does not appear in DebugView when moving to a frame, its because that already visited frame
has been gotten from cache (CacheTest GetFrame was not processed because the frame was obtained from a downstream cache <nearer to the output>).
EDIT: A 2nd monitor is ideal for DebugView use, even a small 4:3 VGA monitor is extremely handy.
EDIT: [I have 28" DisplayPort 4K 10bpc monitor, and 19" 1280x1024 VGA 4:3 8bpc <EDIT: via DP->VGA adapter>, and nVidia GTX 1070 driving both, the monitors work together just fine, no real probs that I can think of]
3 dll's + source + VS 2008 Project files.
Get Zip [CacheTest_25&26_x86_x64_dll_v1.02-20230608.zip, ~72KB] from StainlessS @ MediaFire Below this sig.
Also @ StainlessS@SendSpace below this sig for 30 days only.
Or Here:- https://app.mediafire.com/hb26mthbjz7z6
Originally prompted by this thread:- https://forum.doom9.org/showthread.php?p=1682827#post1682827
And earlier version:- https://forum.doom9.org/showthread.php?p=1744232#post1744232
And recent user Flossy_Cake similar-ish avs script to do the same:- https://forum.doom9.org/showthread.php?p=1988156#post1988156
CacheTest(), by StainlessS @ Doom9.
CacheTest(clip c, String "text"="", String DvChar="", Bool "Always"=False, Bool "Silent"=False)
CacheTest() Sends text message to DebugView when requested frame is "Out Of Sync", ie not previous frame + 1.
Insert between filters to see if there are any repeat requests for frame, or out of sync frame requests.
Requires DebugView, [ DebugView v4.90, @ Micro$oft:- https://learn.microsoft.com/en-us/sysinternals/downloads/debugview ]
DebugView captures debug messages on your local machine (or network) and shows them in a window, can also save to file.
These messages may be output by the system, or eg graphics card driver, or some other program on a machine.
[really annoying when nVidia floods debug logs in some supposedly non beta drivers].
You can add a DebugView Filter via DebugView Edit menu, to only capture debug message lines containing some substring eg ":",
so that you only see the lines containing that substring, but you would then need to ensure that your debug messages also contain ":".
NOTE, RT_Stats plugin has RT_Debug() and RT_DebugF() functions for outputting script debug Info in real time during Filter Graph creation
stage, or during frameserving from within the Runtime environment (eg ScriptClip).
All RT_Debug/RT_DebugF messages contain a COLON character.
Args:
Text, Default "".
Allows add some kind of text label to the Title string that is output to DebugView.
Where CacheTest filter Instance is 3, and Text="PorridgeOats", and DvChar="", then
the Title output would be "CacheTest_0003_PorridgeOats:". (Ends with SINGLE COLON, ':')
DvChar, Default "".
Where CacheTest filter Instance is 3, and Text="PorridgeOats", and DvChar=":", then
the Title output would be "CacheTest_0003_PorridgeOats::". (Ends with DOUBLE COLON, ':')
The DvChar is inserted after the always present 1st ":" character, it allows to set
a more specific DebugView filter string, so as to only see CacheTest debug messages in DebugView.
Some messages sent to DebugView may not involve a COLON, some do use a COLON, you can eg set
DvChar to ":" so that only DebugView messages containing "::" will be captured, or can set some other character following ':'.
(You could even set DebugView filter to eg "CacheTest" if required, or even "PorridgeOats").
Always, Default False.
True = Output all frame requests debugview.
Silent, Default False.
True = switch off ALL messages (overrides ALWAYS).
Leaves an additional Cache between filters, without writing messages to DebugView.
Shows messages as in
"CacheTest_0005_Node_A1: 1001] *** REPEAT REQUEST {RepeatCnt=7, OSyncCnt=21}"
where there is a repeat request for CacheTest instance 0005 where Text="Node_A1",
@ frame 1001, and total Repeat Count = 7, and Out Of Sync Count = 21.
OR,
"CacheTest_0003_Marmalade: 873] *** OUT OF SYNC REQUEST, Previous=884 {RepeatCnt=7, OSyncCnt=21}"
where there is an Out Of Sync request for CacheTest instance 0003 where Text="Marmalade",
@ frame 873, where previous request was for frame 884, and total Repeat Count = 7, and Out Of Sync Count = 21.
############################################
Example:
Return Colorbars(Pixel_type="YV12").KillAudio.CacheTest()
CashTest_Test.avs
TEXT = "Marmalade"
DVCHAR = "" # Or maybe try eg ":"
ALWAYS = False # True = Output frame requests at every frame.
SILENT = False # NOT NORMALLY USED, NEARLY ALWAYS FALSE.
#Colorbars(Pixel_type="YV12").KillAudio
AVISource("D:\TEST.avi")
ORG=Last
CacheTest(Text=TEXT, DvChar=DVCHAR, Always=ALWAYS, Silent=SILENT) # OR Just CacheTest()
return Last
Some results for manually jumping about a bit [ Just using CacheTest() ]
00001691 0.22455139 [10788] CacheTest_0001: 0] *** Initialized to frame 0 {RepeatCnt=0, oSyncCnt=0}
00001692 1.09279370 [10788] CacheTest_0001: 0] *** REPEAT REQUEST (ReSeek to 0, Player starts to play ???), {RepeatCnt=0, oSyncCnt=0}
00001693 4.92930794 [10788] CacheTest_0001: 89] *** OUT OF SYNC REQUEST, Previous=122 {RepeatCnt=0, oSyncCnt=1}
00001694 4.93385696 [10788] CacheTest_0001: 2582] *** OUT OF SYNC REQUEST, Previous=89 {RepeatCnt=0, oSyncCnt=2}
00001695 10.90573597 [10788] CacheTest_0001: 2722] *** OUT OF SYNC REQUEST, Previous=2755 {RepeatCnt=0, oSyncCnt=3}
00001696 13.87600136 [10788] CacheTest_0001: 14400] *** OUT OF SYNC REQUEST, Previous=2722 {RepeatCnt=0, oSyncCnt=4}
00001697 16.37423706 [10788] CacheTest_0001: 0] *** Rewind to frame 0, Previous=14400, Counts RESET {RepeatCnt=0, oSyncCnt=0}
00001698 46.82066727 [10788] CacheTest_0001: 674] *** OUT OF SYNC REQUEST, Previous=707 {RepeatCnt=0, oSyncCnt=1}
00001699 47.55070114 [10788] CacheTest_0001: 708] *** OUT OF SYNC REQUEST, Previous=705 {RepeatCnt=0, oSyncCnt=2}
EDIT: If you use Always=True, and message does not appear in DebugView when moving to a frame, its because that already visited frame
has been gotten from cache (CacheTest GetFrame was not processed because the frame was obtained from a downstream cache <nearer to the output>).
EDIT: A 2nd monitor is ideal for DebugView use, even a small 4:3 VGA monitor is extremely handy.
EDIT: [I have 28" DisplayPort 4K 10bpc monitor, and 19" 1280x1024 VGA 4:3 8bpc <EDIT: via DP->VGA adapter>, and nVidia GTX 1070 driving both, the monitors work together just fine, no real probs that I can think of]
3 dll's + source + VS 2008 Project files.
Get Zip [CacheTest_25&26_x86_x64_dll_v1.02-20230608.zip, ~72KB] from StainlessS @ MediaFire Below this sig.
Also @ StainlessS@SendSpace below this sig for 30 days only.
Or Here:- https://app.mediafire.com/hb26mthbjz7z6