• AnyStream is having some DRM issues currently, Netflix is not available in HD for the time being.
    Situations like this will always happen with AnyStream: streaming providers are continuously improving their countermeasures while we try to catch up, it's an ongoing cat-and-mouse game. Please be patient and don't flood our support or forum with requests, we are working on it 24/7 to get it resolved. Thank you.

A little help needed... enabling default RunEvent.vbs for SetDisplayFrequency.exe

Hi Jong, could you please post the latest VB script that does NOT include 720p detection? I realize I can just change it to:

Code:
	            Case "NTSC(2x)"

			If sourceheight <= 720 Then
				newTimings = "59"
			Else
				newTimings = "59"
			End if

However, I thought it would be nice to have a simple script without 720p code.

Thanks!
 
That's exactly what is in the original zip in this thread, linked to in the post just above. ;)
 
Yes, I tried that. That one doesnt work correctly. It's flip-flopping with anything less than QuitDelay=10000. It is reacting similar to your earlier attempt at resolution detection when I said it was 'screwed up'.

The last code revision that worked correctly was the last code revision before resolution detection code was attempted. This code was the last code before you changed the name of the "helper" VB script to changerefresh.vbs. I can't remember the older name of the helper script. I'm hoping you still have that zip file somewhere.

I am currently using the latest possible code for resolution detection; which allows for QuitDelay to work correctly; however, its a bit messy (the way I made it work shown above) if I dont want it to use resolution detection. I'm no coding expert as you know, but I think it would be a good idea to use revision numbers to code; even if the changes are very minor.

That's exactly what is in the original zip in this thread, linked to in the post just above. ;)
 
Log please. And please make sure you copy both scripts from the zip and make no changes.
 
Hi Jong, attached you will find the original scripts you told me to use. I only changed QuitDelay from 10000 (which is way too much) to 4000; which is a comfortably safe value when the script is working correctly.

I also included the log. I let it flip-flop my display 6 times before I pressed stop. It "should" have only changed my display to 24hz once. And, also change the display back to 59hz after I press stop. Thanks!!
 

Attachments

  • ReClock-without-resolution-detection-broken.zip
    34.9 KB · Views: 5
Last edited:
Hi. Unfortunately, what your saying does not agree with what is in the log. Were you using the same video for both tests? Is it reproduceable? Can you retest the same video again with the script you say works and send me the scripts you used and a log?

In the log you sent me I can absolutely see why our script did not work. Directshow seems to take two goes at building every graph and then some time trying to find the frame rate (RED state). It simply takes too long for your 4 second delay. Graphbuilding and frame rate detection are variable things. The time taken will change from file to file.

It seems to me that you have found a file that takes longer to get going than 4 seconds allows for, or may do sometimes. Did you try any other delays, or did you jump straight from 4 to 10 secs? It may be that say "6000" might have worked better.

There is no way that using the resolution detection version of the script would have improved how this attempt played out. The script would never have even used the bits of the script that differ - there are no events with NTSC(2x) mediatype, only Cinema. Maybe it was pure chance that one time it just worked and another it just failed.

I am not saying there is not possibly some issue here, but this log surely does not show it, other than the current delay in insufficient, as you yourself noted.
 
Last edited:
Hi Jong, its 100% reproducible. 24fps files change to 24hz ONLY if value is more than 10000. Otherwise, it is flipflopping. I dont know if you know this, but, I have never been been able to successfully use this particular VB script.

I also can consistently use 3500 QuitDelay value in the latest working script (which contains the "Case GREEN" condition. It also used to work consistently perfectly for the last script before you started making code changes to accommodate for display resolution detection. Unfortunately, I didn't keep a copy of it.

I'm not sure if this is important or not:
Reclock works perfectly and consistently in sageTV when I use the right VB script; however, interestingly, if I dont add "Set Reclock as preferred renderer (not recommended)" in addition to "Enable logging", the log doesnt even get created until after I press STOP in sageTV. I HAVE to enable "Set ReClock as preferred renderer (no recommended)" if logging is to be started properly. I dont need to enable "Set Reclock as preferred renderer (not recommended)" for sageTV to use reclock, only if I want to use the log!

Maybe there is something that's interfering with sageTV, reclock, and logging that can't be seen in logging? This would make it difficult to debug. However, at least one thing is for sure, all behavior is 100% consistent; and, this VB script consistently doesnt work with a value less than 10000. Do you think I should just use the latest one with

Code:
	            Case "NTSC(2x)"

			If sourceheight <= 720 Then
				newTimings = "59"
			Else
				newTimings = "59"
			End if


Hi. Unfortunately, what your saying does not agree with what is in the log. Were you using the same video for both tests? Is it reproduceable? Can you retest the same video again with the script you say works and send me the scripts you used and a log?

In the log you sent me I can absolutely see why our script did not work. Directshow seems to take two goes at building every graph and then some time trying to find the frame rate (RED state). It simply takes too long for your 4 second delay. Graphbuilding and frame rate detection are variable things. The time taken will change from file to file.

It seems to me that you have found a file that takes longer to get going than 4 seconds allows for, or may do sometimes. Did you try any other delays, or did you jump straight from 4 to 10 secs? It may be that say "6000" might have worked better.

There is no way that using the resolution detection version of the script would have improved how this attempt played out. The script would never have even used the bits of the script that differ - there are no events with NTSC(2x) mediatype, only Cinema. Maybe it was pure chance that one time it just worked and another it just failed.

I am not saying there is not possibly some issue here, but this log surely does not show it, other than the current delay in insufficient, as you yourself noted.
 
Please, please, as I asked, send me a log of when it is working, with both scripts. Also please send me another log using the "troublesome" scripts, but with Quitdelay = 10000. Then I will be able to see the timing for this file, without the delayed refresh rate changes occurring and confusing things still further.

As I said, it is clear that you need a longer delay to play this file, but i just don't believe some conditions that only happen on NTSC(2x) will fix it. Of course, never say never, but I'd take a sizeable bet! A few times you have thought Reclock, or the script was doing crazy things and in the end they has been behaving totally predictably. We have just had to adjust to Sage's unusual behaviour.
 
Also make sure that your display is always on its default rate of 59HZ when you start playback. The script assumes this and it should always be true if you are not playing around with it outside of Reclock.
 
mkanet, can you do me a favour. Please install Display Changer (http://www.12noon.com/displaychanger.htm) and then use the attached. of course you are using different hardware to me but I cannot get SDF to work reliably when media is playing back. It is fine when nothing is playing, but seems to work erratically when Reclock scripting is enabled, frequently failing to change refresh rates. I have no idea why. I have just tested here with Display Changer and all works perfectly.

Please make sure that when you test the display is originally on your default refresh (the one that you change to on QUIT).

Jon
 

Attachments

  • changerefresh.zip
    575 bytes · Views: 39
Hi Jong, I decided to take a short break from testing to start with a fresh mind. I hope that's okay.

It looks like AnyDVD refreshrate changer, Display Rate changer, and Girder refresh rate changer all work correctly outside the VB Script. The script also behaves exactly the same way for all three methods; even Display Rate Changer. If it's okay with you, I would like to leave this problem alone because I can already ignore 720p detection by using:
Code:
			If sourceheight <= 720 Then
				newTimings = "59"
			Else
				newTimings = "59"
			End if

So, we dont have to worry about this issue anymore.

mkanet, can you do me a favour. Please install Display Changer (http://www.12noon.com/displaychanger.htm) and then use the attached. of course you are using different hardware to me but I cannot get SDF to work reliably when media is playing back. It is fine when nothing is playing, but seems to work erratically when Reclock scripting is enabled, frequently failing to change refresh rates. I have no idea why. I have just tested here with Display Changer and all works perfectly.

Please make sure that when you test the display is originally on your default refresh (the one that you change to on QUIT).

Jon
 
Making script a little smarter...

Jong, there is one last annoying problem which will make the script even better; and, get rid of a very annoying issue. I think this one should be easy to fix; even, without logs.

Sometimes I like to watch several 24Hz movies or several 59hz TV shows consecutively (as soon as one movie/tvshow is finished, to start another one immediately).

Currently, the script works correctly, with no unpredictable behavior.

Problem:
Currently, I have "QuitDelay = 8000". Once a movie is finished, the script will change to default refresh rate of 59 after 8000 milisecond (DefaultTiming = 59). If I start another movie, the script change the display back to 24hz again after I start another movie.

I am hoping that you can figure out a very clever way for the script to NOT change the display refresh rate to 59 unnecessarily IF I start another 24hzmovie before 8000 miliseconds. Currently, the display refresh changes to 59Hz after a movie is over EVEN if I start another 24hz movie very quickly. It doesnt make sense to change the display to 59hz if I am going to play another movie very quickly.

Presuming that there are no weird/unpredictable behavior, I would love it if you could further enhance the script so that it is a little smarter.... not changing to 59hz unecessary if I am going to play another 24hz movie immediately after I finish watching the first 24hz movie.

I think this smarter logic would be beneficial to anyone who uses this script. Do you think you could please do this? I insist on donating via paypal for all your help.

Sincerely,
Michael
 
This is not easy. I suspect what is happening is that it takes a while for the player to fully close after the initial QUIT. It then takes you second or so to start the next movie. It the takes a few seconds after that before the script runs for the first time with this new movie and all this adds to more than 8 secs. If you increased your timeout still further I'm sure it would work, but then it would be horrid normally. If you don't think this is the problem send me a log of the whole process (delete any old log first) - play the first movie, stop it, play the second, wait for all the refresh rates to settle, stop and send.

If the problem is simply that the script for the new movie is not being run until > 8 secs after the QUIT for the first there is nothing else that we can do in this script to fix it. The only possible option then is if Sage allows you to run a program before starting the player. Many HTPC front-ends do. If so we could take the bit of the script that kills any queued refresh rate changes and run it before the player starts. This will happen quite bit earlier than the Reclock script runs and might be able to stop the switch to 59Hz.
 
Hi Jong, thanks for replying. I'm pretty sure the script isn't being run until the 8000 millisecond timeout is finished.

The sageTV "player" is an internal process in sageTV code. The sageTV client application is in memory all the time. So, it's not as simple as sageTV executing an external executable each time playback starts. I doubt I'll be able to figure out how to execute VB script each time the player starts playback.

I have an idea... would it help if you modify the existing "bit of the script that kills any queued refresh rate changes" to actually kill the pending VB script process in memory?
 
Hi!

Unfortunately that is exactly what the script does already. The point is we need a trigger. Currently it is triggered by the first YELLOW OR GREEN event of the second video, but it seems that is too late. If Sage offers an option to run a command before playback of a video starts (as many HTPC fron-ends do) we could use that to kill the pending refresh rate change a little earlier, but, if it does not, there really is no third way, other than to increase 8 secs until the Reclock script can kill the refresh rate change before it happens.
 
It just occurred to me sometimes you seemed to get a QUIT before playback starts and this added a bit of delay. If you can send me a log of the whole process of playing a video, stopping it, playing a second and waiting for the refresh rates to settle, I'll take a look. If there is a spurious QUIT at the start of the second video we might be able to shave a second or two off the process.
 
Hi Jong, I have been using this script every day. There is one small thing I need to add to the script; but not sure how to do it.

I need to execute an exe, 2 seconds after each time the refresh rate changes.

Could you tell me how to do that? I have tried add the below lines to either VBS file; but somehow the FST.exe executable keeps getting ignored. Maybe the syntax is wrong? Maybe it get's ignored because there isn't a delay? I'm really not that great at VBS.

FST.exe is an app that toggles the sageTV window between fullscreen and windowed. It works fine if I execute it directly by double-clicking it.

changerefresh.vbs
Code:
'MsgBox "Switching Refresh Rate now",  MB_OK, "Refresh Rate Switcher"

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(&H26&) 
Set objFolderItem = objFolder.Self   

' Run SetDisplayFrequency command and wait for it to finish its job
WshShell.Run """" & _
         "%ProgramFiles%\SlySoft\AnyDVD\SetDisplayFrequency.exe"" " & NewTiming, 0, true
WshShell.Run """" & _
         "%ProgramFiles%\Promixis\Girder\FST.exe"" "

RenEvent.vbs
Code:
' Do we have new timings to apply ?
If newTimings <> "No" Then

    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.Namespace(&H26&) 
    Set objFolderItem = objFolder.Self   

    ' Run SetDisplayFrequency command and wait for it to finish its job
    WshShell.Run """" & "%ProgramFiles%\ReClock\changerefresh.vbs"" " & newTimings & " " & NormalDelay, 0, true
    WshShell.Run """" & "%ProgramFiles%\Promixis\Girder\FST.exe"" "
End If

WScript.Quit 1
 
Well there is a simple way to see if it is because it is being run too soon after the refresh rate change. In the changerefresh file try the following
Code:
'MsgBox "Switching Refresh Rate now",  MB_OK, "Refresh Rate Switcher"

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(&H26&) 
Set objFolderItem = objFolder.Self   

' Run SetDisplayFrequency command and wait for it to finish its job
WshShell.Run """" & _
         "%ProgramFiles%\SlySoft\AnyDVD\SetDisplayFrequency.exe"" " & NewTiming, 0, true

MsgBox "Toggle Fullscreen?",  MB_OK, "Refresh Rate Switcher"

WshShell.Run """" & _
         "%ProgramFiles%\Promixis\Girder\FST.exe"" "

Now you will get a popup (possibly hidden behind the video) and you will need to OK it before FST is run. If that works (or if the popup causes you problems). you just need to replace with
Code:
'MsgBox "Switching Refresh Rate now",  MB_OK, "Refresh Rate Switcher"

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(&H26&) 
Set objFolderItem = objFolder.Self   

' Run SetDisplayFrequency command and wait for it to finish its job
WshShell.Run """" & _
         "%ProgramFiles%\SlySoft\AnyDVD\SetDisplayFrequency.exe"" " & NewTiming, 0, true

'Wait 2 secs
WScript.Sleep 2000

WshShell.Run """" & _
         "%ProgramFiles%\Promixis\Girder\FST.exe"" "
....and play with the sleep value until it is long enough to work reliably, but not too long.
 
Hi Jong, I have been using your VBscripts for a while now. Could you please tell me how to prevent Reclock from changing refresh rates if PowerDVD12.exe is in memory?

I have already tried several times to just disable reclock when using Powerdvd 12; however, I can't disable it.

Thanks in advance,
MKANET
 
Back
Top