From 1be1171481149dd908e06978a90c66c96c368e50 Mon Sep 17 00:00:00 2001 From: alkl58 Date: Fri, 29 Sep 2023 23:03:56 +0200 Subject: [PATCH] Fix using filters with the new no splitting option --- NotEnoughAV1Encodes/Video/VideoEncode.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/NotEnoughAV1Encodes/Video/VideoEncode.cs b/NotEnoughAV1Encodes/Video/VideoEncode.cs index c626a68..62eaf3d 100644 --- a/NotEnoughAV1Encodes/Video/VideoEncode.cs +++ b/NotEnoughAV1Encodes/Video/VideoEncode.cs @@ -23,7 +23,7 @@ public void Encode(int _workerCount, List VideoChunks, Queue.QueueElemen Global.Logger("INFO - VideoEncode.Encode() => Chunk: " + chunk, queueElement.Output + ".log"); try { concurrencySemaphoreInner.Wait(token); } catch (OperationCanceledException) { } - + Task taskInner = Task.Run(() => { try @@ -40,7 +40,7 @@ public void Encode(int _workerCount, List 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; @@ -82,13 +82,13 @@ public void Encode(int _workerCount, List 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)) @@ -211,7 +211,7 @@ public void Encode(int _workerCount, List 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; @@ -263,7 +263,7 @@ public void Encode(int _workerCount, List 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();