From d15972e722367df613c03d4f32c7d78edb158525 Mon Sep 17 00:00:00 2001 From: "immich-push-o-matic[bot]" <179150890+immich-push-o-matic[bot]@users.noreply.github.com> Date: Sat, 3 Oct 2026 21:30:26 +0000 Subject: [PATCH] fix(server): don't select an audio stream ffprobe could not identify (#32062) fix(server): don't select an audio stream ffprobe could not identify (#30901) iPhone videos recorded with Apple Spatial Audio carry two audio tracks: an AAC track and an APAC track that ffmpeg has no decoder for. Both are marked default, so `compareStreams` ties on disposition and falls through to bitrate, where the APAC track wins because spatial audio is encoded at a higher rate. `audioStreams[0]` is then persisted and mapped into the transcode command, and ffmpeg fails before it starts encoding: [aist#0:2/none] Decoding requested, but no decoder found for: none Error opening output file .../out.mp4 Error opening output files: Invalid argument Drop audio streams ffprobe reported as `unknown` before the existing disposition/bitrate ordering runs. A stream with no codec to decode is not a usable audio stream, so an asset whose every audio track is unidentified is treated as having no audio at all. The video pipeline is unchanged, since the evidence here covers audio selection only. (cherry picked from commit 69f06a29ca67613355348172480054ebd7e09f6c) Co-authored-by: Lin, Chiang-Yu <110763842+RxChi1d@users.noreply.github.com> Co-authored-by: Mert <101130780+mertalev@users.noreply.github.com> --- server/src/repositories/media.repository.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/repositories/media.repository.ts b/server/src/repositories/media.repository.ts index d63dbde0c..905708735 100644 --- a/server/src/repositories/media.repository.ts +++ b/server/src/repositories/media.repository.ts @@ -291,7 +291,7 @@ export class MediaRepository { }; }), audioStreams: results.streams - .filter((stream) => stream.codec_type === 'audio') + .filter((stream) => stream.codec_type === 'audio' && stream.codec_name !== 'unknown') .sort((a, b) => this.compareStreams(a, b)) .map((stream) => ({ index: stream.index,