AydinAdn/MediaToolkit

Don't check that input file exists

Opened this issue · 2 comments

Here: https://github.com/AydinAdn/MediaToolkit/blob/master/MediaToolkit%20src/MediaToolkit/Engine.cs#L126

Howebver, ffmpeg supports wildcards, so the input string may not represent 1 file. You could get clever and skip the file exists check if /%[^%]/ or something, but why bother? Just let ffmpeg tell you there was a problem..

But unfortunately, exit code 1, which would inform that, gets treated equal to success, here: https://github.com/AydinAdn/MediaToolkit/blob/master/MediaToolkit%20src/MediaToolkit/Engine.cs#L297

Why not let error code 1 throw an exception?

Do you know whether error code 1 is specific to missing files? I can't actually remember why I did that (in fact the only reason I know I wrote it is thanks to git history)

I assume 1 is conventionally non-success. If it was really important to specifically throw a FileNotFoundException, then I suppose the error text would need to be inspected. For my purposes, Exception would be satisfactory. I'm mainly interested in being able to pass wildcards in file paths.