mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-19 20:32:15 +02:00
UI: Remove compatibility with FFmpeg < 6.1
This commit is contained in:
parent
f07004c3b7
commit
3ebe071c7b
@ -100,12 +100,8 @@ bool FFCodecAndFormatCompatible(const char *codec, const char *format)
|
|||||||
if (!codec || !format)
|
if (!codec || !format)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(59, 0, 100)
|
const AVOutputFormat *output_format =
|
||||||
AVOutputFormat *output_format;
|
av_guess_format(format, nullptr, nullptr);
|
||||||
#else
|
|
||||||
const AVOutputFormat *output_format;
|
|
||||||
#endif
|
|
||||||
output_format = av_guess_format(format, nullptr, nullptr);
|
|
||||||
if (!output_format)
|
if (!output_format)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -114,13 +110,8 @@ bool FFCodecAndFormatCompatible(const char *codec, const char *format)
|
|||||||
if (!codec_desc)
|
if (!codec_desc)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(60, 0, 100)
|
|
||||||
return avformat_query_codec(output_format, codec_desc->id,
|
|
||||||
FF_COMPLIANCE_EXPERIMENTAL) == 1;
|
|
||||||
#else
|
|
||||||
return avformat_query_codec(output_format, codec_desc->id,
|
return avformat_query_codec(output_format, codec_desc->id,
|
||||||
FF_COMPLIANCE_NORMAL) == 1;
|
FF_COMPLIANCE_NORMAL) == 1;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const unordered_set<string> builtin_codecs = {
|
static const unordered_set<string> builtin_codecs = {
|
||||||
@ -163,12 +154,9 @@ static const unordered_map<string, unordered_set<string>> codec_compat = {
|
|||||||
"opus",
|
"opus",
|
||||||
"alac",
|
"alac",
|
||||||
"flac",
|
"flac",
|
||||||
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(60, 5, 100)
|
|
||||||
// PCM in MP4 is only supported in FFmpeg > 6.0
|
|
||||||
"pcm_s16le",
|
"pcm_s16le",
|
||||||
"pcm_s24le",
|
"pcm_s24le",
|
||||||
"pcm_f32le",
|
"pcm_f32le",
|
||||||
#endif
|
|
||||||
}},
|
}},
|
||||||
{"fragmented_mp4",
|
{"fragmented_mp4",
|
||||||
{
|
{
|
||||||
@ -179,11 +167,9 @@ static const unordered_map<string, unordered_set<string>> codec_compat = {
|
|||||||
"opus",
|
"opus",
|
||||||
"alac",
|
"alac",
|
||||||
"flac",
|
"flac",
|
||||||
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(60, 5, 100)
|
|
||||||
"pcm_s16le",
|
"pcm_s16le",
|
||||||
"pcm_s24le",
|
"pcm_s24le",
|
||||||
"pcm_f32le",
|
"pcm_f32le",
|
||||||
#endif
|
|
||||||
}},
|
}},
|
||||||
// Not part of FFmpeg, see obs-outputs module
|
// Not part of FFmpeg, see obs-outputs module
|
||||||
{"hybrid_mp4",
|
{"hybrid_mp4",
|
||||||
|
@ -7698,26 +7698,11 @@ void OBSBasic::AutoRemux(QString input, bool no_show)
|
|||||||
const char *format = config_get_string(
|
const char *format = config_get_string(
|
||||||
config, isSimpleMode ? "SimpleOutput" : "AdvOut", "RecFormat2");
|
config, isSimpleMode ? "SimpleOutput" : "AdvOut", "RecFormat2");
|
||||||
|
|
||||||
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(60, 5, 100)
|
|
||||||
const obs_encoder_t *audioEncoder =
|
|
||||||
obs_output_get_audio_encoder(outputHandler->fileOutput, 0);
|
|
||||||
const char *aCodecName = obs_encoder_get_codec(audioEncoder);
|
|
||||||
bool audio_is_pcm = strncmp(aCodecName, "pcm", 3) == 0;
|
|
||||||
|
|
||||||
/* FFmpeg <= 6.0 cannot remux AV1+PCM into any supported format. */
|
|
||||||
if (audio_is_pcm && strcmp(vCodecName, "av1") == 0)
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Retain original container for fMP4/fMOV */
|
/* Retain original container for fMP4/fMOV */
|
||||||
if (strncmp(format, "fragmented", 10) == 0) {
|
if (strncmp(format, "fragmented", 10) == 0) {
|
||||||
output += "remuxed." + suffix;
|
output += "remuxed." + suffix;
|
||||||
} else if (strcmp(vCodecName, "prores") == 0) {
|
} else if (strcmp(vCodecName, "prores") == 0) {
|
||||||
output += "mov";
|
output += "mov";
|
||||||
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(60, 5, 100)
|
|
||||||
} else if (audio_is_pcm) {
|
|
||||||
output += "mov";
|
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
output += "mp4";
|
output += "mp4";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user