Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TryGetFrame set Timeout #127

Open
Bedrock99 opened this issue Feb 20, 2023 · 0 comments
Open

TryGetFrame set Timeout #127

Bedrock99 opened this issue Feb 20, 2023 · 0 comments

Comments

@Bedrock99
Copy link

Hi,

i try to read Videos for making thumbnails to show in C#.
Some of the Videos are broken.
This Videos take multiple minutes to fail.

I would like to have the ability to set a Timeout in the TryGetFrame Function of the VideoStream object.

My Function to load the frames looks like this:
`public Bitmap GetVideoFrameAtSecond(double s_)
{
if (MediaInfo == null)
return null;

       try
        {
            if (MediaInfo.Video.TryGetFrame(TimeSpan.FromMilliseconds(s_ * 1000), out FFMediaToolkit.Graphics.ImageData imageData1))
            {
                return imageData1.ToBitmap();
            }
        }
        catch (Exception)
        {
            return null;
        }
        return null;
    }`

MediaInfo is a member Variable of the type MediaFile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant