-
-
Notifications
You must be signed in to change notification settings - Fork 927
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
ZeroDivisionError? #8
Comments
Just experienced this exact issue a moment ago. The problem lies in trying to obtain the framerate of the video from an non-video stream. I figure for most of the time, the videos being used have the video stream before the audio stream, so the hardcoded Older versions of this program would probably also experience this same error when they attempt to obtain the width/height from the first stream index as well. This implementation does not also account for the case where you have multiple video streams inside the file. The workaround I used for now was to change the stream index to 1 since my file had the video stream at that index instead. You could also just hardcode the framerate variable to a specific value. Not a real fix, but it's enough to get it working until this issue is resolved. |
@YachtSail thanks for the issue. Will take a look ASAP. |
@YachtSail
This software runs with Python3 which is declared in its shebang, where python2 is used in your case. It's my bad that I didn't make it clear enough. This is the only python program in my repository that's meant to be run under Windows environment. To avoid confusion I might change the documentation too. Try using python3 first and see if the issue remains. UpdateI have already update the installation instructions. |
The issue still remains after I change to python 3. I tried the method @kwsou provided and it did allow the program to finish, but the merged video has an audio sync issue. I can provide you the video I used for testing if you wish. Thank you for responding. |
Here is the error report: |
@YachtSail Roger that. Thanks to @kwsou 's comment which I read carefully, I will look into the problem and see if I can get a quick fix. Sorry but you might have to stick to @kwsou 's fix for the moment. |
@YachtSail @kwsou I will try to change from ffmpeg to ffmpeg-python and see if that will solve the problem. It should be a more elegant solution that just executing stuff from the commandline. |
@YachtSail @kwsou Sorry for taking so long. I've been busy with all the conferences and events that were going on. I just pushed a beta solution for the problem, which should solve it. I'll make some test tonight when I get back to my relatively powerful workstation and test the results. You can take a look at the newest version if you want. |
Seeing the error again on version 2.10.0:
Interestingly, the line before says it's calling \bin\ffprobe.exe, but I'm running the Python scripts directly and that executable isn't located in \bin |
@verbiate |
As I mentioned, I am running 2.10.0, not 2.9.0. Edit: Confusingly, I put the 2.10.0 folder inside the previous 2.9.0 folder when I was first testing it, which is why you see it in the path above. The script indicates it is indeed running 2.10.0 upon launch. |
@verbiate ok got it. |
After the program finished processing all the frames, the following message appeared:
video:4418846kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[!] ERROR: An exception occurred
Traceback (most recent call last):
File "video2x.py", line 215, in
video2x()
File "video2x.py", line 150, in video2x
framerate = float(Fraction(info['streams'][0]['avg_frame_rate']))
File "C:\Python27\lib\fractions.py", line 162, in new
raise ZeroDivisionError('Fraction(%s, 0)' % numerator)
ZeroDivisionError: Fraction(0, 0)
What could have caused this problem? Does this program require certain video coding format to run properly?
The text was updated successfully, but these errors were encountered: