Skip to content

Commit

Permalink
Fix using filters with the new no splitting option
Browse files Browse the repository at this point in the history
  • Loading branch information
Alkl58 committed Sep 29, 2023
1 parent cdb443f commit 1be1171
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions NotEnoughAV1Encodes/Video/VideoEncode.cs
Expand Up @@ -23,7 +23,7 @@ public void Encode(int _workerCount, List<string> VideoChunks, Queue.QueueElemen
Global.Logger("INFO - VideoEncode.Encode() => Chunk: " + chunk, queueElement.Output + ".log");
try { concurrencySemaphoreInner.Wait(token); }
catch (OperationCanceledException) { }

Task taskInner = Task.Run(() =>
{
try
Expand All @@ -40,7 +40,7 @@ public void Encode(int _workerCount, List<string> VideoChunks, Queue.QueueElemen
{
// Bad Implementation, however it's KISS
if (File.Exists(Path.Combine(Global.Temp, "NEAV1E", queueElement.UniqueIdentifier, "Video", index.ToString("D6") + ".webm")) == false &&
File.Exists(Path.Combine(Global.Temp, "NEAV1E", queueElement.UniqueIdentifier, "Video", index.ToString("D6") + ".ivf")) == false &&
File.Exists(Path.Combine(Global.Temp, "NEAV1E", queueElement.UniqueIdentifier, "Video", index.ToString("D6") + ".ivf")) == false &&
File.Exists(Path.Combine(Global.Temp, "NEAV1E", queueElement.UniqueIdentifier, "Video", index.ToString("D6") + ".mp4")) == false )
{
alreadyEncoded = false;
Expand Down Expand Up @@ -82,13 +82,13 @@ public void Encode(int _workerCount, List<string> VideoChunks, Queue.QueueElemen
int finalProgress = 0;
// Apply filter if the video has not been processed before
if (queueElement.ChunkingMethod == 1 || (queueElement.ChunkingMethod == 0 && queueElement.ReencodeMethod == 3))
if (queueElement.ChunkingMethod == 1 || queueElement.ChunkingMethod == 2 || (queueElement.ChunkingMethod == 0 && queueElement.ReencodeMethod == 3))
{
ffmpegFilter = queueElement.FilterCommand;
}
// Subtitle Hardsubbing is only possible with Scenebased Encoding at this stage
if (queueElement.ChunkingMethod == 1 && queueElement.SubtitleBurnCommand != null)
if ((queueElement.ChunkingMethod == 1 || queueElement.ChunkingMethod == 2) && queueElement.SubtitleBurnCommand != null)
{
// Only allow Picture Based Burn in, if no other Filter is being used
if (string.IsNullOrEmpty(queueElement.FilterCommand))
Expand Down Expand Up @@ -211,7 +211,7 @@ public void Encode(int _workerCount, List<string> VideoChunks, Queue.QueueElemen
Global.LaunchedPIDs.Add(_pid);
Global.Logger("TRACE - VideoEncode.Encode() => Added PID: " + _pid + " Chunk: " + chunk, queueElement.Output + ".log");
// Create Progress Object
Queue.ChunkProgress chunkProgress = new();
chunkProgress.ChunkName = chunk;
Expand Down Expand Up @@ -263,7 +263,7 @@ public void Encode(int _workerCount, List<string> VideoChunks, Queue.QueueElemen
{
passesSettings = " -pass 2 -passlogfile " + "\"" + Path.Combine(Global.Temp, "NEAV1E", queueElement.UniqueIdentifier, "Video", index.ToString("D6") + "_stats.log") + "\" ";
ChunkOutput = passesSettings + "\"" + Path.Combine(Global.Temp, "NEAV1E", queueElement.UniqueIdentifier, "Video", index.ToString("D6") + ".mp4") + "\"";
}
}
}
Process processVideo2ndPass = new();
Expand Down

0 comments on commit 1be1171

Please sign in to comment.