Compare commits

..

No commits in common. "master" and "1.1" have entirely different histories.
master ... 1.1

4 changed files with 10 additions and 64 deletions

3
Form1.Designer.cs generated
View File

@ -109,7 +109,7 @@
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.ReadOnly = true;
this.dataGridView1.RowTemplate.Height = 24;
this.dataGridView1.Size = new System.Drawing.Size(586, 141);
this.dataGridView1.Size = new System.Drawing.Size(587, 141);
this.dataGridView1.TabIndex = 8;
//
// FilePath
@ -117,7 +117,6 @@
this.FilePath.HeaderText = "File Path";
this.FilePath.Name = "FilePath";
this.FilePath.ReadOnly = true;
this.FilePath.Width = 272;
//
// Status
//

View File

@ -22,8 +22,6 @@ namespace CompressH265 {
private int runningProcessCount = 0;
private LinkedList<Process> processList = new LinkedList<Process>();
public Form1() {
InitializeComponent();
}
@ -116,24 +114,11 @@ namespace CompressH265 {
return;
}
// Get FPS
var fps = GetFPS(inputFilename);
var fpsParam = "";
if (fps > 0) {
fpsParam = "-r " + fps;
}
// Converting
process.StartInfo.FileName = "ffmpeg.exe";
process.StartInfo.Arguments = $" -i \"{inputFilename}\" -vcodec hevc -map_metadata 0 -vf yadif -crf 20 -preset medium {fpsParam} \"{outputFilename}\"";
process.StartInfo.Arguments = $"-i \"{inputFilename}\" -vcodec hevc -map_metadata 0 \"{outputFilename}\"";
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
MessageBox.Show(process.StartInfo.Arguments);
var rowID = nextTaskID++;
var msgQueue = new Queue<string>();
dataGridView1.Rows.Insert(rowID, shortName, "Preparing...");
@ -175,41 +160,6 @@ namespace CompressH265 {
runningProcessCount++;
process.Start();
process.BeginErrorReadLine();
processList.AddLast(process);
}
private float GetFPS(string inputFilename) {
Process process = new Process();
process.StartInfo.FileName = "ffmpeg.exe";
process.StartInfo.Arguments = $"-i \"{inputFilename}\"";
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.RedirectStandardError = true;
process.Start();
process.WaitForExit();
string err = process.StandardError.ReadToEnd();
var end = err.IndexOf(" fps,");
if (end < 0) {
return -1f;
}
var start = end;
while (true) {
if (err[start - 1] == ' ') {
break;
}
start--;
if (start < 0) {
return -1;
}
}
return float.Parse(err.Substring(start, end - start));
}
private void button3_Click(object sender, EventArgs e) {
@ -265,16 +215,13 @@ namespace CompressH265 {
private void Form1_FormClosing(object sender, FormClosingEventArgs e) {
if (runningProcessCount > 0) {
var result = MessageBox.Show("Are you sure want to stop the processing?", "Stop process", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
var result = MessageBox.Show("Are you sure want to stop the processing?", "Stop process",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
if (result == DialogResult.Yes) {
foreach (var p in processList) {
p.Kill();
}
} else {
e.Cancel = true;
}
e.Cancel = (result == DialogResult.No);
}
}
}
}

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]

View File

@ -7,7 +7,7 @@ Compress or convert your video files to h.265 (hevc) format with one-click, make
# Download
https://gitea.ath.cx/zabpehely/lazy-compress-h265/releases
https://github.com/louislam/lazy-compress-h265/releases
# Features