home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Refresh Rate Control Plugin
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="kenwonders" data-source="post: 186675" data-attributes="member: 29743"><p>I thought I'd get back to the thread with the patches I've made locally. I think I've got it nailed now, I had to make 3 changes to the source code:</p><p></p><p>1. DirectShow occasionally got the wrong frametime. Fix:</p><p>Add a delay of 2 seconds, once the graph is found. This seems to be enough time for videoHeader2.AvgTimePerFrame to start reporting the correct fps.</p><p></p><p>Edit lines in RefreshRateControl.DirectShow.cs:</p><p></p><p> if (graphBuilder != null)</p><p> {</p><p> WriteToLog("Got valid graph!");</p><p></p><p> //PATCH</p><p> Thread.Sleep(2000);</p><p> WriteToLog("Delayed 2 seconds");</p><p> //PATCH</p><p> break;</p><p> }</p><p> else</p><p> {</p><p> WriteToLog("Couldn't cast it as IGraphBuilder");</p><p> }</p><p></p><p>2. Some videos don't work, namely MKV. They find a graph but 0 fps. Fix:</p><p>Set option in configuration to perform VMR9 check. Change main code to continue picking a method if DirectShow returns 0 fps. Edit code in RefreshRateControl.cs (SetRefreshRate):</p><p></p><p> if (settings.DirectShowSupport &&</p><p> DirectShowGetFrameRate(fileName, out frameRate, settings.DirectShowBuilding))</p><p> {</p><p></p><p> //PATCH</p><p> if (frameRate != 0)</p><p> {</p><p></p><p> //PATCH</p><p> SetRefreshRate(GetBestRefreshRate(frameRate));</p><p> return;</p><p></p><p> //PATCH</p><p> }</p><p></p><p> //PATCH</p><p> }</p><p></p><p> //none found last chance</p><p> if (settings.Vmr9Guessing)</p><p> {</p><p></p><p> //PATCH</p><p> lastFPS = 0;</p><p> //PATCH</p><p> ProcessFrameRate();</p><p> }</p><p></p><p>3. VMR9 detection isn't a great FPS identifier. Fix:</p><p>While testing using the ! key, I noticed a better indicater. Use MediaPortal.GUI.Library.VideoRendererStatistics.AverageFrameRate for a more accurate reporting of the source file FPS. Edit in RefreshRateControl.cs (ProcessFrameRate):</p><p></p><p> float rate = MediaPortal.GUI.Library.VideoRendererStatistics.AverageFrameRate;//MediaPortal.GUI.Library.GUIGraphicsContext.DesiredFrameTime;</p><p></p><p></p><p></p><p>With these edits, I am hitting 100% accuracy, albeit with a little stutter on startup. Hope they're useful to someone. I will probably clean things up a bit better. I am tempted to make a version that just uses the new AverageFrameRate I found, it usually gets the correct rate within two seconds, any other changes the RefreshRateControl makes later are mistakes based on the fact that I've skipped inside the video file.</p><p></p><p>EDIT: secco do you have Haali Media Splitter installed?</p></blockquote><p></p>
[QUOTE="kenwonders, post: 186675, member: 29743"] I thought I'd get back to the thread with the patches I've made locally. I think I've got it nailed now, I had to make 3 changes to the source code: 1. DirectShow occasionally got the wrong frametime. Fix: Add a delay of 2 seconds, once the graph is found. This seems to be enough time for videoHeader2.AvgTimePerFrame to start reporting the correct fps. Edit lines in RefreshRateControl.DirectShow.cs: if (graphBuilder != null) { WriteToLog("Got valid graph!"); //PATCH Thread.Sleep(2000); WriteToLog("Delayed 2 seconds"); //PATCH break; } else { WriteToLog("Couldn't cast it as IGraphBuilder"); } 2. Some videos don't work, namely MKV. They find a graph but 0 fps. Fix: Set option in configuration to perform VMR9 check. Change main code to continue picking a method if DirectShow returns 0 fps. Edit code in RefreshRateControl.cs (SetRefreshRate): if (settings.DirectShowSupport && DirectShowGetFrameRate(fileName, out frameRate, settings.DirectShowBuilding)) { //PATCH if (frameRate != 0) { //PATCH SetRefreshRate(GetBestRefreshRate(frameRate)); return; //PATCH } //PATCH } //none found last chance if (settings.Vmr9Guessing) { //PATCH lastFPS = 0; //PATCH ProcessFrameRate(); } 3. VMR9 detection isn't a great FPS identifier. Fix: While testing using the ! key, I noticed a better indicater. Use MediaPortal.GUI.Library.VideoRendererStatistics.AverageFrameRate for a more accurate reporting of the source file FPS. Edit in RefreshRateControl.cs (ProcessFrameRate): float rate = MediaPortal.GUI.Library.VideoRendererStatistics.AverageFrameRate;//MediaPortal.GUI.Library.GUIGraphicsContext.DesiredFrameTime; With these edits, I am hitting 100% accuracy, albeit with a little stutter on startup. Hope they're useful to someone. I will probably clean things up a bit better. I am tempted to make a version that just uses the new AverageFrameRate I found, it usually gets the correct rate within two seconds, any other changes the RefreshRateControl makes later are mistakes based on the fact that I've skipped inside the video file. EDIT: secco do you have Haali Media Splitter installed? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Refresh Rate Control Plugin
Contact us
RSS
Top
Bottom