This commit is contained in:
shimon
2023-03-07 09:47:50 +02:00
parent 658cfee38e
commit 92f75bd3d9
4 changed files with 19 additions and 19 deletions
+3 -3
View File
@@ -346,8 +346,8 @@ App::patch('/v1/videos/:videoId/subtitles/:subtitleId')
->param('videoId', null, new UID(), 'Video unique ID.')
->param('bucketId', '', new CustomId(), 'Subtitle bucket unique ID.')
->param('fileId', '', new CustomId(), 'Subtitle file unique ID.')
->param('name', '', new Text(128), 'Subtitle name.')
->param('code', '', new Text(128), 'Subtitle code name.')
->param('name', '', new Text(32), 'Subtitle customized name.')
->param('code', '', new Text(3), 'Subtitle 3 letter code name.')
->param('default', false, new Boolean(true), 'Default subtitle.')
->inject('response')
->inject('dbForProject')
@@ -748,7 +748,7 @@ App::get('/v1/videos/:videoId/outputs/:output')
$_subtitles[] = [
'id' => $adaptationId,
'baseUrl' => $baseUrl . '/subtitles/' . $subtitle->getId(),
'code' => $subtitle->getAttribute('code'),
'name' => $subtitle->getAttribute('name'),
];
$adaptationId++;
}
+3 -3
View File
@@ -12,7 +12,7 @@ echo '<?xml version="1.0" encoding="utf-8"?>'; ?>
?>
<AdaptationSet <?php if (isset($adaptation['id'])):?> id="<?php echo ($adaptation['id']); endif;?>"<?php if (isset($adaptation['attributes']['contentType'])): ?> contentType="<?php echo $adaptation['attributes']['contentType']; ?>"<?php endif;?><?php if (isset($adaptation['attributes']['startWithSAP'])): ?> startWithSAP="<?php echo $adaptation['attributes']['startWithSAP']; ?>"<?php endif;?><?php if (isset($adaptation['attributes']['segmentAlignment'])): ?> segmentAlignment="<?php echo $adaptation['attributes']['segmentAlignment']; ?>"<?php endif;?><?php if (isset($adaptation['attributes']['bitstreamSwitching'])): ?> bitstreamSwitching="<?php echo $adaptation['attributes']['bitstreamSwitching']; ?>"<?php endif;?><?php if (isset($adaptation['attributes']['frameRate'])): ?> frameRate="<?php echo $adaptation['attributes']['frameRate']; ?>"<?php endif;?><?php if (isset($adaptation['attributes']['maxWidth'])): ?> maxWidth="<?php echo $adaptation['attributes']['maxWidth']; ?>"<?php endif;?><?php if (isset($adaptation['attributes']['par'])): ?> par="<?php echo $adaptation['attributes']['par']; ?>"<?php endif;?><?php if (isset($adaptation['attributes']['lang'])): ?> lang="<?php echo $adaptation['attributes']['lang']; ?>"<?php endif;?>>
<Representation <?php if (isset($representation['attributes']['id'])):?> id="<?php echo $representation['attributes']['id']; ?>"<?php endif;?><?php if (isset($representation['attributes']['mimeType'])):?> mimeType="<?php echo $representation['attributes']['mimeType']; ?>"<?php endif;?><?php if (isset($representation['attributes']['codecs'])):?> codecs="<?php echo $representation['attributes']['codecs']; ?>"<?php endif;?><?php if (isset($representation['attributes']['bandwidth'])):?> bandwidth="<?php echo $representation['attributes']['bandwidth']; ?>"<?php endif;?><?php if (isset($representation['attributes']['width'])):?> width="<?php echo $representation['attributes']['width']; ?>"<?php endif;?><?php if (isset($representation['attributes']['height'])):?> height="<?php echo $representation['attributes']['height']; ?>"<?php endif;?><?php if (isset($representation['attributes']['sar'])):?> sar="<?php echo $representation['attributes']['sar']; ?>"<?php endif;?><?php if (isset($representation['attributes']['audioSamplingRate'])):?> audioSamplingRate="<?php echo $representation['attributes']['audioSamplingRate']; ?>"<?php endif;?>>
<BaseURL><?php if (isset($adaptation['baseUrl'])): echo $adaptation['baseUrl']; endif;?></BaseURL>
<BaseURL><?php if (isset($adaptation['baseUrl'])): echo $this->escape($adaptation['baseUrl']); endif;?></BaseURL>
<?php if (isset($adaptation['attributes']['contentType']) && $adaptation['attributes']['contentType'] === 'audio' ):?>
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" />
<?php endif;?>
@@ -28,10 +28,10 @@ echo '<?xml version="1.0" encoding="utf-8"?>'; ?>
</AdaptationSet>
<?php endforeach; ?>
<?php foreach ($this->getParam('subtitles', []) as $subtitle):?>
<AdaptationSet id="<?php if (isset($subtitle['id'])): echo $subtitle['id']; endif;?>" lang="<?php if (isset($subtitle['code'])): echo $subtitle['code']; endif;?>" mimeType="text/vtt">
<AdaptationSet id="<?php if (isset($subtitle['id'])): echo $subtitle['id']; endif;?>" lang="<?php if (isset($subtitle['name'])): echo $this->escape($subtitle['name']); endif;?>" mimeType="text/vtt">
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="subtitle" />
<Representation>
<BaseURL><?php if (isset($subtitle['baseUrl'])): echo $subtitle['baseUrl']; endif;?></BaseURL>
<BaseURL><?php if (isset($subtitle['baseUrl'])): $this->escape($subtitle['baseUrl']); endif;?></BaseURL>
</Representation>
</AdaptationSet>
<?php endforeach; ?>
+1 -1
View File
@@ -4,7 +4,7 @@
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_audio"<?php if($audio['name'] !== null):?>,NAME="<?php echo $audio['name'];?>"<?php endif;?>,DEFAULT=<?php echo $audio['default']; ?><?php if($audio['language'] !== null):?>,LANGUAGE="<?php echo $audio['language'];?>"<?php endif;?><?php if($audio['uri'] !== null):?>,URI="<?php echo $audio['uri'];?>"<?php endif;?><?php echo PHP_EOL?>
<?php endforeach; ?>
<?php foreach ($this->getParam('subtitles', []) as $subtitle): ?>
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="<?php echo $subtitle['name']; ?>",DEFAULT=<?php echo $subtitle['default']; ?>,AUTOSELECT=NO,FORCED=NO,LANGUAGE="<?php echo $subtitle['code']; ?>",URI="<?php echo $subtitle['uri']; ?>"<?php echo PHP_EOL?>
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="<?php echo $this->escape($subtitle['name']); ?>",DEFAULT=<?php echo $subtitle['default']; ?>,AUTOSELECT=NO,FORCED=NO,LANGUAGE="<?php echo $this->escape($subtitle['code']); ?>",URI="<?php echo $subtitle['uri']; ?>"<?php echo PHP_EOL?>
<?php endforeach; ?>
<?php foreach ($this->getParam('renditions', []) as $rendition): ?>
#EXT-X-STREAM-INF:BANDWIDTH="<?php echo $rendition['bandwidth']; ?>",RESOLUTION="<?php echo $rendition['resolution']; ?>",NAME="<?php echo $rendition['name']; ?>"<?php if($rendition['subs'] !== null):?>,SUBTITLES="<?php echo $rendition['subs'];?>"<?php endif;?><?php if($rendition['audio'] !== null):?>,AUDIO="<?php echo $rendition['audio'];?>"<?php endif;?> <?php echo PHP_EOL?>
@@ -46,18 +46,6 @@ class VideoRendition extends Model
'default' => 0,
'example' => 1592981290,
])
->addRule('videoBitRate', [
'type' => self::TYPE_INTEGER,
'description' => 'Video bitrate.',
'default' => 0,
'example' => 3050,
])
->addRule('audioBitRate', [
'type' => self::TYPE_INTEGER,
'description' => 'Audio bitrate.',
'default' => 0,
'example' => 64,
])
->addRule('width', [
'type' => self::TYPE_INTEGER,
'description' => 'Video width.',
@@ -70,6 +58,18 @@ class VideoRendition extends Model
'default' => 0,
'example' => 400,
])
->addRule('videoBitRate', [
'type' => self::TYPE_INTEGER,
'description' => 'Video bitrate.',
'default' => 0,
'example' => 3050,
])
->addRule('audioBitRate', [
'type' => self::TYPE_INTEGER,
'description' => 'Audio bitrate.',
'default' => 0,
'example' => 64,
])
->addRule('status', [
'type' => self::TYPE_STRING,
'description' => 'Rendition transcoding status',