mirror of
https://github.com/immich-app/immich.git
synced 2025-01-01 08:31:59 +00:00
fix(server): HEVC videos not playing on Apple devices (#6712)
* add hvc1 tag * formatting
This commit is contained in:
parent
0770ad15e5
commit
e5a70329c9
2 changed files with 9 additions and 0 deletions
|
@ -1094,6 +1094,7 @@ describe(MediaService.name, () => {
|
||||||
'-fps_mode passthrough',
|
'-fps_mode passthrough',
|
||||||
'-map 0:0',
|
'-map 0:0',
|
||||||
'-map 0:1',
|
'-map 0:1',
|
||||||
|
'-tag:v hvc1',
|
||||||
'-v verbose',
|
'-v verbose',
|
||||||
'-vf scale=-2:720,format=yuv420p',
|
'-vf scale=-2:720,format=yuv420p',
|
||||||
'-preset ultrafast',
|
'-preset ultrafast',
|
||||||
|
@ -1127,6 +1128,7 @@ describe(MediaService.name, () => {
|
||||||
'-fps_mode passthrough',
|
'-fps_mode passthrough',
|
||||||
'-map 0:0',
|
'-map 0:0',
|
||||||
'-map 0:1',
|
'-map 0:1',
|
||||||
|
'-tag:v hvc1',
|
||||||
'-v verbose',
|
'-v verbose',
|
||||||
'-vf scale=-2:720,format=yuv420p',
|
'-vf scale=-2:720,format=yuv420p',
|
||||||
'-preset ultrafast',
|
'-preset ultrafast',
|
||||||
|
@ -1673,6 +1675,7 @@ describe(MediaService.name, () => {
|
||||||
'-map 0:0',
|
'-map 0:0',
|
||||||
'-map 0:1',
|
'-map 0:1',
|
||||||
'-g 256',
|
'-g 256',
|
||||||
|
'-tag:v hvc1',
|
||||||
'-v verbose',
|
'-v verbose',
|
||||||
'-level 153',
|
'-level 153',
|
||||||
'-rc_mode 3',
|
'-rc_mode 3',
|
||||||
|
|
|
@ -44,6 +44,7 @@ class BaseConfig implements VideoCodecSWConfig {
|
||||||
// explicitly selects the video stream instead of leaving it up to FFmpeg
|
// explicitly selects the video stream instead of leaving it up to FFmpeg
|
||||||
`-map 0:${videoStream.index}`,
|
`-map 0:${videoStream.index}`,
|
||||||
];
|
];
|
||||||
|
|
||||||
if (audioStream) {
|
if (audioStream) {
|
||||||
options.push(`-map 0:${audioStream.index}`);
|
options.push(`-map 0:${audioStream.index}`);
|
||||||
}
|
}
|
||||||
|
@ -56,6 +57,11 @@ class BaseConfig implements VideoCodecSWConfig {
|
||||||
if (this.getGopSize() > 0) {
|
if (this.getGopSize() > 0) {
|
||||||
options.push(`-g ${this.getGopSize()}`);
|
options.push(`-g ${this.getGopSize()}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.config.targetVideoCodec === VideoCodec.HEVC) {
|
||||||
|
options.push('-tag:v hvc1');
|
||||||
|
}
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue