diff --git a/core/renderer.py b/core/renderer.py index c6c9f9e..7b135b1 100755 --- a/core/renderer.py +++ b/core/renderer.py @@ -12,6 +12,7 @@ Author: Wesnydy Lima Ribeiro E-Mail: wesnydy@lavid.ufpb.br """ +import json import os import pika import PikaManager @@ -43,6 +44,8 @@ PATH_SCREENS = "/storage/frames/" # Status of renderer to process new requests. Answer one request at a time. worker_available = True +# Path of libras video. +libras_video = None # pyvirtualdisplay instance display = None # ffmpeg process instance @@ -88,7 +91,7 @@ def start_ffmpeg(id): id : string Identification of request. """ - global ffmpeg, display + global ffmpeg, display, libras_video # logger.info("Starting ffmpeg") libras_video = os.path.join(PATH_LIBRAS, id + ".mp4") ffmpeg = subprocess.Popen( @@ -164,7 +167,14 @@ def run(ch, method, properties, body): start_new_thread(send_to_video_creator, (properties.correlation_id, body)) start_video_creator(properties.correlation_id) - body = properties.correlation_id + ".mp4" + try: + filesize = os.path.getsize(libras_video) + except: + filesize = 0 + + body = {"file": properties.correlation_id+".mp4", "size": filesize} + json.dumps(body) + manager.send_to_queue("videos", body, properties) clean(properties.correlation_id) -- libgit2 0.21.2