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
Use Infer to detect image/video #101
Use Infer to detect image/video #101
Conversation
Maintaining our own list of known filetypes seems pointless when there are other projects that do it for us.
Thanks! The additional binary bloat and sync-io blocking is undesirable, but overall this looks worth it. |
Yeah it's kinda academic as we'd expect the probe to have failed. I probably would have just |
Infer can be imported with no default features to make it lighter. This means that we won't be able to use the |
Whoops
Size is a concern, if not a critical one. Just something I keep an eye on when adding new dependencies. As I said I think the trade off is worth it here. |
This makes the final binary smaller by about 71kb
I've done some measurements. When building in
I'd say that's quite a nice jump. |
It's a mild annoyance that we don't need no_std, we just want to avoid the cfb dependency. But infer has bundled them together in the "std" feature 🤷. Although not using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Maintaining our own list of known filetypes seems pointless when there are other projects like Infer that do it for us.
Marked as draft until this is answered:
If Infer fails to load the file then
ProbeError
s are created despite not being thrown by FFProbe. This is because the check happens in theprobe
function (for convenience). Is this okay or should a more specific error type be created for this? In any case, the whole thing would have failed anyway if the file is unable to be read.