davidfischer-ch / pytoolbox

Toolbox for Python scripts.
Other
41 stars 15 forks source link

Handle ffmpeg bad time values #13

Closed davidfischer-ch closed 10 years ago

davidfischer-ch commented 10 years ago

[2014-03-17 10:17:29,584: ERROR/MainProcess] Task encodebox.tasks.transcode[d909578c-6014-46a7-8d5a-e7449b095153] raised unexpected: ValueError('invalid literal for float(): -577014:-32:-22.-77',) Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/celery-3.1.9-py2.7.egg/celery/app/trace.py", line 238, in trace_task R = retval = fun(_args, _kwargs) File "/usr/local/lib/python2.7/dist-packages/celery-3.1.9-py2.7.egg/celery/app/trace.py", line 416, in protected_call return self.run(_args, _kwargs) File "/usr/local/lib/python2.7/dist-packages/encodebox-0.5.0_beta-py2.7.egg/encodebox/tasks.py", line 89, in transcode for statistics in encoder_module.encode(transcode_pass[1], transcode_pass[2], transcode_pass[3]): File "/usr/local/lib/python2.7/dist-packages/pytoolbox/ffmpeg.py", line 208, in encode ratio = time_ratio(out_duration, in_duration) File "/usr/local/lib/python2.7/dist-packages/pytoolbox/datetime.py", line 133, in time_ratio ratio = total_seconds(numerator) / total_seconds(denominator) File "/usr/local/lib/python2.7/dist-packages/pytoolbox/datetime.py", line 169, in total_seconds return float(time) ValueError: invalid literal for float(): -577014:-32:-22.-77