diff --git a/cms/settings.py b/cms/settings.py index 7945215..21983c4 100644 --- a/cms/settings.py +++ b/cms/settings.py @@ -160,6 +160,7 @@ HLS_DIR = os.path.join(MEDIA_ROOT, "hls/") FFMPEG_COMMAND = "ffmpeg" # this is the path FFPROBE_COMMAND = "ffprobe" # this is the path +FFMPEG_THREADS = 0 # default - use optimal number of threads MP4HLS = "mp4hls" MASK_IPS_FOR_ACTIONS = True diff --git a/files/helpers.py b/files/helpers.py index 948c525..7706b0c 100644 --- a/files/helpers.py +++ b/files/helpers.py @@ -554,6 +554,8 @@ def get_base_ffmpeg_command( base_cmd = [ settings.FFMPEG_COMMAND, + "-threads", + str(settings.FFMPEG_THREADS), "-y", "-i", input_file, diff --git a/files/models.py b/files/models.py index 1d539cc..f6785e9 100644 --- a/files/models.py +++ b/files/models.py @@ -1482,6 +1482,8 @@ def encoding_file_save(sender, instance, created, **kwargs): ff.write("file {}\n".format(f)) cmd = [ settings.FFMPEG_COMMAND, + "-threads", + str(settings.FFMPEG_THREADS), "-y", "-f", "concat", diff --git a/files/tasks.py b/files/tasks.py index aee5b67..c3ce802 100644 --- a/files/tasks.py +++ b/files/tasks.py @@ -62,6 +62,8 @@ def chunkize_media(self, friendly_token, profiles, force=True): chunks_file_name += ".mkv" cmd = [ settings.FFMPEG_COMMAND, + "-threads", + str(settings.FFMPEG_THREADS), "-y", "-i", media.media_file.path,