diff options
author | pythonsnake <pythonsnake98@gmail.com> | 2013-02-10 11:43:18 +0100 |
---|---|---|
committer | Joar Wandborg <joar@wandborg.se> | 2013-02-10 20:11:47 +0100 |
commit | 34c35c8cec6b70cd0dad0fa3d91962a2fa97c093 (patch) | |
tree | 96751d4a159e5cf4547d09db91118f2f42fac2e7 | |
parent | 591c11609852c5481f00bf0eaa01ceafcd244f38 (diff) | |
download | mediagoblin-34c35c8cec6b70cd0dad0fa3d91962a2fa97c093.tar.lz mediagoblin-34c35c8cec6b70cd0dad0fa3d91962a2fa97c093.tar.xz mediagoblin-34c35c8cec6b70cd0dad0fa3d91962a2fa97c093.zip |
Fixed issue #511.
-rw-r--r-- | mediagoblin/media_types/video/transcoders.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/mediagoblin/media_types/video/transcoders.py b/mediagoblin/media_types/video/transcoders.py index 152de288..7a8166c4 100644 --- a/mediagoblin/media_types/video/transcoders.py +++ b/mediagoblin/media_types/video/transcoders.py @@ -477,8 +477,8 @@ from playbin') _log.debug('thumbnail message: {0}'.format(message)) if message.type == gst.MESSAGE_ERROR: - _log.error('thumbnail error: {0}'.format(message)) - gobject.idle_add(self.on_thumbnail_error) + _log.error('thumbnail error: {0}'.format(message.parse_error())) + gobject.idle_add(self.on_thumbnail_error, message) if message.type == gst.MESSAGE_STATE_CHANGED: prev_state, cur_state, pending_state = \ @@ -570,9 +570,17 @@ pending: {2}'.format( return False - def on_thumbnail_error(self): + def on_thumbnail_error(self, message): _log.error('Thumbnailing failed.') self.disconnect() + if 'Error calculating the output scaled size - integer overflow' in message.parse_error()[1]: + _log.error('Retrying with manually set sizes...') + info = VideoTranscoder().discover(self.source_path) + h = info['videoheight'] + w = info['videowidth'] + ratio = 180 / int(w) + h = int(h * ratio) + self.__init__(self.source_path, self.dest_path, 180, h) def disconnect(self): self.state = self.STATE_HALTING @@ -1007,4 +1015,4 @@ if __name__ == '__main__': print('I\'m a callback!') transcoder.transcode(*args, progress_callback=cb) elif options.action == 'discover': - print transcoder.discover(*args).__dict__ + print transcoder.discover(*args) |