-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
628 additions
and
502 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
using System.Windows; | ||
|
||
namespace NotEnoughAV1Encodes.Encoders | ||
{ | ||
class AOMAV1FFmpeg : IEncoder | ||
{ | ||
public string GetCommand() | ||
{ | ||
// Get MainWindow instance to access UI elements | ||
MainWindow mainWindow = Application.Current.MainWindow as MainWindow; | ||
|
||
string settings = "-c:v libaom-av1"; | ||
|
||
// Quality / Bitrate Selection | ||
string quality = mainWindow.ComboBoxQualityMode.SelectedIndex switch | ||
{ | ||
0 => " -crf " + mainWindow.SliderQualityAOMFFMPEG.Value + " -b:v 0", | ||
1 => " -crf " + mainWindow.SliderQualityAOMFFMPEG.Value + " -b:v " + mainWindow.TextBoxMaxBitrateAOMFFMPEG.Text + "k", | ||
2 => " -b:v " + mainWindow.TextBoxMinBitrateAOMFFMPEG.Text + "k", | ||
3 => " -minrate " + mainWindow.TextBoxMinBitrateAOMFFMPEG.Text + "k -b:v " + mainWindow.TextBoxAVGBitrateAOMFFMPEG.Text + "k -maxrate " + mainWindow.TextBoxMaxBitrateAOMFFMPEG.Text + "k", | ||
4 => " -crf {q_vmaf} -b:v 0", | ||
_ => "" | ||
}; | ||
|
||
// Preset | ||
settings += quality + " -cpu-used " + mainWindow.SliderEncoderPreset.Value; | ||
|
||
// Advanced Settings | ||
if (mainWindow.ToggleSwitchAdvancedSettings.IsOn == false) | ||
{ | ||
settings += " -threads 4 -tile-columns 2 -tile-rows 1 -g " + mainWindow.GenerateKeyFrameInerval(); | ||
} | ||
else | ||
{ | ||
settings += " -threads " + mainWindow.ComboBoxAomencThreads.Text + // Threads | ||
" -tile-columns " + mainWindow.ComboBoxAomencTileColumns.Text + // Tile Columns | ||
" -tile-rows " + mainWindow.ComboBoxAomencTileRows.Text + // Tile Rows | ||
" -lag-in-frames " + mainWindow.TextBoxAomencLagInFrames.Text + // Lag in Frames | ||
" -aq-mode " + mainWindow.ComboBoxAomencAQMode.SelectedIndex + // AQ-Mode | ||
" -tune " + mainWindow.ComboBoxAomencTune.Text; // Tune | ||
|
||
if (mainWindow.TextBoxAomencMaxGOP.Text != "0") | ||
settings += " -g " + mainWindow.TextBoxAomencMaxGOP.Text; // Keyframe Interval | ||
if (mainWindow.CheckBoxAomencRowMT.IsChecked == false) | ||
settings += " -row-mt 0"; // Row Based Multithreading | ||
if (mainWindow.CheckBoxAomencCDEF.IsChecked == false) | ||
settings += " -enable-cdef 0"; // Constrained Directional Enhancement Filter | ||
if (mainWindow.CheckBoxRealTimeMode.IsOn) | ||
settings += " -usage realtime "; // Real Time Mode | ||
|
||
if (mainWindow.CheckBoxAomencARNRMax.IsChecked == true) | ||
{ | ||
settings += " -arnr-max-frames " + mainWindow.ComboBoxAomencARNRMax.Text; // ARNR Maxframes | ||
settings += " -arnr-strength " + mainWindow.ComboBoxAomencARNRStrength.Text; // ARNR Strength | ||
} | ||
|
||
settings += " -aom-params " + | ||
"tune-content=" + mainWindow.ComboBoxAomencTuneContent.Text + // Tune-Content | ||
":sharpness=" + mainWindow.ComboBoxAomencSharpness.Text + // Sharpness (Filter) | ||
":enable-keyframe-filtering=" + mainWindow.ComboBoxAomencKeyFiltering.SelectedIndex; // Key Frame Filtering | ||
|
||
if (mainWindow.ComboBoxAomencColorPrimaries.SelectedIndex != 0) | ||
settings += ":color-primaries=" + mainWindow.ComboBoxAomencColorPrimaries.Text; // Color Primaries | ||
if (mainWindow.ComboBoxAomencColorTransfer.SelectedIndex != 0) | ||
settings += ":transfer-characteristics=" + mainWindow.ComboBoxAomencColorTransfer.Text; // Color Transfer | ||
if (mainWindow.ComboBoxAomencColorMatrix.SelectedIndex != 0) | ||
settings += ":matrix-coefficients=" + mainWindow.ComboBoxAomencColorMatrix.Text; // Color Matrix | ||
} | ||
|
||
return settings; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Windows; | ||
|
||
namespace NotEnoughAV1Encodes.Encoders | ||
{ | ||
class AVCFFmpeg : IEncoder | ||
{ | ||
public string GetCommand() | ||
{ | ||
// Get MainWindow instance to access UI elements | ||
MainWindow mainWindow = Application.Current.MainWindow as MainWindow; | ||
|
||
string settings = "-c:v libx264"; | ||
|
||
// Quality / Bitrate Selection | ||
string quality = mainWindow.ComboBoxQualityModeX26x.SelectedIndex switch | ||
{ | ||
0 => " -crf " + mainWindow.SliderQualityX26x.Value, | ||
1 => " -b:v " + mainWindow.TextBoxBitrateX26x.Text + "k", | ||
_ => "" | ||
}; | ||
|
||
// Preset | ||
settings += quality + " -preset " + mainWindow.GenerateMPEGEncoderSpeed(); | ||
|
||
return settings; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
using System.IO; | ||
using System.Windows; | ||
|
||
namespace NotEnoughAV1Encodes.Encoders | ||
{ | ||
class Aomenc : IEncoder | ||
{ | ||
public string GetCommand() | ||
{ | ||
// Get MainWindow instance to access UI elements | ||
MainWindow mainWindow = Application.Current.MainWindow as MainWindow; | ||
|
||
string settings = "-f yuv4mpegpipe - | " + | ||
"\"" + Path.Combine(Directory.GetCurrentDirectory(), "Apps", "aomenc", "aomenc.exe") + "\" -"; | ||
|
||
// Quality / Bitrate Selection | ||
string quality = mainWindow.ComboBoxQualityModeAOMENC.SelectedIndex switch | ||
{ | ||
0 => " --cq-level=" + mainWindow.SliderQualityAOMENC.Value + " --end-usage=q", | ||
1 => " --cq-level=" + mainWindow.SliderQualityAOMENC.Value + " --target-bitrate=" + mainWindow.TextBoxBitrateAOMENC.Text + " --end-usage=cq", | ||
2 => " --target-bitrate=" + mainWindow.TextBoxBitrateAOMENC.Text + " --end-usage=vbr", | ||
3 => " --target-bitrate=" + mainWindow.TextBoxBitrateAOMENC.Text + " --end-usage=cbr", | ||
_ => "" | ||
}; | ||
|
||
// Preset | ||
settings += quality + " --cpu-used=" + mainWindow.SliderEncoderPreset.Value; | ||
|
||
// Advanced Settings | ||
if (mainWindow.ToggleSwitchAdvancedSettings.IsOn == false) | ||
{ | ||
settings += " --threads=4 --tile-columns=2 --tile-rows=1 --kf-max-dist=" + mainWindow.GenerateKeyFrameInerval(); | ||
} | ||
else | ||
{ | ||
settings += " --threads=" + mainWindow.ComboBoxAomencThreads.Text + // Threads | ||
" --tile-columns=" + mainWindow.ComboBoxAomencTileColumns.Text + // Tile Columns | ||
" --tile-rows=" + mainWindow.ComboBoxAomencTileRows.Text + // Tile Rows | ||
" --lag-in-frames=" + mainWindow.TextBoxAomencLagInFrames.Text + // Lag in Frames | ||
" --sharpness=" + mainWindow.ComboBoxAomencSharpness.Text + // Sharpness (Filter) | ||
" --aq-mode=" + mainWindow.ComboBoxAomencAQMode.SelectedIndex + // AQ-Mode | ||
" --enable-keyframe-filtering=" + mainWindow.ComboBoxAomencKeyFiltering.SelectedIndex + // Key Frame Filtering | ||
" --tune=" + mainWindow.ComboBoxAomencTune.Text + // Tune | ||
" --tune-content=" + mainWindow.ComboBoxAomencTuneContent.Text; // Tune-Content | ||
|
||
if (mainWindow.TextBoxAomencMaxGOP.Text != "0") | ||
settings += " --kf-max-dist=" + mainWindow.TextBoxAomencMaxGOP.Text; // Keyframe Interval | ||
if (mainWindow.CheckBoxAomencRowMT.IsChecked == false) | ||
settings += " --row-mt=0"; // Row Based Multithreading | ||
|
||
if (mainWindow.ComboBoxAomencColorPrimaries.SelectedIndex != 0) | ||
settings += " --color-primaries=" + mainWindow.ComboBoxAomencColorPrimaries.Text; // Color Primaries | ||
if (mainWindow.ComboBoxAomencColorTransfer.SelectedIndex != 0) | ||
settings += " --transfer-characteristics=" + mainWindow.ComboBoxAomencColorTransfer.Text; // Color Transfer | ||
if (mainWindow.ComboBoxAomencColorMatrix.SelectedIndex != 0) | ||
settings += " --matrix-coefficients=" + mainWindow.ComboBoxAomencColorMatrix.Text; // Color Matrix | ||
|
||
if (mainWindow.CheckBoxAomencCDEF.IsChecked == false) | ||
settings += " --enable-cdef=0"; // Constrained Directional Enhancement Filter | ||
|
||
if (mainWindow.CheckBoxAomencARNRMax.IsChecked == true) | ||
{ | ||
settings += " --arnr-maxframes=" + mainWindow.ComboBoxAomencARNRMax.Text; // ARNR Maxframes | ||
settings += " --arnr-strength=" + mainWindow.ComboBoxAomencARNRStrength.Text; // ARNR Strength | ||
} | ||
|
||
if (mainWindow.CheckBoxRealTimeMode.IsOn) | ||
settings += " --rt"; // Real Time Mode | ||
} | ||
|
||
return settings; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace NotEnoughAV1Encodes.Encoders | ||
{ | ||
interface IEncoder | ||
{ | ||
string GetCommand(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Windows; | ||
|
||
namespace NotEnoughAV1Encodes.Encoders | ||
{ | ||
class HEVCFFmpeg : IEncoder | ||
{ | ||
public string GetCommand() | ||
{ | ||
// Get MainWindow instance to access UI elements | ||
MainWindow mainWindow = Application.Current.MainWindow as MainWindow; | ||
|
||
string settings = "-c:v libx265"; | ||
|
||
// Quality / Bitrate Selection | ||
string quality = mainWindow.ComboBoxQualityModeX26x.SelectedIndex switch | ||
{ | ||
0 => " -crf " + mainWindow.SliderQualityX26x.Value, | ||
1 => " -b:v " + mainWindow.TextBoxBitrateX26x.Text + "k", | ||
_ => "" | ||
}; | ||
|
||
// Preset | ||
settings += quality + " -preset " + mainWindow.GenerateMPEGEncoderSpeed(); | ||
|
||
return settings; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System.IO; | ||
using System.Windows; | ||
|
||
namespace NotEnoughAV1Encodes.Encoders | ||
{ | ||
class NVEnc : IEncoder | ||
{ | ||
public string GetCommand() | ||
{ | ||
// Get MainWindow instance to access UI elements | ||
MainWindow mainWindow = Application.Current.MainWindow as MainWindow; | ||
|
||
string settings = "-f yuv4mpegpipe - | " + | ||
"\"" + Path.Combine(Directory.GetCurrentDirectory(), "Apps", "nvenc", "NVEncC64.exe") + "\" --y4m -i -"; | ||
|
||
// Codec | ||
settings += " --codec av1"; | ||
|
||
// Quality / Bitrate Selection | ||
string quality = mainWindow.ComboBoxQualityModeQSVAV1.SelectedIndex switch | ||
{ | ||
0 => " --cqp " + mainWindow.SliderQualityQSVAV1.Value, | ||
1 => " --vbr " + mainWindow.TextBoxBitrateQSVAV1.Text, | ||
2 => " --cbr " + mainWindow.TextBoxBitrateQSVAV1.Text, | ||
_ => "" | ||
}; | ||
|
||
// Preset | ||
settings += quality + " --preset " + mainWindow.GenerateNVENCEncoderSpeed(); | ||
|
||
// Bit-Depth | ||
settings += " --output-depth "; | ||
settings += mainWindow.ComboBoxVideoBitDepthLimited.SelectedIndex switch | ||
{ | ||
0 => "8", | ||
1 => "10", | ||
_ => "8" | ||
}; | ||
|
||
return settings; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using System.IO; | ||
using System.Windows; | ||
|
||
namespace NotEnoughAV1Encodes.Encoders | ||
{ | ||
class QSVEnc : IEncoder | ||
{ | ||
public string GetCommand() | ||
{ | ||
// Get MainWindow instance to access UI elements | ||
MainWindow mainWindow = Application.Current.MainWindow as MainWindow; | ||
|
||
string settings = "-f yuv4mpegpipe - | " + | ||
"\"" + Path.Combine(Directory.GetCurrentDirectory(), "Apps", "qsvenc", "QSVEncC64.exe") + "\" --y4m -i -"; | ||
|
||
// Codec | ||
settings += " --codec av1"; | ||
|
||
// Quality / Bitrate Selection | ||
string quality = mainWindow.ComboBoxQualityModeQSVAV1.SelectedIndex switch | ||
{ | ||
0 => " --cqp " + mainWindow.SliderQualityQSVAV1.Value, | ||
1 => " --icq " + mainWindow.SliderQualityQSVAV1.Value, | ||
2 => " --vbr " + mainWindow.TextBoxBitrateQSVAV1.Text, | ||
3 => " --cbr " + mainWindow.TextBoxBitrateQSVAV1.Text, | ||
_ => "" | ||
}; | ||
|
||
// Preset | ||
settings += quality + " --quality " + mainWindow.GenerateQuickSyncEncoderSpeed(); | ||
|
||
// Bit-Depth | ||
settings += " --output-depth "; | ||
settings += mainWindow.ComboBoxVideoBitDepthLimited.SelectedIndex switch | ||
{ | ||
0 => "8", | ||
1 => "10", | ||
_ => "8" | ||
}; | ||
|
||
// Output Colorspace | ||
settings += " --output-csp "; | ||
settings += mainWindow.ComboBoxColorFormat.SelectedIndex switch | ||
{ | ||
0 => "i420", | ||
1 => "i422", | ||
2 => "i444", | ||
_ => "i420" | ||
}; | ||
|
||
return settings; | ||
} | ||
} | ||
} |
Oops, something went wrong.