Introducing external video encoding
It is now possible to specify an encoding backend (at the moment only zencoder) to take care of video variations encoding. Files transfer happens directly on CGS (although any storage backend can be supported). New requirements is the Zencoder Python library.
This commit is contained in:
@@ -5,11 +5,13 @@ from datetime import datetime
|
||||
import bugsnag
|
||||
from bugsnag.flask import handle_exceptions
|
||||
from algoliasearch import algoliasearch
|
||||
from zencoder import Zencoder
|
||||
from flask import g
|
||||
from flask import request
|
||||
from flask import url_for
|
||||
from flask import abort
|
||||
from eve import Eve
|
||||
|
||||
from eve.auth import TokenAuth
|
||||
from eve.io.mongo import Validator
|
||||
|
||||
@@ -105,6 +107,12 @@ if 'ALGOLIA_USER' in app.config:
|
||||
else:
|
||||
algolia_index_users = None
|
||||
|
||||
# Encoding backend
|
||||
if app.config['ENCODING_BACKEND'] == 'zencoder':
|
||||
encoding_service_client = Zencoder(app.config['ZENCODER_API_KEY'])
|
||||
else:
|
||||
encoding_service_client = None
|
||||
|
||||
from application.utils.authentication import validate_token
|
||||
from application.utils.authorization import check_permissions
|
||||
from application.utils.cdn import hash_file_path
|
||||
@@ -302,3 +310,6 @@ app.on_delete_item_files += before_deleting_file
|
||||
from modules.file_storage import file_storage
|
||||
#from modules.file_storage.serve import *
|
||||
app.register_blueprint(file_storage, url_prefix='/storage')
|
||||
# The encoding module (receive notification and report progress)
|
||||
from modules.encoding import encoding
|
||||
app.register_blueprint(encoding, url_prefix='/encoding')
|
||||
|
Reference in New Issue
Block a user