AydinAdn/MediaToolkit

Out of bounds issue

Opened this issue · 3 comments

hi i just tried this.
the code im using 1.1.0.1 in dotnet core

var inputFile = new MediaFile { Filename = temp_path };

                //var engine = new engine();
                using (var engine = new Engine("/Volumes/Data/hardstone_projects/xtheia_2.2/xtheiaWeb/ffmpeg.exe"))
                {
                    engine.GetMetadata(inputFile);
                }
                var duration = inputFile.Metadata.Duration;

But i am getting expection
Index was out of range. Must be non-negative and less than the size of the collection.\nParameter name: index
Please help

Greetings, could you provide more details? It seems that in the first line of code you are providing Filename is not defined.

I have the same exception. I analyzed code and I suppose that line:

throw new Exception(
                        this.FFmpegProcess.ExitCode + ": " + receivedMessagesLog[1] + receivedMessagesLog[0],
                        caughtException);

in

private void StartFFmpegProcess(EngineParameters engineParameters)
can be problematic.

In my opinion there is a chance that:

List<string> receivedMessagesLog = new List<string>();

has no elements (or has only one element) and there is not possible to build exception message correctly.
To sum up - a main exception can be hidden by a negligible exception.

I tried TagLib with exact same path... It is working fine