diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 5a33f9ae2..992dee191 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -7510,16 +7510,17 @@ void OBSBasic::AutoRemux(QString input, bool no_show) const char *format = config_get_string( config, isSimpleMode ? "SimpleOutput" : "AdvOut", "RecFormat2"); - /* AV1+PCM cannot be remuxed into any supported format (until FFmpeg 6.1) */ - if (strcmp(vCodecName, "av1") == 0 && - strncmp(aCodecName, "pcm", 3) == 0) + bool audio_is_pcm = strncmp(aCodecName, "pcm", 3) == 0; + /* FFmpeg <= 6.0 cannot remux AV1+PCM into any supported format. */ + if (audio_is_pcm && !ff_supports_pcm_in_mp4() && + strcmp(vCodecName, "av1") == 0) return; /* Retain original container for fMP4/fMOV */ if (strncmp(format, "fragmented", 10) == 0) { output += "remuxed." + suffix; } else if (strcmp(vCodecName, "prores") == 0 || - strncmp(aCodecName, "pcm", 3) == 0) { + (audio_is_pcm && !ff_supports_pcm_in_mp4())) { output += "mov"; } else { output += "mp4"; diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp index ae2b0bbe2..09304768c 100644 --- a/UI/window-basic-settings.cpp +++ b/UI/window-basic-settings.cpp @@ -4996,15 +4996,18 @@ static const unordered_map> codec_compat = { {"mpegts", {"h264", "hevc", "aac", "opus"}}, {"hls", {"h264", "hevc", "aac"}}, // Also using MPEG-TS, but no Opus support + {"mp4", + {"h264", "hevc", "av1", "aac", "opus", "alac", "flac", "pcm_s16le", + "pcm_s24le", "pcm_f32le"}}, + {"fragmented_mp4", + {"h264", "hevc", "av1", "aac", "opus", "alac", "flac", "pcm_s16le", + "pcm_s24le", "pcm_f32le"}}, {"mov", {"h264", "hevc", "prores", "aac", "alac", "pcm_s16le", "pcm_s24le", "pcm_f32le"}}, - {"mp4", {"h264", "hevc", "av1", "aac", "opus", "alac", "flac"}}, {"fragmented_mov", {"h264", "hevc", "prores", "aac", "alac", "pcm_s16le", "pcm_s24le", "pcm_f32le"}}, - {"fragmented_mp4", - {"h264", "hevc", "av1", "aac", "opus", "alac", "flac"}}, // MKV supports everything {"mkv", {}}, }; @@ -5019,6 +5022,12 @@ static bool ContainerSupportsCodec(const string &container, const string &codec) // Assume everything is supported if (codecs.empty()) return true; + + // PCM in MP4 is only supported in FFmpeg > 6.0 + if ((container == "mp4" || container == "fragmented_mp4") && + !ff_supports_pcm_in_mp4() && codec.find("pcm_") != string::npos) + return false; + return codecs.count(codec) > 0; }