-
Notifications
You must be signed in to change notification settings - Fork 162
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
Error handling when Mediainfo is not able to open a file #988
Comments
It does seem that curl errors are actually displayed:
However since I was using the Python wrapper around the binary (https://github.com/MediaArea/MediaInfoLib/blob/master/Source/MediaInfoDLL/MediaInfoDLL3.py) it wasn't output anywhere - I will look into this to see if it's possible to capture stdout. The return code should still probably not be 0 on a file opening error. |
It was definitely a big design mistake... 25 years ago :(.
Currently it is 1 if OK, else 0. Changing that would break the API, I am reluctant to do that now.
No with Python :(.
We have a callback function in the CLI for the errors but it is not available with Python :(. What I imagine without changing the API is to have an option for getting the error log, so you can access it from Python. |
Do you mean that the C function returns 1 (true) for success or 0 (false) for failure? That seems ok, but it seems like the return code to the OS should be 0 on success and non-zero on a failure. The behavior currently seems to always be 0 whether the file was read successfully or not, so that running in a bash script doesn't distinguish between failure or success.
This would allow me to check if there were errors and capture the error message? That seems like exactly what I need. |
I was speaking about the API, not the CLI. It was not seriously handled 20 years ago when I started MediaInfo and it definitely need some coherency and cleanup :(.
Yes. Will do. |
If Mediainfo can't open a file for any reason, it just returns no output. This makes troubleshooting difficult - currently I am trying to figure out why a presigned URL returns no output for Mediainfo even though I can wget the first 2M bytes at that same URL. Testing locally, a file that doesn't exist and a file with no read permissions return the same lack of an error.
Is it possible to:
In the short term, is there any debugging mode that can shed light on the internal failure? The
--Details=1
flag doesn't appear to add any additional output if the file is not accessible.The text was updated successfully, but these errors were encountered: