From cddac98132a976b8703103dc5871218f1526316c Mon Sep 17 00:00:00 2001 From: Pabloo474 <159337840+Pabloo474@users.noreply.github.com> Date: Tue, 3 Dec 2024 14:20:56 +0100 Subject: [PATCH 01/10] Feature 27324 Update audio codec (#670) * TTK-27324 Create new profile with dynamic waulity and trimming * Update encoder.yaml * Create output_dirname and output_basename vars * TTK-27324 Update encoder.yml * Update JobRender.php --------- Co-authored-by: pablo.garcia Co-authored-by: Pablo Ogando Ferreira --- config/packages/encoder.yaml | 46 ++++++++++++++++--- .../EncoderBundle/Services/JobRender.php | 2 + 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/config/packages/encoder.yaml b/config/packages/encoder.yaml index b3a209d15..698c80f26 100644 --- a/config/packages/encoder.yaml +++ b/config/packages/encoder.yaml @@ -1,3 +1,5 @@ + + pumukit_encoder: thumbnail: width: 768 @@ -40,7 +42,7 @@ pumukit_encoder: framerate: 25 channels: 1 audio: false - bat: ffmpeg -y -i "{{input}}" -acodec aac -vcodec libx264 -preset slow -crf 15 -threads 0 "{{output}}" + bat: ffmpeg -y -i "{{input}}" -acodec libfdk_aac -b:a 128k -ac 2 -ar 44100 -vcodec libx264 -preset slow -crf 15 -threads 0 "{{output}}" streamserver: name: Localmaster type: store @@ -66,7 +68,36 @@ pumukit_encoder: framerate: 25 channels: 1 audio: false - bat: ffmpeg -y -i "{{input}}" -acodec aac -vcodec libx264 -preset slow -crf 22 -movflags faststart -threads 0 "{{output}}" + bat: ffmpeg -y -i "{{input}}" -acodec libfdk_aac -b:a 128k -ac 2 -ar 44100 -vcodec libx264 -preset slow -crf 22 -movflags faststart -threads 0 "{{output}}" + streamserver: + name: Localhost + type: download + host: 127.0.0.1 + description: Local download server + dir_out: "%pumukit.downloads%" + url_out: "%pumukit.downloads_url%" + app: ffmpeg + rel_duration_size: 1 + rel_duration_trans: 1 + video_broadcastable_dynamic_quality: + generate_pic: false + display: false + wizard: true + master: false + nocheckduration: false + tags: html5 podcast + target: PUCHPODCAST + format: m3u8 + codec: h264 + mime_type: 'video/x-m3u8' + extension: m3u8 + resolution_hor: 0 + resolution_ver: 0 + bitrate: 1 Mbps + framerate: 25 + channels: 1 + audio: false + bat: ffmpeg -y -i "{{input}}" -filter_complex "[0:v]split=3[v1][v2][v3]; [v1]scale=w=1920:h=1080[v1out]; [v2]scale=w=1280:h=720[v2out]; [v3]scale=w=640:h=360[v3out]" -map "[v1out]" -c:v:0 libx264 -x264-params "nal-hrd=cbr:force-cfr=1" -b:v:0 4M -maxrate:v:0 4M -bufsize:v:0 4M -pix_fmt yuv420p -tune film -acodec libfdk_aac -preset slow -g 50 -sc_threshold 0 -crf 20 -keyint_min 50 -map "[v2out]" -c:v:1 libx264 -x264-params "nal-hrd=cbr:force-cfr=1" -pix_fmt yuv420p -tune film -acodec libfdk_aac -b:v:1 3M -maxrate:v:1 1M -bufsize:v:1 1M -preset slow -g 50 -crf 22 -sc_threshold 0 -keyint_min 50 -map "[v3out]" -c:v:2 libx264 -x264-params "nal-hrd=cbr:force-cfr=1" -pix_fmt yuv420p -tune film -acodec libfdk_aac -b:v:2 775k -maxrate:v:2 775k -bufsize:v:2 775k -preset slow -g 50 -crf 24 -sc_threshold 0 -keyint_min 50 -map a:0 -c:a:0 libfdk_aac -b:a:0 96k -ac 2 -map a:0 -c:a:1 libfdk_aac -b:a:1 128k -ac 2 -map a:0 -c:a:2 libfdk_aac -b:a:2 128k -ac 2 -f hls -hls_time 10 -hls_init_time 1 -hls_playlist_type vod -hls_flags independent_segments -hls_segment_type mpegts -hls_segment_filename "{{output_dirname}}/stream_%%v/data%%02d.ts" -master_pl_name {{output_basename}} -var_stream_map "v:0,a:0 v:1,a:1 v:2,a:2" "{{output_dirname}}/stream_%v/stream.m3u8" -threads 0 -shortest streamserver: name: Localhost type: download @@ -94,7 +125,7 @@ pumukit_encoder: framerate: 25 channels: 1 audio: false - bat: ffmpeg -y -i "{{input}}" -acodec aac -vcodec libx264 -preset slow -crf 22 -movflags faststart -threads 0 "{{output}}" + bat: ffmpeg -y -i "{{input}}" -acodec libfdk_aac -b:a 128k -ac 2 -ar 44100 -vcodec libx264 -preset slow -crf 22 -movflags faststart -threads 0 "{{output}}" streamserver: name: Localhost type: download @@ -112,7 +143,7 @@ pumukit_encoder: tags: html5 audio podcast target: PUCHWEBTV PUCHPODCAST* format: mp4 - codec: aac + codec: libfdk_aac mime_type: 'audio/x-mp4' extension: m4a resolution_hor: 0 @@ -121,7 +152,7 @@ pumukit_encoder: framerate: 0 channels: 1 audio: true - bat: ffmpeg -y -i "{{input}}" -acodec aac -vn -threads 0 "{{output}}" + bat: ffmpeg -y -i "{{input}}" -acodec libfdk_aac -b:a 128k -ac 2 -ar 44100 -vn -threads 0 "{{output}}" streamserver: name: Localhost type: download @@ -186,9 +217,12 @@ pumukit_encoder: target_default_profiles: PUCHWEBTV: audio: "audio_broadcastable" - video: "video_broadcastable" + video: "video_broadcastable video_broadcastable_dynamic_quality" image: "image_broadcastable image_raw_broadcastable" document: "document_broadcastable" PUCHPODCAST: audio: "audio_broadcastable" video: "video_broadcastable audio_broadcastable" + PUCHLMS: + audio: "audio_broadcastable" + video: "video_broadcastable" \ No newline at end of file diff --git a/src/Pumukit/EncoderBundle/Services/JobRender.php b/src/Pumukit/EncoderBundle/Services/JobRender.php index ee8bef956..6aff56b9d 100644 --- a/src/Pumukit/EncoderBundle/Services/JobRender.php +++ b/src/Pumukit/EncoderBundle/Services/JobRender.php @@ -49,6 +49,8 @@ public function renderBat(Job $job): string $vars['input'] = $job->getPathIni(); $vars['output'] = $job->getPathEnd(); + $vars['output_dirname'] = dirname($vars['output']); + $vars['output_basename'] = basename($vars['output']); foreach (range(1, 9) as $identifier) { $vars['tmpfile'.$identifier] = $this->tmpPath.'/'.random_int(0, mt_getrandmax()); From 22793e49a51d6369b73df1821978c5ecf1ac84f4 Mon Sep 17 00:00:00 2001 From: Pabloo474 <159337840+Pabloo474@users.noreply.github.com> Date: Wed, 4 Dec 2024 10:19:42 +0100 Subject: [PATCH 02/10] TTK-27395 Changing pumukit.masters and pumukit.downloads (#681) Co-authored-by: pablo.garcia --- .env | 2 -- config/packages/encoder.yaml | 23 ++++++++----------- config/services.yaml | 4 ++-- .../PumukitCoreExtension.php | 4 ++-- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/.env b/.env index 0357a5404..1bfd97f1d 100644 --- a/.env +++ b/.env @@ -61,8 +61,6 @@ PUMUKIT_PUBLIC_DIR=/srv/pumukit/public/ PUMUKIT_STORAGE_DIR=/srv/pumukit/public/storage PUMUKIT_INBOX=/srv/pumukit/public/storage/inbox PUMUKIT_TMP=/srv/pumukit/public/storage/tmp -PUMUKIT_DOWNLOADS=/srv/pumukit/public/storage/downloads -PUMUKIT_MASTERS=/srv/pumukit/public/storage/masters ENABLE_COOKIE_BANNER=false COOKIE_BANNER_PRIVACY_LINK= PUMUKIT_COPYRIGHT_INFO_URL= diff --git a/config/packages/encoder.yaml b/config/packages/encoder.yaml index 698c80f26..c584846b4 100644 --- a/config/packages/encoder.yaml +++ b/config/packages/encoder.yaml @@ -1,5 +1,3 @@ - - pumukit_encoder: thumbnail: width: 768 @@ -24,7 +22,7 @@ pumukit_encoder: type: store host: 127.0.0.1 description: Local master server - dir_out: "%pumukit.masters%" + dir_out: "%pumukit.masters_dir%" app: cp rel_duration_size: 1 rel_duration_trans: 1 @@ -48,7 +46,7 @@ pumukit_encoder: type: store host: 127.0.0.1 description: Local master server - dir_out: "%pumukit.masters%" + dir_out: "%pumukit.masters_dir%" url_out: "%pumukit.downloads_url%" app: ffmpeg rel_duration_size: 1 @@ -74,7 +72,7 @@ pumukit_encoder: type: download host: 127.0.0.1 description: Local download server - dir_out: "%pumukit.downloads%" + dir_out: "%pumukit.downloads_dir%" url_out: "%pumukit.downloads_url%" app: ffmpeg rel_duration_size: 1 @@ -103,7 +101,7 @@ pumukit_encoder: type: download host: 127.0.0.1 description: Local download server - dir_out: "%pumukit.downloads%" + dir_out: "%pumukit.downloads_dir%" url_out: "%pumukit.downloads_url%" app: ffmpeg rel_duration_size: 1 @@ -131,7 +129,7 @@ pumukit_encoder: type: download host: 127.0.0.1 description: Local download server - dir_out: "%pumukit.downloads%" + dir_out: "%pumukit.downloads_dir%" url_out: "%pumukit.downloads_url%" app: ffmpeg rel_duration_size: 1 @@ -158,7 +156,7 @@ pumukit_encoder: type: download host: 127.0.0.1 description: Local download server - dir_out: "%pumukit.downloads%" + dir_out: "%pumukit.downloads_dir%" url_out: "%pumukit.downloads_url%" app: ffmpeg rel_duration_size: 1 @@ -178,7 +176,7 @@ pumukit_encoder: type: download host: 127.0.0.1 description: Local download server - dir_out: "%pumukit.downloads%" + dir_out: "%pumukit.downloads_dir%" url_out: "%pumukit.downloads_url%" image_raw_broadcastable: image: true @@ -195,7 +193,7 @@ pumukit_encoder: type: download host: 127.0.0.1 description: Local download server - dir_out: "%pumukit.downloads%" + dir_out: "%pumukit.downloads_dir%" url_out: "%pumukit.downloads_url%" document_broadcastable: document: true @@ -211,7 +209,7 @@ pumukit_encoder: type: download host: 127.0.0.1 description: Local download server - dir_out: "%pumukit.downloads%" + dir_out: "%pumukit.downloads_dir%" url_out: "%pumukit.downloads_url%" target_default_profiles: @@ -223,6 +221,3 @@ pumukit_encoder: PUCHPODCAST: audio: "audio_broadcastable" video: "video_broadcastable audio_broadcastable" - PUCHLMS: - audio: "audio_broadcastable" - video: "video_broadcastable" \ No newline at end of file diff --git a/config/services.yaml b/config/services.yaml index c22dade7c..eb8adb7f1 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -36,8 +36,8 @@ parameters: pumukit.uploads_pic_url: "%env(string:PUMUKIT_UPLOADS_PIC_URL)%" pumukit.inbox: "%env(string:PUMUKIT_INBOX)%" pumukit.tmp: "%env(string:PUMUKIT_TMP)%" - pumukit.masters: "%env(string:PUMUKIT_MASTERS)%" - pumukit.downloads: "%env(string:PUMUKIT_DOWNLOADS)%" + pumukit.masters_dir: "%env(string:PUMUKIT_STORAGE_DIR)%/masters" + pumukit.downloads_dir: "%env(string:PUMUKIT_STORAGE_DIR)%/downloads" pumukit.downloads_url: "%env(string:PUMUKIT_SCHEME)%://%env(string:PUMUKIT_FRONTEND_HOST)%/storage/downloads" pumukit.delete_on_disk: "%env(bool:PUMUKIT_DELETE_ON_DISK)%" pumukit.copyright_info_url: "%env(PUMUKIT_COPYRIGHT_INFO_URL)%" diff --git a/src/Pumukit/CoreBundle/DependencyInjection/PumukitCoreExtension.php b/src/Pumukit/CoreBundle/DependencyInjection/PumukitCoreExtension.php index 33753d173..0d6bbe919 100644 --- a/src/Pumukit/CoreBundle/DependencyInjection/PumukitCoreExtension.php +++ b/src/Pumukit/CoreBundle/DependencyInjection/PumukitCoreExtension.php @@ -24,8 +24,8 @@ public function load(array $configs, ContainerBuilder $container): void $container->setParameter('pumukit.uploads_pic_dir', $config['uploads_pic_dir']); $container->setParameter('pumukit.inbox', $config['inbox']); $container->setParameter('pumukit.tmp', $config['tmp']); - $container->setParameter('pumukit.downloads', $config['downloads']); - $container->setParameter('pumukit.masters', $config['masters']); + $container->setParameter('pumukit.downloads_dir', $config['downloads']); + $container->setParameter('pumukit.masters_dir', $config['masters']); $container->setParameter('pumukit.delete_on_disk', $config['delete_on_disk']); $container->setParameter('pumukit.use_series_channels', $config['use_series_channels']); $container->setParameter('pumukit.full_magic_url', $config['full_magic_url']); From 5820e73e8a8de519eb4c349dda4c515167334a8b Mon Sep 17 00:00:00 2001 From: albacodina <48245111+albacodina@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:57:07 +0100 Subject: [PATCH 03/10] TTK-27394: Avoid Avoid showing duplicate opencast tracks (#682) Co-authored-by: Pablo Ogando Ferreira --- .../NewAdminBundle/Resources/views/Media/list.html.twig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Pumukit/NewAdminBundle/Resources/views/Media/list.html.twig b/src/Pumukit/NewAdminBundle/Resources/views/Media/list.html.twig index 05f828746..458532d40 100644 --- a/src/Pumukit/NewAdminBundle/Resources/views/Media/list.html.twig +++ b/src/Pumukit/NewAdminBundle/Resources/views/Media/list.html.twig @@ -18,14 +18,12 @@ {% if mm.isDocumentType() %} {% include '@PumukitNewAdmin/Media/Type/_document.html.twig' %} {% endif %} - - {% include '@PumukitNewAdmin/Media/List/_opencast.html.twig' %} - {% if mm.isExternalType() %} {% include '@PumukitNewAdmin/Media/Type/_external.html.twig' %} {% endif %} {% endfor %} + {% include '@PumukitNewAdmin/Media/List/_opencast.html.twig' %} {% include '@PumukitNewAdmin/Media/List/_create_options.html.twig' %} {% else %} From 4183d14e32fb0619b8c5a9eef8a70cd733cad257 Mon Sep 17 00:00:00 2001 From: albacodina <48245111+albacodina@users.noreply.github.com> Date: Thu, 5 Dec 2024 08:53:15 +0100 Subject: [PATCH 04/10] TTK-27400: Fix multistream track language access (#684) --- src/Pumukit/WebTVBundle/Resources/views/Misc/tracks.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Pumukit/WebTVBundle/Resources/views/Misc/tracks.html.twig b/src/Pumukit/WebTVBundle/Resources/views/Misc/tracks.html.twig index a465f25fd..1a4725646 100644 --- a/src/Pumukit/WebTVBundle/Resources/views/Misc/tracks.html.twig +++ b/src/Pumukit/WebTVBundle/Resources/views/Misc/tracks.html.twig @@ -8,7 +8,7 @@  |   - {% set lang = (object.getProperty('opencastlanguage')?(object.getProperty('opencastlanguage')|lower):(object.isMultistream()?object.getFilteredTrackWithTags(['display'], [], [], []).getLanguage():'en')) %} + {% set lang = (object.getProperty('opencastlanguage')?(object.getProperty('opencastlanguage')|lower):(object.isMultistream()?object.getFilteredTrackWithTags(['display'], [], [], []).language():'en')) %} {{ is_addon_language(lang) ? lang | language_name_custom : lang | language_name | capitalize }}  |  {{ mmobj_duration(object) | duration_string }} From e9a3c303fc2fb07e6947f10d5896774fedf869db Mon Sep 17 00:00:00 2001 From: Pabloo474 <159337840+Pabloo474@users.noreply.github.com> Date: Thu, 5 Dec 2024 09:14:38 +0100 Subject: [PATCH 05/10] TTK-27403: Update dirname variable (#685) * TTK-27403: Update dirname variable * fix: phpcsfixer --------- Co-authored-by: pablo.garcia Co-authored-by: Pablo Ogando Ferreira --- src/Pumukit/EncoderBundle/Services/JobRender.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Pumukit/EncoderBundle/Services/JobRender.php b/src/Pumukit/EncoderBundle/Services/JobRender.php index 6aff56b9d..db98e7f68 100644 --- a/src/Pumukit/EncoderBundle/Services/JobRender.php +++ b/src/Pumukit/EncoderBundle/Services/JobRender.php @@ -49,7 +49,7 @@ public function renderBat(Job $job): string $vars['input'] = $job->getPathIni(); $vars['output'] = $job->getPathEnd(); - $vars['output_dirname'] = dirname($vars['output']); + $vars['output_dirname'] = dirname($vars['output']).'/'.pathinfo($vars['output'], PATHINFO_FILENAME); $vars['output_basename'] = basename($vars['output']); foreach (range(1, 9) as $identifier) { From ff113d1b670ad494be27140ff17566c8f39f95ec Mon Sep 17 00:00:00 2001 From: Pabloo474 <159337840+Pabloo474@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:04:19 +0100 Subject: [PATCH 06/10] bugfix-27403: Create new var for stream dirs (#686) Co-authored-by: pablo.garcia Co-authored-by: Pablo Ogando Ferreira --- src/Pumukit/EncoderBundle/Services/JobRender.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Pumukit/EncoderBundle/Services/JobRender.php b/src/Pumukit/EncoderBundle/Services/JobRender.php index db98e7f68..202e82d1c 100644 --- a/src/Pumukit/EncoderBundle/Services/JobRender.php +++ b/src/Pumukit/EncoderBundle/Services/JobRender.php @@ -49,7 +49,8 @@ public function renderBat(Job $job): string $vars['input'] = $job->getPathIni(); $vars['output'] = $job->getPathEnd(); - $vars['output_dirname'] = dirname($vars['output']).'/'.pathinfo($vars['output'], PATHINFO_FILENAME); + $vars['output_dirname'] = dirname($vars['output']); + $vars['output_filename'] = pathinfo($vars['output'], PATHINFO_FILENAME); $vars['output_basename'] = basename($vars['output']); foreach (range(1, 9) as $identifier) { From 55a857f5744444ac13ac3004ed571db995a3e60e Mon Sep 17 00:00:00 2001 From: albacodina <48245111+albacodina@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:21:17 +0100 Subject: [PATCH 07/10] TTK-27374: Add upload option to Poddium (#687) * TTK-27374: Add upload option to Poddium * TTK-27374: fix php cs fixer --- .../Resources/views/Upload/uppy_drag_and_drop.html.twig | 2 +- src/Pumukit/WizardBundle/Controller/WizardController.php | 4 +++- .../Resources/views/Upload/_options.html.twig | 2 +- .../Resources/views/Upload/_profiles.html.twig | 8 ++++---- .../WizardBundle/Resources/views/Upload/_tabs.html.twig | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Pumukit/CoreBundle/Resources/views/Upload/uppy_drag_and_drop.html.twig b/src/Pumukit/CoreBundle/Resources/views/Upload/uppy_drag_and_drop.html.twig index a9ff24df7..b88bce628 100644 --- a/src/Pumukit/CoreBundle/Resources/views/Upload/uppy_drag_and_drop.html.twig +++ b/src/Pumukit/CoreBundle/Resources/views/Upload/uppy_drag_and_drop.html.twig @@ -3,6 +3,6 @@
- + {{ "Go to series"|trans }} » diff --git a/src/Pumukit/WizardBundle/Controller/WizardController.php b/src/Pumukit/WizardBundle/Controller/WizardController.php index bdb6080bf..d737223d2 100644 --- a/src/Pumukit/WizardBundle/Controller/WizardController.php +++ b/src/Pumukit/WizardBundle/Controller/WizardController.php @@ -33,7 +33,7 @@ public function __construct(InboxService $inboxService, UploadDispatcherService /** * @Route("/{series}/upload", name="wizard_upload") */ - public function upload(string $series): Response + public function upload(Request $request, string $series): Response { $series = $this->seriesRepository->search($series); @@ -44,6 +44,8 @@ public function upload(string $series): Response 'minFileSize' => $this->inboxService->minFileSize(), 'maxFileSize' => $this->inboxService->maxFileSize(), 'maxNumberOfFiles' => $this->inboxService->maxNumberOfFiles(), + 'show_profiles' => null !== $request->query->get('show_profiles') ? filter_var($request->query->get('show_profiles'), FILTER_VALIDATE_BOOLEAN) : true, + 'profile' => $request->query->get('profile', null), ]); } diff --git a/src/Pumukit/WizardBundle/Resources/views/Upload/_options.html.twig b/src/Pumukit/WizardBundle/Resources/views/Upload/_options.html.twig index 8132e54f8..8ea0cb204 100644 --- a/src/Pumukit/WizardBundle/Resources/views/Upload/_options.html.twig +++ b/src/Pumukit/WizardBundle/Resources/views/Upload/_options.html.twig @@ -1,7 +1,7 @@ {% include '@PumukitWizard/Upload/_tabs.html.twig' %}
-
+
{% include '@PumukitCore/Upload/uppy_drag_and_drop.html.twig' %}
diff --git a/src/Pumukit/WizardBundle/Resources/views/Upload/_profiles.html.twig b/src/Pumukit/WizardBundle/Resources/views/Upload/_profiles.html.twig index 0fadf292e..3c9458b5a 100644 --- a/src/Pumukit/WizardBundle/Resources/views/Upload/_profiles.html.twig +++ b/src/Pumukit/WizardBundle/Resources/views/Upload/_profiles.html.twig @@ -1,15 +1,15 @@ -
+

{{ "What do you want to do with the uploaded file?"|trans }}


  • -  {{ "Identical copy"|trans }} (Master copy) +  {{ "Identical copy"|trans }} (Master copy)
  • -  {{ "Encoded high quality copy"|trans }} (Master H264) +  {{ "Encoded high quality copy"|trans }} (Master H264)
  • -  {{ "Encoded low quality copy"|trans }} (Brodcastable master) +  {{ "Encoded low quality copy"|trans }} (Brodcastable master)

diff --git a/src/Pumukit/WizardBundle/Resources/views/Upload/_tabs.html.twig b/src/Pumukit/WizardBundle/Resources/views/Upload/_tabs.html.twig index f8b45c4f2..54ad0c5a9 100644 --- a/src/Pumukit/WizardBundle/Resources/views/Upload/_tabs.html.twig +++ b/src/Pumukit/WizardBundle/Resources/views/Upload/_tabs.html.twig @@ -2,12 +2,12 @@