radek-k / FFMediaToolkit

FFMediaToolkit is a cross-platform video decoder/encoder library for .NET that uses FFmpeg native libraries. It supports video frames extraction, reading stream metadata and creating videos from bitmaps in any format supported by FFmpeg.
MIT License
357 stars 56 forks source link

EndOfStreamException: 'End of the file' #36

Closed quocdai92 closed 4 years ago

quocdai92 commented 4 years ago

Hi, I got the Exception below although the reader is still available. Please help me. image

radek-k commented 4 years ago

FrameCount value may be not accurate in Variable Frame Rate videos. You can check it with the code below:

bool isFrameCountAccurate = file.Video.Info.IsFrameCountProvidedByContainer || !file.Video.Info.IsVariableFrameRate;

In the next release I will add a bool TryReadFrame(int number, out ImageData frame) method to the VideoStream class. The method will return false instead of throwing an exception.