Skip to content

Commit

Permalink
Fix Splitting and Muxing showing wrong Progress in Two Pass Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Alkl58 committed Dec 16, 2021
1 parent 2fffb25 commit 5f04a41
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions NotEnoughAV1Encodes/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -952,8 +952,8 @@
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<ProgressBar Grid.Column="0" Value="{Binding Progress}" Maximum="{Binding FrameCountTwoPass}"/>
<ProgressBar Grid.Column="1" Value="{Binding ProgressSecondPass}" Maximum="{Binding FrameCountTwoPass}"/>
<ProgressBar Grid.Column="0" Value="{Binding Progress}" Maximum="{Binding FrameCount}"/>
<ProgressBar Grid.Column="1" Value="{Binding ProgressSecondPass}" Maximum="{Binding FrameCount}"/>
</Grid>
</Grid>
</DataTemplate>
Expand Down
10 changes: 4 additions & 6 deletions NotEnoughAV1Encodes/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -808,12 +808,6 @@ private void AddToQueue(string identifier, bool skipSubs)
queueElement.Preset = PresetSettings;
queueElement.VideoDB = videoDB;

// Double the framecount for two pass encoding
if (queueElement.Passes == 2)
{
queueElement.FrameCount = videoDB.MIFrameCount + videoDB.MIFrameCount;
}

if (ToggleSwitchFilterDeinterlace.IsOn && ComboBoxFiltersDeinterlace.SelectedIndex is 1 or 2)
{
queueElement.FrameCount += queueElement.FrameCount;
Expand Down Expand Up @@ -1619,6 +1613,10 @@ private static void UpdateProgressBar(object sender, EventArgs e, Queue.QueueEle

// Progress 2nd-Pass of 2-Pass Encoding
queueElement.ProgressSecondPass = Convert.ToDouble(encodedFramesSecondPass);

// Divide by 2
try { encodedFrames /= 2; } catch { }
try { encodedFramesSecondPass /= 2; } catch { }
}

queueElement.Status = "Encoded: " + ((decimal)(encodedFrames + encodedFramesSecondPass) / queueElement.FrameCount).ToString("0.00%");
Expand Down
2 changes: 0 additions & 2 deletions NotEnoughAV1Encodes/Queue/QueueElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ public string Status
public float PySceneDetectThreshold { get; set; }
/// <summary>Framecount of Source Video.</summary>
public long FrameCount { get; set; }
/// <summary>Framecount Progressbar Two Pass Encoding.</summary>
public long FrameCountTwoPass { get => FrameCount / 2; }
/// <summary>List of Progress of each Chunk.</summary>
public List<ChunkProgress> ChunkProgress { get; set; } = new();
/// <summary>State of UI Settings</summary>
Expand Down

0 comments on commit 5f04a41

Please sign in to comment.