1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-29 15:11:58 +00:00

fix(server): HEVC videos not playing on Apple devices (#6712)

* add hvc1 tag

* formatting
This commit is contained in:
Mert 2024-01-28 21:17:20 -05:00 committed by GitHub
parent 0770ad15e5
commit e5a70329c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View file

@ -1094,6 +1094,7 @@ describe(MediaService.name, () => {
'-fps_mode passthrough',
'-map 0:0',
'-map 0:1',
'-tag:v hvc1',
'-v verbose',
'-vf scale=-2:720,format=yuv420p',
'-preset ultrafast',
@ -1127,6 +1128,7 @@ describe(MediaService.name, () => {
'-fps_mode passthrough',
'-map 0:0',
'-map 0:1',
'-tag:v hvc1',
'-v verbose',
'-vf scale=-2:720,format=yuv420p',
'-preset ultrafast',
@ -1673,6 +1675,7 @@ describe(MediaService.name, () => {
'-map 0:0',
'-map 0:1',
'-g 256',
'-tag:v hvc1',
'-v verbose',
'-level 153',
'-rc_mode 3',

View file

@ -44,6 +44,7 @@ class BaseConfig implements VideoCodecSWConfig {
// explicitly selects the video stream instead of leaving it up to FFmpeg
`-map 0:${videoStream.index}`,
];
if (audioStream) {
options.push(`-map 0:${audioStream.index}`);
}
@ -56,6 +57,11 @@ class BaseConfig implements VideoCodecSWConfig {
if (this.getGopSize() > 0) {
options.push(`-g ${this.getGopSize()}`);
}
if (this.config.targetVideoCodec === VideoCodec.HEVC) {
options.push('-tag:v hvc1');
}
return options;
}