FFMediaToolkit icon indicating copy to clipboard operation
FFMediaToolkit copied to clipboard

MediaStream threshold is currently hardcoded

Open ggolda opened this issue 3 years ago • 0 comments

In current implementation of MediaStream, Threshold is being hardcoded and there is no way to override it: https://github.com/radek-k/FFMediaToolkit/blob/master/FFMediaToolkit/Decoding/MediaStream.cs#L23

Threshold = TimeSpan.FromSeconds(0.5).ToTimestamp(Info.TimeBase);

Because of that as I understand, I can not read from 60 fps video with a 30 fps framerate from my reader. I'm trying to call GetFrame with a delta time of 33ms, and GetFrame function from MediaStream ignores my timestamp and just returns a next frame.

As I understand, this threshold parameter should be equal to a frame rate of a video? E.g. for 60 fps video it should be 16.66, for 30 fps its 33.33 and etc.

Am I doing something wrong here?

ggolda avatar Jul 13 '21 20:07 ggolda