Merge branch 'multiple-qualities-frontend' into 'transcoding_progress'
Minor changes See merge request !3
This commit is contained in:
commit
0eeb2adad7
@ -185,7 +185,7 @@ def main_task(entry_id, resolution, medium_size, **process_info):
|
||||
|
||||
|
||||
@celery.task()
|
||||
def complimentary_task(entry_id, resolution, medium_size, **process_info):
|
||||
def complementary_task(entry_id, resolution, medium_size, **process_info):
|
||||
"""
|
||||
Side celery task to transcode the video to other resolutions
|
||||
"""
|
||||
@ -336,7 +336,7 @@ class CommonVideoProcessor(MediaProcessor):
|
||||
|
||||
else:
|
||||
_log.debug('Entered transcoder')
|
||||
self.transcoder.transcode(self.process_filename, tmp_dst, self.entry,
|
||||
self.transcoder.transcode(self.process_filename, tmp_dst,
|
||||
vp8_quality=vp8_quality,
|
||||
vp8_threads=vp8_threads,
|
||||
vorbis_quality=vorbis_quality,
|
||||
@ -595,7 +595,7 @@ class VideoProcessingManager(ProcessingManager):
|
||||
if comp_res != def_res:
|
||||
priority_num += -1
|
||||
tasks_list.append(
|
||||
complimentary_task.signature(args=(entry.id, comp_res,
|
||||
complementary_task.signature(args=(entry.id, comp_res,
|
||||
ACCEPTED_RESOLUTIONS[comp_res]),
|
||||
kwargs=reprocess_info, queue='default',
|
||||
priority=priority_num, immutable=True)
|
||||
|
@ -158,13 +158,12 @@ class VideoTranscoder(object):
|
||||
self.progress_percentage = 0
|
||||
self.loop = GLib.MainLoop()
|
||||
|
||||
def transcode(self, src, dst, entry, **kwargs):
|
||||
def transcode(self, src, dst, **kwargs):
|
||||
'''
|
||||
Transcode a video file into a 'medium'-sized version.
|
||||
'''
|
||||
self.source_path = src
|
||||
self.destination_path = dst
|
||||
self.entry = entry
|
||||
|
||||
# vp8enc options
|
||||
self.destination_dimensions = kwargs.get('dimensions', (640, 640))
|
||||
@ -375,8 +374,6 @@ class VideoTranscoder(object):
|
||||
self._progress_callback(percent_increment/self.num_of_resolutions)
|
||||
_log.info('{percent}% of {dest} resolution done..'
|
||||
'.'.format(percent=percent, dest=self.destination_dimensions))
|
||||
_log.info('{0:.2f}% of all resolutions done'
|
||||
'...'.format(self.entry.transcoding_progress))
|
||||
elif message.type == Gst.MessageType.ERROR:
|
||||
_log.error('Got error: {0}'.format(message.parse_error()))
|
||||
self.dst_data = None
|
||||
|
@ -61,7 +61,7 @@ from mediagoblin.tools import template
|
||||
from mediagoblin.media_types.image import ImageMediaManager
|
||||
from mediagoblin.media_types.pdf.processing import check_prerequisites as pdf_check_prerequisites
|
||||
from mediagoblin.media_types.video.processing import (
|
||||
VideoProcessingManager, main_task, complimentary_task, group,
|
||||
VideoProcessingManager, main_task, complementary_task, group,
|
||||
processing_cleanup, CommonVideoProcessor)
|
||||
from mediagoblin.media_types.video.util import ACCEPTED_RESOLUTIONS
|
||||
from mediagoblin.submit.lib import new_upload_entry, run_process_media
|
||||
@ -602,7 +602,7 @@ class TestSubmissionVideo(BaseTestSubmission):
|
||||
assert result[i][2] == media_file.file_path
|
||||
|
||||
@mock.patch('mediagoblin.media_types.video.processing.processing_cleanup.signature')
|
||||
@mock.patch('mediagoblin.media_types.video.processing.complimentary_task.signature')
|
||||
@mock.patch('mediagoblin.media_types.video.processing.complementary_task.signature')
|
||||
@mock.patch('mediagoblin.media_types.video.processing.main_task.signature')
|
||||
def test_celery_tasks(self, mock_main_task, mock_comp_task, mock_cleanup):
|
||||
|
||||
@ -674,7 +674,7 @@ class TestSubmissionVideo(BaseTestSubmission):
|
||||
if comp_res != def_res:
|
||||
priority_num += -1
|
||||
tasks_list.append(
|
||||
complimentary_task.signature(args=(entry.id, comp_res,
|
||||
complementary_task.signature(args=(entry.id, comp_res,
|
||||
ACCEPTED_RESOLUTIONS[comp_res]),
|
||||
kwargs=reprocess_info, queue='default',
|
||||
priority=priority_num, immutable=True)
|
||||
@ -709,7 +709,7 @@ class TestSubmissionVideo(BaseTestSubmission):
|
||||
if comp_res != def_res:
|
||||
priority_num += -1
|
||||
tasks_list.append(
|
||||
complimentary_task.signature(args=(entry.id, comp_res,
|
||||
complementary_task.signature(args=(entry.id, comp_res,
|
||||
ACCEPTED_RESOLUTIONS[comp_res]),
|
||||
kwargs=reprocess_info, queue='default',
|
||||
priority=priority_num, immutable=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user