Skip to content

Commit

Permalink
Added 10 and 12bit for rav1e
Browse files Browse the repository at this point in the history
  • Loading branch information
Alkl58 committed Mar 9, 2020
1 parent 5f9ab39 commit cfc0526
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
4 changes: 2 additions & 2 deletions NotEnoughAV1Encodes/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@
<Label Content="Do not specify input or output! Do not specify 1/2-Pass (use the Passes option under &quot;Video&quot;)! " HorizontalAlignment="Left" Margin="10,216,0,0" VerticalAlignment="Top" Foreground="#FFB9B9B9"/>
</Grid>
</TabItem>
<TabItem Header="Audio" Background="#FF2C2C2C" Foreground="White" Style="{DynamicResource DarkTabItem}">
<TabItem Header="Audio" Background="#FF2C2C2C" Foreground="White" Style="{DynamicResource DarkTabItem}" IsSelected="True">
<Grid Background="#FF191919">
<Label Content="Audio" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="White" Margin="10,10,0,0" FontWeight="Bold"/>
<Label Content="Codec:" HorizontalAlignment="Left" Margin="35,41,0,0" VerticalAlignment="Top" Foreground="White"/>
Expand All @@ -393,7 +393,7 @@
<TextBox x:Name="TextBoxCustomTempFolder" HorizontalAlignment="Left" Height="23" Margin="196,254,0,0" TextWrapping="Wrap" Text="Temp Folder" VerticalAlignment="Top" Width="553" Background="#FF191919" Foreground="White" VerticalContentAlignment="Center" IsEnabled="{Binding IsChecked, ElementName=CheckBoxCustomTempFolder}"/>
<CheckBox x:Name="CheckBoxCustomTempFolder" Content="Custom Temp Path" HorizontalAlignment="Left" Margin="37,259,0,0" VerticalAlignment="Top" Foreground="White"/>
<Button x:Name="ButtonCustomTempFolder" Content=" ..." HorizontalAlignment="Left" Margin="766,254,0,0" VerticalAlignment="Top" Width="85" Height="23" Background="#FF191919" Foreground="White" Style="{DynamicResource ButtonDarkStyle}" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" BorderBrush="White" IsEnabled="{Binding IsChecked, ElementName=CheckBoxCustomTempFolder}" Click="ButtonCustomTempFolder_Click"/>
<CheckBox x:Name="CheckBoxDeleteTempFiles" Content="Delete Temp Files after Encode" HorizontalAlignment="Left" Margin="196,22,0,0" VerticalAlignment="Top" Foreground="White" IsChecked="True"/>
<CheckBox x:Name="CheckBoxDeleteTempFiles" Content="Delete Temp Files after Encode" HorizontalAlignment="Left" Margin="196,22,0,0" VerticalAlignment="Top" Foreground="White"/>
<CheckBox x:Name="CheckBoxCustomRaviePath" Content="Custom rav1e Path" HorizontalAlignment="Left" Margin="37,200,0,0" VerticalAlignment="Top" Foreground="White"/>
<TextBox x:Name="TextBoxCustomRaviePath" HorizontalAlignment="Left" Height="23" Margin="196,195,0,0" TextWrapping="Wrap" Text="rav1e.exe" VerticalAlignment="Top" Width="553" Background="#FF191919" Foreground="White" VerticalContentAlignment="Center" IsEnabled="{Binding IsChecked, ElementName=CheckBoxCustomRaviePath}"/>
<Button x:Name="ButtonCustomRaviePath" Content=" ..." HorizontalAlignment="Left" Margin="766,195,0,0" VerticalAlignment="Top" Width="85" Height="23" Background="#FF191919" Foreground="White" Style="{DynamicResource ButtonDarkStyle}" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" BorderBrush="White" IsEnabled="{Binding IsChecked, ElementName=CheckBoxCustomRaviePath}" Click="ButtonCustomRaviePath_Click"/>
Expand Down
28 changes: 23 additions & 5 deletions NotEnoughAV1Encodes/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public partial class MainWindow : Window
public static string ravie = "";
public static string ravieQualityMode = "";
public static string allSettingsRavie = "";
public static string pipeBitDepth = " yuv420p";
//------------------------------------------------------||
public DateTime starttimea;

Expand Down Expand Up @@ -356,6 +357,7 @@ public void SetRavieParameters()
ravieQualityMode = " --bitrate " + TextBoxBitrate.Text;
}
//----------------------------------------------------------------------------------------||
//Sets All Encoding Settings--------------------------------------------------------------||
if (CheckBoxAdvancedSettings.IsChecked == false)
{
//Basic Settings
Expand All @@ -369,6 +371,15 @@ public void SetRavieParameters()
{
allSettingsRavie = " " + TextBoxCustomCommand.Text;
}
//----------------------------------------------------------------------------------------||
//Sets Piping Bit-Depth Settings because rav1e can't convert it itself--------------------||
if (ComboBoxBitDepth.Text == "10")
{
pipeBitDepth = " yuv420p10le -strict -1";
}else if (ComboBoxBitDepth.Text == "12")
{
pipeBitDepth = " yuv420p12le -strict -1";
}
}

private void ButtonOpenSource_Click(object sender, RoutedEventArgs e)
Expand Down Expand Up @@ -438,6 +449,9 @@ private void ComboBoxEncoder_SelectionChanged(object sender, SelectionChangedEve
SliderQuality.Value = 30;
SliderPreset.Maximum = 8;
SliderPreset.Value = 3;
CheckBoxCBR.IsEnabled = true;
ComboBoxAqMode.IsEnabled = true;
CheckBoxTwoPass.IsEnabled = true;
}

}else if (comboitem == "RAV1E")
Expand All @@ -448,11 +462,15 @@ private void ComboBoxEncoder_SelectionChanged(object sender, SelectionChangedEve
SliderPreset.Value = 6;
CheckBoxCBR.IsEnabled = false;
ComboBoxAqMode.IsEnabled = false;
CheckBoxTwoPass.IsEnabled = false; //2-Pass completly broken in rav1e
}
else if (comboitem == "SVT-AV1")
{
SliderQuality.Maximum = 63;
SliderQuality.Value = 50;
CheckBoxCBR.IsEnabled = true;
ComboBoxAqMode.IsEnabled = true;
CheckBoxTwoPass.IsEnabled = true;
}
}

Expand Down Expand Up @@ -671,7 +689,7 @@ private void EncodeRavie()
startInfo.UseShellExecute = true;
startInfo.FileName = "cmd.exe";
startInfo.WorkingDirectory = exeffmpegPath + "\\";
startInfo.Arguments = "/C ffmpeg.exe -i " + '\u0022' + chunksDir + "\\" + items + '\u0022' + " -pix_fmt yuv420p -vsync 0 -f yuv4mpegpipe - | " + '\u0022' + ravie + '\u0022' + " - " + allSettingsRavie + " --output " + '\u0022' + chunksDir + "\\" + items + "-av1.ivf" + '\u0022';
startInfo.Arguments = "/C ffmpeg.exe -i " + '\u0022' + chunksDir + "\\" + items + '\u0022' + " -pix_fmt" + pipeBitDepth + " -vsync 0 -f yuv4mpegpipe - | " + '\u0022' + ravie + '\u0022' + " - " + allSettingsRavie + " --output " + '\u0022' + chunksDir + "\\" + items + "-av1.ivf" + '\u0022';
process.StartInfo = startInfo;
Console.WriteLine(startInfo.Arguments);
process.Start();
Expand Down Expand Up @@ -706,9 +724,9 @@ private void EncodeRavie()
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
startInfo.WorkingDirectory = exeffmpegPath + "\\";
startInfo.Arguments = "/C ffmpeg.exe -i " + '\u0022' + chunksDir + "\\" + items + '\u0022' + " -pix_fmt yuv420p -vsync 0 -f yuv4mpegpipe - | " + '\u0022' + ravie + '\u0022' + " - --passes=2 --pass=1 --fpf=" + '\u0022' + chunksDir + "\\" + items + "_stats.log" + '\u0022' + allSettingsAom + " --output=NUL";
startInfo.Arguments = "/C ffmpeg.exe -i " + '\u0022' + chunksDir + "\\" + items + '\u0022' + " -pix_fmt" + pipeBitDepth + " -vsync 0 -f yuv4mpegpipe - | " + '\u0022' + ravie + '\u0022' + " - " + allSettingsRavie + " --first-pass " + '\u0022' + chunksDir + "\\" + items + "_stats.log" + '\u0022';
process.StartInfo = startInfo;
//Console.WriteLine(startInfo.Arguments);
Console.WriteLine(startInfo.Arguments);
process.Start();
process.WaitForExit();

Expand All @@ -726,9 +744,9 @@ private void EncodeRavie()
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
startInfo.WorkingDirectory = exeffmpegPath + "\\";
startInfo.Arguments = "/C ffmpeg.exe -i " + '\u0022' + chunksDir + "\\" + items + '\u0022' + " -pix_fmt yuv420p -vsync 0 -f yuv4mpegpipe - | " + '\u0022' + aomenc + '\u0022' + " - --passes=2 --pass=2 --fpf=" + '\u0022' + chunksDir + "\\" + items + "_stats.log" + '\u0022' + allSettingsAom + " --output=" + '\u0022' + chunksDir + "\\" + items + "-av1.ivf" + '\u0022';
startInfo.Arguments = "/C ffmpeg.exe -i " + '\u0022' + chunksDir + "\\" + items + '\u0022' + " -pix_fmt" + pipeBitDepth + " -vsync 0 -f yuv4mpegpipe - | " + '\u0022' + ravie + '\u0022' + " - " + allSettingsRavie + " --second-pass " + '\u0022' + chunksDir + "\\" + items + "_stats.log" + '\u0022' + " --output " + '\u0022' + chunksDir + "\\" + items + "-av1.ivf" + '\u0022';
process.StartInfo = startInfo;
//Console.WriteLine(startInfo.Arguments);
Console.WriteLine(startInfo.Arguments);
process.Start();
process.WaitForExit();

Expand Down

0 comments on commit cfc0526

Please sign in to comment.