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 b3a209d15..168d2c8e5 100644 --- a/config/packages/encoder.yaml +++ b/config/packages/encoder.yaml @@ -22,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 @@ -40,13 +40,13 @@ 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 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 @@ -66,13 +66,42 @@ 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%" + dir_out: "%pumukit.downloads_dir%" + 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 dynamic + 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 + host: 127.0.0.1 + description: Local download server + dir_out: "%pumukit.downloads_dir%" url_out: "%pumukit.downloads_url%" app: ffmpeg rel_duration_size: 1 @@ -94,13 +123,13 @@ 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%" + dir_out: "%pumukit.downloads_dir%" url_out: "%pumukit.downloads_url%" app: ffmpeg rel_duration_size: 1 @@ -112,7 +141,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,13 +150,13 @@ 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 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 @@ -147,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 @@ -164,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 @@ -180,13 +209,13 @@ 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: PUCHWEBTV: audio: "audio_broadcastable" - video: "video_broadcastable" + video: "video_broadcastable video_broadcastable_dynamic_quality" image: "image_broadcastable image_raw_broadcastable" document: "document_broadcastable" PUCHPODCAST: 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']); 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/EncoderBundle/Services/JobRender.php b/src/Pumukit/EncoderBundle/Services/JobRender.php index ee8bef956..202e82d1c 100644 --- a/src/Pumukit/EncoderBundle/Services/JobRender.php +++ b/src/Pumukit/EncoderBundle/Services/JobRender.php @@ -49,6 +49,9 @@ public function renderBat(Job $job): string $vars['input'] = $job->getPathIni(); $vars['output'] = $job->getPathEnd(); + $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) { $vars['tmpfile'.$identifier] = $this->tmpPath.'/'.random_int(0, mt_getrandmax()); 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 %} diff --git a/src/Pumukit/WebTVBundle/Resources/views/Misc/tracks.html.twig b/src/Pumukit/WebTVBundle/Resources/views/Misc/tracks.html.twig index a465f25fd..438931a74 100644 --- a/src/Pumukit/WebTVBundle/Resources/views/Misc/tracks.html.twig +++ b/src/Pumukit/WebTVBundle/Resources/views/Misc/tracks.html.twig @@ -8,14 +8,17 @@  |   - {% 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 }} {% else %} {% set tracks = object.getFilteredTracksWithTags(['display'], [], [], []) %} - {% for track in tracks | filter(track => not track.isHide()) %} + {% set dynamic_quality_tracks = tracks | filter(track => track.tags().containsTag('dynamic')) %} + {% set filtered_tracks = (dynamic_quality_tracks | length > 0) ? dynamic_quality_tracks : tracks %} + + {% for track in filtered_tracks | filter(track => not track.isHide()) %} {% if magic_url is defined %} {% set url_track = url('pumukit_webtv_multimediaobject_magicindex', {secret: object.secret, 'track_id': track.id}) %} {% else %} @@ -39,7 +42,8 @@ {% endif %} {% endapply %} - ({{ track.language()|language_name|capitalize }}) + ({{ track.language()|language_name|capitalize }}) + {% endfor %} {% endif %} diff --git a/src/Pumukit/WebTVBundle/Resources/views/MultimediaObject/template_share.html.twig b/src/Pumukit/WebTVBundle/Resources/views/MultimediaObject/template_share.html.twig index 676a334a2..ffcdcb8ea 100644 --- a/src/Pumukit/WebTVBundle/Resources/views/MultimediaObject/template_share.html.twig +++ b/src/Pumukit/WebTVBundle/Resources/views/MultimediaObject/template_share.html.twig @@ -1,20 +1,22 @@ {% set trackid = (track.id is defined)?track.id:null %} -{% if multimediaObject.isVideoAudioType() and ((url is not defined or url is null) or (urlIframe is not defined or urlIframe is null)) %} - {% if multimediaObject.isPublished %} - {% set url = url('pumukit_webtv_multimediaobject_index', {'id': multimediaObject.id, 'track_id': trackid}) %} - {% set urlIframe = url('pumukit_webtv_multimediaobject_iframe', {'id':multimediaObject.id, 'track_id': trackid}) %} +{% if (url is not defined or url is null) or (urlIframe is not defined or urlIframe is null) %} + {% if multimediaObject.isVideoAudioType() %} + {% if multimediaObject.isPublished %} + {% set url = url('pumukit_webtv_multimediaobject_index', {'id': multimediaObject.id, 'track_id': trackid}) %} + {% set urlIframe = url('pumukit_webtv_multimediaobject_iframe', {'id':multimediaObject.id, 'track_id': trackid}) %} + {% else %} + {% set url = url('pumukit_webtv_multimediaobject_magicindex', {'secret': multimediaObject.secret, 'track_id': trackid }) %} + {% set urlIframe = url('pumukit_webtv_multimediaobject_magiciframe', {'secret': multimediaObject.secret, 'track_id': trackid }) %} + {% endif %} {% else %} - {% set url = url('pumukit_webtv_multimediaobject_magicindex', {'secret': multimediaObject.secret, 'track_id': trackid }) %} - {% set urlIframe = url('pumukit_webtv_multimediaobject_magiciframe', {'secret': multimediaObject.secret, 'track_id': trackid }) %} + {% if multimediaObject.isPublished %} + {% set url = url('pumukit_webtv_multimediaobject_index', {'id': multimediaObject.id, 'track_id': trackid}) %} + {% set urlIframe = url('pumukit_player_index_iframe', {'id':multimediaObject.id, 'track_id': trackid}) %} + {% else %} + {% set url = url('pumukit_webtv_multimediaobject_magicindex', {'secret': multimediaObject.secret, 'track_id': trackid }) %} + {% set urlIframe = url('pumukit_player_magic_index_iframe', {'secret': multimediaObject.secret, 'track_id': trackid }) %} + {% endif %} {% endif %} -{% else %} - {% if multimediaObject.isPublished %} - {% set url = url('pumukit_webtv_multimediaobject_index', {'id': multimediaObject.id, 'track_id': trackid}) %} - {% set urlIframe = url('pumukit_player_index_iframe', {'id':multimediaObject.id, 'track_id': trackid}) %} - {% else %} - {% set url = url('pumukit_webtv_multimediaobject_index', {'id': multimediaObject.id, 'track_id': trackid}) %} - {% set urlIframe = url('pumukit_player_magic_index_iframe', {'secret': multimediaObject.secret, 'track_id': trackid }) %} - {% endif %} {% endif %}
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/_buttons.html.twig b/src/Pumukit/WizardBundle/Resources/views/Upload/_buttons.html.twig index 79cd2345f..40d78768c 100644 --- a/src/Pumukit/WizardBundle/Resources/views/Upload/_buttons.html.twig +++ b/src/Pumukit/WizardBundle/Resources/views/Upload/_buttons.html.twig @@ -1,3 +1,3 @@ - + « {{ "Back"|trans }} 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..0fd683c48 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 @@