jjbell170 / lazy-compress-h265

Compress or convert your video files to h.265 (hevc) format with one-click, make its size much smaller!
0 stars 0 forks source link

Sweep: Instead of using H265, which is not supported on all platforms, we should instead compress files to AV1 instead #5

Open jjbell170 opened 2 months ago

jjbell170 commented 2 months ago
Checklist - [X] Modify `Form1.cs` ✓ https://github.com/jjbell170/lazy-compress-h265/commit/f54178296a1068956570d5cf3127add8922d611b [Edit](https://github.com/jjbell170/lazy-compress-h265/edit/sweep/instead_of_using_h265_which_is_not_suppo/Form1.cs) - [X] Modify `Form1.Designer.cs` ✓ https://github.com/jjbell170/lazy-compress-h265/commit/f54178296a1068956570d5cf3127add8922d611b [Edit](https://github.com/jjbell170/lazy-compress-h265/edit/sweep/instead_of_using_h265_which_is_not_suppo/Form1.Designer.cs) - [X] Modify `Form1.Designer.cs` ✓ https://github.com/jjbell170/lazy-compress-h265/commit/f54178296a1068956570d5cf3127add8922d611b [Edit](https://github.com/jjbell170/lazy-compress-h265/edit/sweep/instead_of_using_h265_which_is_not_suppo/Form1.Designer.cs) - [X] Modify `README.md` ✓ https://github.com/jjbell170/lazy-compress-h265/commit/f54178296a1068956570d5cf3127add8922d611b [Edit](https://github.com/jjbell170/lazy-compress-h265/edit/sweep/instead_of_using_h265_which_is_not_suppo/README.md)
sweep-ai[bot] commented 2 months ago

🚀 Here's the PR! #6

See Sweep's progress at the progress dashboard!
💎 Sweep Pro: I'm using GPT-4. You have unlimited GPT-4 tickets. (tracking ID: 642eaf68a4)
Install Sweep Configs: Pull Request

[!TIP] I can email you next time I complete a pull request if you set up your email here!


Actions (click)


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/jjbell170/lazy-compress-h265/blob/99684fa9be64da266bbf86dc199eead484b4e0fa/Form1.cs#L1-L280 https://github.com/jjbell170/lazy-compress-h265/blob/99684fa9be64da266bbf86dc199eead484b4e0fa/Form1.Designer.cs#L1-L177 https://github.com/jjbell170/lazy-compress-h265/blob/99684fa9be64da266bbf86dc199eead484b4e0fa/README.md#L1-L37

Step 2: ⌨️ Coding

var outputFilename = inputFilename + ".h265.mp4"; if (File.Exists(outputFilename)) { MessageBox.Show("The output file name is existing. Please move or delete it before converting. " + outputFilename); return; } // Get FPS var fps = GetFPS(inputFilename); var fpsParam = ""; if (fps > 0) { fpsParam = "-r " + fps; } string videoCodec = checkBoxNvenc.Checked ? "hevc_nvenc" : "hevc"; // Converting process.StartInfo.FileName = "ffmpeg.exe"; process.StartInfo.Arguments = $" -i \"{inputFilename}\" -vcodec {videoCodec} -map_metadata 0 -vf yadif -crf 20 -preset medium {fpsParam} \"{outputFilename}\""; process.StartInfo.UseShellExecute = false; process.StartInfo.CreateNoWindow = true; var outputFilename = inputFilename + ".av1.mp4"; if (File.Exists(outputFilename)) { MessageBox.Show("The output file name is existing. Please move or delete it before converting. " + outputFilename); return; } // Get FPS var fps = GetFPS(inputFilename); var fpsParam = ""; if (fps > 0) { fpsParam = "-r " + fps; } string videoCodec = "libaom-av1"; // Converting process.StartInfo.FileName = "ffmpeg.exe"; process.StartInfo.Arguments = $" -i \"{inputFilename}\" -vcodec {videoCodec} -map_metadata 0 -crf 20 -preset medium {fpsParam} \"{outputFilename}\""; process.StartInfo.UseShellExecute = false; process.StartInfo.CreateNoWindow = true;

Remove the "Use NVIDIA CUDA" checkbox and associated code.

// // checkBoxNvenc // this.checkBoxNvenc.AutoSize = true; this.checkBoxNvenc.Location = new System.Drawing.Point(224, 50); this.checkBoxNvenc.Name = "checkBoxNvenc"; this.checkBoxNvenc.Size = new System.Drawing.Size(134, 21); this.checkBoxNvenc.TabIndex = 6; this.checkBoxNvenc.Text = "Use NVIDIA CUDA"; this.checkBoxNvenc.UseVisualStyleBackColor = true;

this.Text = "Lazy Compress H.265 (HEVC)"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); this.Load += new System.EventHandler(this.Form1_Load); this.Shown += new System.EventHandler(this.Form1_Shown); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form1_DragDrop); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.Form1_DragEnter); ((System.ComponentModel.ISupportInitialize) (this.dataGridView1)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); } private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; private System.Windows.Forms.Button buttonContextMenu; private System.Windows.Forms.DataGridView dataGridView1; private System.Windows.Forms.DataGridViewTextBoxColumn FilePath; private System.Windows.Forms.Label label1; private System.Windows.Forms.LinkLabel linkLabel1; private System.Windows.Forms.OpenFileDialog openFileDialog1; private System.Windows.Forms.DataGridViewTextBoxColumn Status; private System.Windows.Forms.TextBox textBox1; #endregion } } this.Text = "Lazy Compress AV1"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); this.Load += new System.EventHandler(this.Form1_Load); this.Shown += new System.EventHandler(this.Form1_Shown); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form1_DragDrop); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.Form1_DragEnter); ((System.ComponentModel.ISupportInitialize) (this.dataGridView1)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); } private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; private System.Windows.Forms.Button buttonContextMenu; private System.Windows.Forms.DataGridView dataGridView1; private System.Windows.Forms.DataGridViewTextBoxColumn FilePath; private System.Windows.Forms.Label label1; private System.Windows.Forms.LinkLabel linkLabel1; private System.Windows.Forms.OpenFileDialog openFileDialog1; private System.Windows.Forms.DataGridViewTextBoxColumn Status; private System.Windows.Forms.TextBox textBox1; #endregion } }

Update the project description, features, and sample sections in the README file.

# Lazy Compress H.265 (HEVC) Compress or convert your video files to h.265 (hevc) format with one-click, make its size much smaller! ![image](https://github.com/louislam/lazy-compress-h265/blob/master/readme_images/2020-05-09_230722.png) ![image](https://github.com/louislam/lazy-compress-h265/blob/master/readme_images/2020-05-09_225508.png) # Download https://github.com/louislam/lazy-compress-h265/releases # Features * Free and Open Source * Reduce your video files size and almost keep the quality of your original file * No config is required * Easy to use, drag-and-drop and compress * Alternative, you could install to your Context Menu, one-click to compress * Keep metadata, date created and date modified. * Output to the same folder with postfix ".h265.mp4" * Portable # Requirements * OS: Windows 10 * .NET Framework 4.8 # Sample 477MB to 66MB ![image](https://github.com/louislam/lazy-compress-h265/blob/master/readme_images/2020-05-09_231655.png) # Build * IDE: Rider 2020.1 # Lazy Compress AV1 Compress or convert your video files to AV1 format with one-click, make its size much smaller! ![image](https://github.com/louislam/lazy-compress-h265/blob/master/readme_images/2020-05-09_230722.png) ![image](https://github.com/louislam/lazy-compress-h265/blob/master/readme_images/2020-05-09_225508.png) # Download https://github.com/louislam/lazy-compress-h265/releases # Features * Free and Open Source * Reduce your video files size and almost keep the quality of your original file * No config is required * Easy to use, drag-and-drop and compress * Alternative, you could install to your Context Menu, one-click to compress * Keep metadata, date created and date modified. * Output to the same folder with postfix ".av1.mp4" * Portable # Requirements * OS: Windows 10 * .NET Framework 4.8 # Sample 477MB to 66MB ![image](https://github.com/louislam/lazy-compress-h265/blob/master/readme_images/2020-05-09_231655.png) # Build * IDE: Rider 2020.1


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/instead_of_using_h265_which_is_not_suppo.


🎉 Latest improvements to Sweep:
  • New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
  • Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
  • Use the GitHub issues extension for creating Sweep issues directly from your editor.

💡 To recreate the pull request edit the issue title or description. Something wrong? Let us know.

This is an automated message generated by Sweep AI.

jjbell170 commented 2 months ago

We should ensure we use "SVT-AV1" not the slow reference encoder