Skip to content

Commit

Permalink
Allow user to select PSNR and SSIM output, select resolution and outp…
Browse files Browse the repository at this point in the history
…ut results in notepad
  • Loading branch information
ThatNerdUKnow committed Sep 26, 2020
1 parent 70a496b commit 0b500e5
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 9 deletions.
71 changes: 64 additions & 7 deletions vmaf-gui/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 21 additions & 2 deletions vmaf-gui/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;
using System.Xml;

namespace vmaf_gui
{
Expand Down Expand Up @@ -61,7 +62,7 @@ private void compressedFileDialog_FileOk(object sender, CancelEventArgs e)

private void Form1_Load(object sender, EventArgs e)
{

cmbResolution.Text = "1920 1080";
}

private void button1_Click(object sender, EventArgs e)
Expand All @@ -71,6 +72,9 @@ private void button1_Click(object sender, EventArgs e)
originalFileDialog.OpenFile();
compressedFileDialog.OpenFile();

originalFileDialog.Dispose();
compressedFileDialog.Dispose();

string sourcePath ="\""+ originalFileDialog.FileName + "\"";
string compressedPath = "\"" + compressedFileDialog.FileName + "\"";

Expand Down Expand Up @@ -113,7 +117,22 @@ void decompressVideo(string path,string output)

void vmaf()
{
ChildProcess("vmaf.exe", "yuv420p 1920 1080 ./temp/source.yuv ./temp/compressed.yuv ./model/vmaf_v0.6.1.pkl --log log.txt");
string args = "yuv420p "+ cmbResolution.Text +" ./temp/source.yuv ./temp/compressed.yuv ./model/vmaf_v0.6.1.pkl --log log.xml";
if (chkPSNR.Checked)
{
args += " --psnr";
}
if (chkSSIM.Checked)
{
args += " --ssim";
}
ChildProcess("vmaf.exe",args );
ChildProcess("notepad", "log.xml");
}

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{

}
}

Expand Down
3 changes: 3 additions & 0 deletions vmaf-gui/Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,7 @@
<metadata name="compressedFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>157, 17</value>
</metadata>
<metadata name="backgroundWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>328, 17</value>
</metadata>
</root>

0 comments on commit 0b500e5

Please sign in to comment.