Disable webm variation creation for video assets

Encoding webm video is very time consuming and currently h264 is
supported by most browsers. Once we switch to a different encoding
backend we can reintroduce it, if needed, along with multiple
resolutions.
This commit is contained in:
Francesco Siddi 2016-07-07 10:42:05 +02:00
parent 694016f58b
commit 782ac9ac1e

View File

@ -149,21 +149,22 @@ def _process_video(gcs, file_id, local_file, src_file):
root, _ = os.path.splitext(src_file['file_path']) root, _ = os.path.splitext(src_file['file_path'])
src_file['variations'] = [] src_file['variations'] = []
for v in ('mp4', 'webm'): # Most of these properties will be available after encode.
# Most of these properties will be available after encode. v = 'mp4'
file_variation = dict( file_variation = dict(
format=v, format=v,
content_type='video/{}'.format(v), content_type='video/{}'.format(v),
file_path='{}-{}.{}'.format(root, v, v), file_path='{}-{}.{}'.format(root, v, v),
size='', size='',
duration=0, duration=0,
width=0, width=0,
height=0, height=0,
length=0, length=0,
md5='', md5='',
) )
# Append file variation # Append file variation. Originally mp4 and webm were the available options,
src_file['variations'].append(file_variation) # that's why we build a list.
src_file['variations'].append(file_variation)
j = Encoder.job_create(src_file) j = Encoder.job_create(src_file)
if j is None: if j is None: