I'm writing an application that includes a video player (ffme) which must synchronize with another application using MIDI Timecode. These MIDI messages control the position of the player. When seeking from an external application, these Timecodes are sent very fast and the result is the Seek Method being called many times quickly. This is resulting in 65-70% cpu usage and my other application to crash due to that cpu usage.
Debugging the application showed that most of the usage was due to avcodec-58.dll
Note: These Timecodes are in sequence.
Note: Library.EnableWpfMultiThreadedVideo = true;
Issue Categories
[ ] Bug
[ ] Feature Request
[ ] Question
[x] Not sure
Version Information
[x] NuGet Package 4.1.310
Steps to Reproduce
Load a video.
Call the Seek(TimeSpan span) method very fast
Expected Results
Video should seek as smooth as possible without taking too much cpu usage.
Sample Code
C
public static void Seek(mTimecode timecode)
{
if (!Video.HasVideo)
{
return;
}
TimeSpan time_playest = timecode.GetSpan();
Video.Seek(time_playest);
}
Extremely High CPU usage when seeking quickly
I'm writing an application that includes a video player (ffme) which must synchronize with another application using MIDI Timecode. These MIDI messages control the position of the player. When seeking from an external application, these Timecodes are sent very fast and the result is the Seek Method being called many times quickly. This is resulting in 65-70% cpu usage and my other application to crash due to that cpu usage. Debugging the application showed that most of the usage was due to avcodec-58.dll
Note: These Timecodes are in sequence. Note: Library.EnableWpfMultiThreadedVideo = true;
Issue Categories
Version Information
Steps to Reproduce
Expected Results
Sample Code
C