From d626153a040edf7c1925ecd8a9cbdc346b2d5da8 Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Tue, 8 Oct 2024 16:04:36 -0700 Subject: [PATCH] fix making video proxy for iPhone 16 Pro https://forum.shotcut.org/t/iphone-16-pro-videos-fail-to-create-proxy- files/46026 --- src/proxymanager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/proxymanager.cpp b/src/proxymanager.cpp index f7d157e60e..ffd86f76c6 100644 --- a/src/proxymanager.cpp +++ b/src/proxymanager.cpp @@ -106,7 +106,13 @@ void ProxyManager::generateVideoProxy(Mlt::Producer &producer, bool fullRange, S auto audioIndex = producer.property_exists(kDefaultAudioIndexProperty) ? producer.get_int( kDefaultAudioIndexProperty) : producer.get_int("audio_index"); if (producer.get_int("video_index") < audioIndex) { - args << "-map" << "0:V?" << "-map" << "0:a?"; + // iPhone 16 Pro has a 4 channel (spatial) audio stream with codec "apac" that causes failure. + // This is not limited to only iPhone 16 Pro, but I think most iPhones only record one usable audio track. + if (!::qstrcmp(producer.get("meta.media.1.stream.type"), "audio") + && QString(producer.get("meta.attr.com.apple.quicktime.model.markup")).contains("iPhone")) + args << "-map" << "0:V?" << "-map" << "0:a:0"; + else + args << "-map" << "0:V?" << "-map" << "0:a?"; } else { args << "-map" << "0:a?" << "-map" << "0:V?"; }