-
Notifications
You must be signed in to change notification settings - Fork 403
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
How to catch errors using split_video functions? #209
Comments
Hey @AdrienLF; This typically won't result in an exception, since those functions invoke Right now the split video functions don't return anything, but it should be pretty easy to modify it to return the error code / return value from invoking Does this help? |
Could you also provide an example of the output you get for both cases? Are there any samples you can share? |
The error I get is when I try to process PRORES with h264_nvenc.
It then continues with the code without raising an exception. I would prefer that it tries again without the arg override (which works correctly). I'll try to modify the function to return ret_val, and I think in general it would be nice to be able to catch exceptions when PySceneDetect is used in a larger app. Thanks! |
Here's how I solved it, after modifying the function to return ret_val
Interestingly it prints before displaying the error, but it works in the end:
|
These functions definitely could use some API work. I'll mark this as an improvement, and set it so that the split_video functions return the last exit code rather than nothing. Note that the logger defaults to |
Completed in v0.5.6 branch (see 4e53915). |
Hi,
I'm trying to use CUDA with video_splitter.split_video_ffmpeg. It works well for most videos, however some codecs don't play well with this. So I try to catch it with an error, like so:
It does display the error however, it doesn't register as one, and therefore doesn't trigger the exception. Is there a way to trigger it? I'm not great with exception handling in python.
Thank you!
The text was updated successfully, but these errors were encountered: