From 7cc9b6d1c7ab174485ddfbf8db63f14162e01d7b Mon Sep 17 00:00:00 2001 From: vijeth-aradhya Date: Wed, 7 Jun 2017 20:42:42 +0530 Subject: [PATCH] Add main_task, complimentary_task and cleanup --- mediagoblin/media_types/video/processing.py | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/mediagoblin/media_types/video/processing.py b/mediagoblin/media_types/video/processing.py index a7e2d20c..4dee8d55 100644 --- a/mediagoblin/media_types/video/processing.py +++ b/mediagoblin/media_types/video/processing.py @@ -160,6 +160,31 @@ def store_metadata(media_entry, metadata): if len(stored_metadata): media_entry.media_data_init(orig_metadata=stored_metadata) +# ===================== + + +def main_task(**process_info): + processor = CommonVideoProcessor(process_info['manager'], process_info['entry']) + processor.common_setup(process_info['resolution']) + processor.transcode(medium_size=process_info['medium_size'], vp8_quality=process_info['vp8_quality'], + vp8_threads=process_info['vp8_threads'], vorbis_quality=process_info['vorbis_quality']) + processor.generate_thumb(thumb_size=process_info['thumb_size']) + processor.store_orig_metadata() + + +def complimentary_task(**process_info): + processor = CommonVideoProcessor(process_info['manager'], process_info['entry']) + processor.common_setup(process_info['resolution']) + processor.transcode(medium_size=process_info['medium_size'], vp8_quality=process_info['vp8_quality'], + vp8_threads=process_info['vp8_threads'], vorbis_quality=process_info['vorbis_quality']) + + +def processing_cleanup(**process_info): + processor = CommonVideoProcessor(process_info['manager'], process_info['entry']) + processor.delete_queue_file() + +# ===================== + class CommonVideoProcessor(MediaProcessor): """ -- 2.25.1