danielgtaylor / danielgtaylor/arista

ZeroDivisionError: float division by zero

Open
#95 10 comments 0 reactions 0 assignees View on GitHub
ConfirmFix
Dominant language
Python
Stars
119
Forks
17
PR merge metrics
No merged PRs in 30d

Description

Hi,

I was trying to transcode a video file (a .vob) and I got the following error, no matter what device preset I used:

$ arista-gtk
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/arista/discoverer.py", line 351, in _notify_caps_cb
self.videowidth = caps[0]["width"]
KeyError: 'width'
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/arista/discoverer.py", line 351, in _notify_caps_cb
self.videowidth = caps[0]["width"]
KeyError: 'width'
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/arista/transcoder.py", line 223, in _got_info
self._setup_pass()
File "/usr/lib/python2.7/dist-packages/arista/transcoder.py", line 375, in _setup_pass
height = int((float(wmin) / owidth) \* oheight)
ZeroDivisionError: float division by zero

Some file info from mplayer is:
ID_VIDEO_ID=0
ID_AUDIO_ID=128
ID_FILENAME=[removed].vob
ID_DEMUXER=mpegps
ID_VIDEO_FORMAT=0x10000002
ID_VIDEO_BITRATE=9000000
ID_VIDEO_WIDTH=720
ID_VIDEO_HEIGHT=576
ID_VIDEO_FPS=25.000
ID_VIDEO_ASPECT=0.0000
ID_AUDIO_FORMAT=8192
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=0
ID_AUDIO_NCH=0
ID_START_TIME=0.06
ID_LENGTH=2519.87
ID_SEEKABLE=1
ID_CHAPTERS=0
ID_VIDEO_CODEC=ffmpeg2
ID_AUDIO_BITRATE=448000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_AUDIO_CODEC=ffac3
ID_EXIT=EOF

Apologies if this is a duplicate, I am getting an error when I try to search issues.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with the reported .vob input, then read arista/discoverer.py at _notify_caps_cb and arista/transcoder.py at _got_info and _setup_pass. Trace how the missing width and zero original width reach the division, and verify that transcoding the reported input no longer raises either traceback.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.