Skip to content

Commit

Permalink
vod: make QF configurable
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Patil <[email protected]>
  • Loading branch information
pulsejet committed Oct 25, 2023
1 parent 3106108 commit feaa6e5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
- **Feature**: External transcoders are much easier to set up now. See [docs](https://memories.gallery/hw-transcoding) for details.
- **Feature**: Folders view in shares ([#880](https://github.com/pulsejet/memories/pull/880))
- **Feature**: Improved back button navigation on mobile ([#861](https://github.com/pulsejet/memories/issues/861)).
- **Feature**: The transcoding quality factor can now be configured from the admin panel.

## [v5.5.0] - 2023-10-06

Expand Down
4 changes: 3 additions & 1 deletion lib/Service/BinExt.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class BinExt
{
public const EXIFTOOL_VER = '12.60';
public const GOVOD_VER = '0.1.20';
public const GOVOD_VER = '0.1.21';
public const NX_VER_MIN = '1.1';

/** Get the path to the temp directory */
Expand Down Expand Up @@ -176,6 +176,8 @@ public static function getGoVodConfig(bool $local = false): array
{
// Get config from system values
$env = [
'qf' => SystemConfig::get('memories.vod.qf'),

'vaapi' => SystemConfig::get('memories.vod.vaapi'),
'vaapiLowPower' => SystemConfig::get('memories.vod.vaapi.low_power'),

Expand Down
4 changes: 4 additions & 0 deletions lib/Settings/SystemConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ class SystemConfig
// start go-vod if it is not running already.
'memories.vod.external' => false,

// Quality Factor used for transcoding
// This correspondes to CRF for x264 and global_quality for VA-API
'memories.vod.qf' => 24,

// Set the default video quality for a first time user
// 0 => Auto (default)
// -1 => Original (max quality with transcoding)
Expand Down
1 change: 1 addition & 0 deletions src/components/admin/AdminTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type ISystemConfig = {
'memories.vod.bind': string;
'memories.vod.connect': string;
'memories.vod.external': boolean;
'memories.vod.qf': number;
'memories.video_default_quality': string;

'memories.vod.vaapi': boolean;
Expand Down
11 changes: 11 additions & 0 deletions src/components/admin/sections/VideoTranscoder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@
:value="config['memories.vod.connect']"
@change="update('memories.vod.connect', $event.target.value)"
/>

<NcTextField
type="number"
min="15"
max="45"
placeholder="25"
:label="t('memories', 'Quality Factor (15 - 45) (default 25)')"
:label-visible="true"
:value="String(config['memories.vod.qf'])"
@change="update('memories.vod.qf', Number($event.target.value))"
/>
</p>
</div>
</template>
Expand Down

0 comments on commit feaa6e5

Please sign in to comment.