Skip to content

Commit

Permalink
新增对自定义ffmpeg的支持
Browse files Browse the repository at this point in the history
  • Loading branch information
CHKZL committed Jul 6, 2024
1 parent f8de57a commit d62cc24
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
26 changes: 24 additions & 2 deletions Core/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ public int _DefaultResolution_For_ComboBox
{
get
{
switch(_DefaultResolution)
switch (_DefaultResolution)
{
case 80:
return 0;
Expand All @@ -909,7 +909,7 @@ public int _DefaultResolution_For_ComboBox
case 30000:
return 6;
default:
return 4;
return 4;
}
}
set
Expand Down Expand Up @@ -1848,6 +1848,28 @@ public long _AutomaticFileCleaningThreshold
}
}

private static string UsingCustomFFMPEG = string.Empty;
/// <summary>
/// 是否使用自定义FFMPEG路径,如果要使用,该值为ffmpeg.exe的绝对路径,例如[D:/test/ffmpeg.exe]
/// 默认值:string.Empty
/// </summary>
public string _UsingCustomFFMPEG
{
get
{
return UsingCustomFFMPEG;
}
set
{
if (value.ToString() != UsingCustomFFMPEG)
{
UsingCustomFFMPEG = value.ToString();
OnPropertyChanged();
ModifyConfig(value);
}
}
}

}
#endregion
}
Expand Down
6 changes: 5 additions & 1 deletion Core/Tools/Transcode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ public async Task TranscodeAsync(string before, string after, RoomCardClass Card
}; // 捕捉的信息
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
if (File.Exists("./Plugins/ffmpeg/ffmpeg.exe"))
if (!string.IsNullOrEmpty(Config.Core_RunConfig._UsingCustomFFMPEG) && File.Exists(Config.Core_RunConfig._UsingCustomFFMPEG))
{
process.StartInfo.FileName = Config.Core_RunConfig._UsingCustomFFMPEG;
}
else if (File.Exists("./Plugins/ffmpeg/ffmpeg.exe"))
{
process.StartInfo.FileName = "./Plugins/ffmpeg/ffmpeg.exe";
}
Expand Down

0 comments on commit d62cc24

Please sign in to comment.