AydinAdn/MediaToolkit

webm files as source?

Closed this issue · 4 comments

webm source files always produce a "System.FormatException" exception (they work fine fine with ffmpeg console).

After further investigation, while giving the exception, the command 'MediaToolkit.Engine.Convert' does execute and the conversion does take place. Still the application (vb.net) crashes.

That's due to CLS compliancy... as the app is written in C#, things such as nullable integers aren't compliant with VB unfortunatly.

I have the same problem in a web application written in C#. When creating a thumbnail for a .webm file, the app crashes with the following exception in the event log.

Description: The process was terminated due to an unhandled exception.
Exception: System.FormatException
Stack:
   at System.Number.StringToNumber(System.String, System.Globalization.NumberStyles, NumberBuffer ByRef, System.Globalization.NumberFormatInfo, Boolean)
   at System.Number.ParseInt32(System.String, System.Globalization.NumberStyles, System.Globalization.NumberFormatInfo)
   at MediaToolkit.Util.RegexEngine.TestAudio(System.String, EngineParameters)
   at MediaToolkit.Engine+<>c__DisplayClass9.<FFmpegEngine>b__5(System.Object, System.Diagnostics.DataReceivedEventArgs)
   at System.Diagnostics.AsyncStreamReader.FlushMessageQueue()
   ...

Aydin, just merged my change that fixes this. Unfortunately, Neither FFmpeg nor FFprobe return audio bitrate for webm, so it will be 0 until FFmpeg is fixed and starts returning it.