Skip to content

Commit

Permalink
Merge branch '5.0.x' into bugfix_27389_display_iframe_images_and_docs
Browse files Browse the repository at this point in the history
  • Loading branch information
albacodina committed Dec 13, 2024
2 parents 77065ae + c94c765 commit bf14195
Show file tree
Hide file tree
Showing 14 changed files with 86 additions and 50 deletions.
2 changes: 0 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
57 changes: 43 additions & 14 deletions config/packages/encoder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)%"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<div id="uploader_drag_and_drop" class="col-xs-12"></div>
</div>

<a href="{{ path('pumukitnewadmin_mms_index', {'series': series.id}) }}" class="btn btn-default btn-pumukit pull-right">
<a href="{{ path('pumukitnewadmin_mms_index', {'id': series.id}) }}" class="btn btn-default btn-pumukit pull-right">
{{ "Go to series"|trans }} &raquo;
</a>
3 changes: 3 additions & 0 deletions src/Pumukit/EncoderBundle/Services/JobRender.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
10 changes: 7 additions & 3 deletions src/Pumukit/WebTVBundle/Resources/views/Misc/tracks.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
</a>
&nbsp;|&nbsp;&nbsp;
<span class="language">
{% 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 }}
</span>
&nbsp;|&nbsp; {{ mmobj_duration(object) | duration_string }}
</li>
{% 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 %}
Expand All @@ -39,7 +42,8 @@
{% endif %}
{% endapply %}

<span class="language"> ({{ track.language()|language_name|capitalize }})</span> </a>
<span class="language"> ({{ track.language()|language_name|capitalize }})</span>
</a>
</li>
{% endfor %}
{% endif %}
Original file line number Diff line number Diff line change
@@ -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 %}

<div class="panel panel-default panel-pmk">
Expand Down
4 changes: 3 additions & 1 deletion src/Pumukit/WizardBundle/Controller/WizardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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),
]);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<a href="{{ path('pumukitnewadmin_mms_index', {'series': series.id}) }}" class="btn btn-default btn-raised">
<a href="{{ path('pumukitnewadmin_mms_index', {'series': series.id}) }}" class="btn btn-default btn-raised" style="visibility: {{ show_profiles ? 'visible' : 'hidden' }}">
&laquo; {{ "Back"|trans }}
</a>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% include '@PumukitWizard/Upload/_tabs.html.twig' %}

<div class="tab-content">
<div role="tabpanel" class="tab-pane" id="local">
<div role="tabpanel" class="tab-pane active" id="local">
{% include '@PumukitCore/Upload/uppy_drag_and_drop.html.twig' %}
</div>
<div role="tabpanel" class="tab-pane" id="server">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<div>
<div style="display: {{ show_profiles ? 'block' : 'none' }}">
<h4>{{ "What do you want to do with the uploaded file?"|trans }}</h4>
<br/>
<ul class="list-inline text-center">
<li>
<input type="radio" name="profile_option" value="master_copy" checked> &nbsp;{{ "Identical copy"|trans }} <strong>(Master copy)</strong>
<input type="radio" name="profile_option" value="master_copy" {% if profile is null or profile == 'master_copy' %}checked{% endif %}> &nbsp;{{ "Identical copy"|trans }} <strong>(Master copy)</strong>
</li>
<li>
<input type="radio" name="profile_option" value="master_encoded"> &nbsp;{{ "Encoded high quality copy"|trans }} <strong>(Master H264)</strong>
<input type="radio" name="profile_option" value="master_encoded" {% if profile == 'master_encoded' %}checked{% endif %}> &nbsp;{{ "Encoded high quality copy"|trans }} <strong>(Master H264)</strong>
</li>
<li>
<input type="radio" name="profile_option" value="broadcastable"> &nbsp;{{ "Encoded low quality copy"|trans }} <strong>(Brodcastable master)</strong>
<input type="radio" name="profile_option" value="broadcastable" {% if profile == 'broadcastable' %}checked{% endif %}> &nbsp;{{ "Encoded low quality copy"|trans }} <strong>(Brodcastable master)</strong>
</li>
</ul>
<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<div role="tabpanel">
<ul class="nav nav-tabs" role="tablist" style="background:transparent; border: 0;">
<li>
<li class="nav-item active">
<a class="btn" href="#local" aria-controls="home" role="tab" data-toggle="tab" style="color: black !important;">
{{ "Local"|trans }}
</a>
</li>
<li>
<li class="nav-item" style="display: {{ show_profiles ? 'block' : 'none' }}">
<a class="btn" href="#server" aria-controls="home" role="tab" data-toggle="tab" style="color: black !important;">
{{ "Server"|trans }}
</a>
Expand Down

0 comments on commit bf14195

Please sign in to comment.