From e28cbce5ee6d6e454f793ccdf881f03d20d4a76b Mon Sep 17 00:00:00 2001 From: shimon Date: Sun, 14 May 2023 10:30:29 +0300 Subject: [PATCH] small updates --- app/config/videos-profiles.php | 12 ++++++++++-- app/init.php | 2 +- app/workers/videos.php | 9 +++++---- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/app/config/videos-profiles.php b/app/config/videos-profiles.php index 8a27496776..dcc7c6f6ec 100644 --- a/app/config/videos-profiles.php +++ b/app/config/videos-profiles.php @@ -9,6 +9,14 @@ return [ 'width' => 640, //width resolution in px 'height' => 360, //height resolution in px ], + [ + + 'name' => '480p', + 'videoBitRate' => 2100, + 'audioBitRate' => 64, + 'width' => 854, + 'height' => 480, + ], [ 'name' => '576p', 'videoBitRate' => 2538, @@ -17,14 +25,14 @@ return [ 'height' => 576, ], [ - 'name' => '1080p', + 'name' => '720p', 'videoBitRate' => 3551, 'audioBitRate' => 128, 'width' => 1280, 'height' => 720, ], [ - 'name' => '720p', + 'name' => '1080p', 'videoBitRate' => 4800, 'audioBitRate' => 128, 'width' => 1920, diff --git a/app/init.php b/app/init.php index ae1ed2f4c2..d26b8d6802 100644 --- a/app/init.php +++ b/app/init.php @@ -907,7 +907,7 @@ App::setResource('project', function ($dbForConsole, $request, $console) { /** @var Utopia\Database\Document $console */ $projectId = $request->getParam('project', $request->getHeader('x-appwrite-project', 'console')); - //$projectId = '645766aaac930ed0e90a'; + $projectId = '645905a0594ef29a8680'; if ($projectId === 'console') { return $console; diff --git a/app/workers/videos.php b/app/workers/videos.php index 0b8386f66a..b26af740e1 100644 --- a/app/workers/videos.php +++ b/app/workers/videos.php @@ -111,7 +111,7 @@ class VideosV1 extends Worker $this->ffprobe = FFProbe::create(); $this->ffmpeg = FFMpeg::create([ 'timeout' => 0, - 'ffmpeg.threads' => 12 + 'ffmpeg.threads' => 4 ]); if (!$this->ffprobe->isValid($this->inPath)) { @@ -585,12 +585,13 @@ class VideosV1 extends Worker $additionalParams = [ '-dn', '-sn', - '-vf', 'scale=iw:-2:force_original_aspect_ratio=increase,setsar=1:1', - '-bf', '3', + '-vf', 'scale=iw:-2:force_original_aspect_ratio=increase,setsar=1:1', //keep frame size + '-crf', '22', // constant rate factor + '-bf', '3', // bframe '-force_key_frames', 'expr:gte(t,n_forced*2)' //enforce strict key frame ]; - $segmentSize = 8; + $segmentSize = 6; if ($this->args['output'] === self::OUTPUT_DASH) { $media->dash() ->setFormat($format)