mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(server): add transcode presets (#2084)
* feat: add transcode presets * Add migration * chore: generate api * refactor: use enum type instead of string for transcode option * chore: generate api * refactor: enhance readability of runVideoEncode method * refactor: reuse SettingSelect for transcoding presets * refactor: simplify return statement * chore: regenerate api * fix: correct label attribute * Update import * fix test --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
b49f66bbc9
commit
2c67090e3c
14 changed files with 216 additions and 45 deletions
|
|
@ -3,11 +3,10 @@
|
|||
notificationController,
|
||||
NotificationType
|
||||
} from '$lib/components/shared-components/notification/notification';
|
||||
import { api, SystemConfigFFmpegDto } from '@api';
|
||||
import { api, SystemConfigFFmpegDto, SystemConfigFFmpegDtoTranscodeEnum } from '@api';
|
||||
import SettingButtonsRow from '../setting-buttons-row.svelte';
|
||||
import SettingInputField, { SettingInputFieldType } from '../setting-input-field.svelte';
|
||||
import SettingSelect from '../setting-select.svelte';
|
||||
import SettingSwitch from '../setting-switch.svelte';
|
||||
import { isEqual } from 'lodash-es';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
|
|
@ -105,7 +104,12 @@
|
|||
<SettingSelect
|
||||
label="VIDEO CODEC (-vcodec)"
|
||||
bind:value={ffmpegConfig.targetVideoCodec}
|
||||
options={['h264', 'hevc', 'vp9']}
|
||||
options={[
|
||||
{ value: 'h264', text: 'h264' },
|
||||
{ value: 'hevc', text: 'hevc' },
|
||||
{ value: 'vp9', text: 'vp9' }
|
||||
]}
|
||||
name="vcodec"
|
||||
isEdited={!(ffmpegConfig.targetVideoCodec == savedConfig.targetVideoCodec)}
|
||||
/>
|
||||
|
||||
|
|
@ -117,11 +121,22 @@
|
|||
isEdited={!(ffmpegConfig.targetScaling == savedConfig.targetScaling)}
|
||||
/>
|
||||
|
||||
<SettingSwitch
|
||||
title="TRANSCODE ALL"
|
||||
subtitle="Transcode all files, even if they already match the specified format?"
|
||||
bind:checked={ffmpegConfig.transcodeAll}
|
||||
isEdited={!(ffmpegConfig.transcodeAll == savedConfig.transcodeAll)}
|
||||
<SettingSelect
|
||||
label="TRANSCODE"
|
||||
bind:value={ffmpegConfig.transcode}
|
||||
name="transcode"
|
||||
options={[
|
||||
{ value: SystemConfigFFmpegDtoTranscodeEnum.All, text: 'All videos' },
|
||||
{
|
||||
value: SystemConfigFFmpegDtoTranscodeEnum.Optimal,
|
||||
text: 'Videos higher than 1080p or not in the desired format'
|
||||
},
|
||||
{
|
||||
value: SystemConfigFFmpegDtoTranscodeEnum.Required,
|
||||
text: 'Only videos not in the desired format'
|
||||
}
|
||||
]}
|
||||
isEdited={!(ffmpegConfig.transcode == savedConfig.transcode)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue