Fixed AAC fallback not working, fixed no output if audio merge failed

This commit is contained in:
N00MKRAD
2021-02-05 22:30:23 +01:00
parent e50c55ef90
commit 0f06c65ce2
3 changed files with 3 additions and 2 deletions

View File

@@ -222,7 +222,7 @@ namespace Flowframes.IO
return true;
}
static bool TryMove(string source, string target, bool deleteIfExists = true)
public static bool TryMove(string source, string target, bool deleteIfExists = true)
{
try
{

View File

@@ -137,7 +137,7 @@ namespace Flowframes.Media
{
containerExt = containerExt.Remove(".");
string codec = "aac";
string bitrate = $"{Config.GetInt("aacBitrate", 160)}k";
string bitrate = $"{Config.GetInt("aacBitrate", 160)}";
if(containerExt == "webm" || containerExt == "mkv")
{

View File

@@ -155,6 +155,7 @@ namespace Flowframes.Media
if ((File.Exists(outPath) && IOUtils.GetFilesize(outPath) < 1024) || lastOutputFfmpeg.Contains("Invalid data") || lastOutputFfmpeg.Contains("Error initializing output stream"))
{
Logger.Log("Failed to merge audio, even with re-encoding. Output will not have audio.", false, false, "ffmpeg");
IOUtils.TryMove(tempPath, inputFile); // Move temp file back
IOUtils.TryDeleteIfExists(tempPath);
return;
}