Commit 49133bb7 authored by Priscila Manhaes's avatar Priscila Manhaes

Adding logger error for convert method

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@45525 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 95a99de0
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
from zope.interface import implements from zope.interface import implements
from cloudooo.interfaces.handler import IHandler from cloudooo.interfaces.handler import IHandler
from cloudooo.file import File from cloudooo.file import File
from cloudooo.util.util import logger
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
from tempfile import mktemp from tempfile import mktemp
...@@ -62,9 +63,9 @@ class Handler(object): ...@@ -62,9 +63,9 @@ class Handler(object):
"-y", "-y",
output_url] output_url]
# XXX ffmpeg has a bug that needs this options to work with webm format # XXX ffmpeg has a bug that needs this options to work with webm format
if destination_format == "webm": # if destination_format == "webm":
command.insert(3, "32k") # command.insert(3, "32k")
command.insert(3, "-ab") # command.insert(3, "-ab")
try: try:
stdout, stderr = Popen(command, stdout, stderr = Popen(command,
stdout=PIPE, stdout=PIPE,
...@@ -72,6 +73,8 @@ class Handler(object): ...@@ -72,6 +73,8 @@ class Handler(object):
close_fds=True, close_fds=True,
env=self.environment).communicate() env=self.environment).communicate()
self.input.reload(output_url) self.input.reload(output_url)
if len(self.input.getContent()) == 0:
logger.error(stderr.split("\n")[-2])
return self.input.getContent() return self.input.getContent()
finally: finally:
self.input.trash() self.input.trash()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment