Skip to content

Commit

Permalink
feat: 菜单添加更新入口
Browse files Browse the repository at this point in the history
  • Loading branch information
kimliss committed Dec 20, 2021
1 parent 88d44b9 commit 5b5f4c2
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 60 deletions.
1 change: 1 addition & 0 deletions IdeaVideoAI/Config.cs
Expand Up @@ -31,6 +31,7 @@ public class Config
public int tab3MaxStartTime;
public string tab3FontPictureFile;
public int tab3OutTime;
public bool tab3PictureSharpen;

//背景视频
public List<String> tab3BgVideoFiles;
Expand Down
119 changes: 72 additions & 47 deletions IdeaVideoAI/Form1.Designer.cs

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

22 changes: 19 additions & 3 deletions IdeaVideoAI/Form1.cs
@@ -1,4 +1,5 @@
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using Xabe.FFmpeg;
using Xabe.FFmpeg.Downloader;
Expand Down Expand Up @@ -1019,6 +1020,7 @@ private void btnTab3Exec_Click(object sender, EventArgs e)
Config.Instance.tab3MinStartTime = (int)nUDTab3VideoMinStartTime.Value;
Config.Instance.tab3MaxStartTime = (int)nUDTab3VideoMaxStartTime.Value;
Config.Instance.tab3OutTime = (int)nUDTab3OutTime.Value;
Config.Instance.tab3PictureSharpen = cbTab3PictureSharpen.Checked;


for (int i = 0; i < pictureDatas.Count; i++)
Expand All @@ -1038,18 +1040,23 @@ private void btnTab3Exec_Click(object sender, EventArgs e)
int yRandom = Utils.nextRandomRange(0, 100);


var ffmpegFormat = " -y {0} -filter_complex \"{1}\" -map [audio] -map [video] \"{2}\" ";
var ffmpegFormat = " -y {0} -filter_complex \"{1}\" \"{2}\" ";

var tempInput = string.Format(" -ss {0} -t {1} -i \"{2}\" -i \"{3}\" ", ss, Config.Instance.tab3OutTime, videoFile, imageFile);
var tempFilter = "[0:a]acopy[audio];[0:v]copy[video];[1:v][video]scale2ref=w=iw/10*8:h=ow/main_a[over][video]";
var tempFilter = "[1:v][0:v]scale2ref=w=iw/10*8:h=ow/main_a[over][video]";
var tempOut = Path.Join(item.outDir, j + 1 + "__" + item.fileName + Path.GetExtension(videoFile));

if (Config.Instance.tab3PictureSharpen)
{
tempFilter += ";[over]unsharp=3:3:5[over]";
}

if (!string.IsNullOrEmpty(fontFile))
{
tempInput += string.Format(" -i {0} ", fontFile);
tempFilter += ";[2:v][over]scale2ref=w=iw:h=ow/main_a[font][over];[over][font]vstack[over]";
}
tempFilter += string.Format(";[video][over]overlay=x=W*{0}/1000:y=H/16+H/16*{1}/100[video]", xRandom, yRandom);
tempFilter += string.Format(";[video][over]overlay=x=W*{0}/1000:y=H/16+H/16*{1}/100", xRandom, yRandom);

//" -y -ss {0} -i \"{1}\" -i \"{2}\" -i \"{3}\" -filter_complex \"[0:a]acopy[audio];[1:v][0:v]scale2ref=w=iw/10*8:h=ow/main_a[pic][video];[2:v][pic]scale2ref=w=iw:h=ow/main_a[font][pic];[pic][font]vstack[over];[video][pic]overlay=x=W*{4}/1000:y=H/16+H/16*{5}/100[video]\" -map [audio] -map [video] \"{6}\" "
var cmd = String.Format(ffmpegFormat, tempInput, tempFilter, tempOut);
Expand Down Expand Up @@ -1080,6 +1087,15 @@ private void btnTab3AddFontPicture_Click(object sender, EventArgs e)
labTab3AddFontPicture.Text = fd.FileName;
}
}

private void 更新ToolStripMenuItem_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start(new ProcessStartInfo
{
FileName = "https://github.com/itwangxiang/IdeaVideoAI/releases",
UseShellExecute = true
});
}
}

}
2 changes: 2 additions & 0 deletions IdeaVideoAI/IdeaVideoAI.csproj
Expand Up @@ -6,6 +6,8 @@
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<AssemblyVersion></AssemblyVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
11 changes: 1 addition & 10 deletions README.md
@@ -1,11 +1,2 @@
# IdeaVideoAI

## 一个有想法的视频处理工具,追求 AI 效果

[![GitHub release](https://img.shields.io/github/v/release/itwangxiang/IdeaVideoAI.svg)](https://github.com/itwangxiang/IdeaVideoAI/releases) ![Total Downloads](https://img.shields.io/github/downloads/itwangxiang/IdeaVideoAI/total.svg) ![Support Platforms](https://camo.githubusercontent.com/2b46c1151d9febe8de2b889e3867c235163737d1855f90b3b3b3edcd8b878b8e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d77696e646f77732d6c6967687467726579)

## 特性

- 支持人工标注水印后批量去水印
- 支持随机修改视频属性,以达到去重效果
- 支持图片与背景视频随机合成多个视频
视频去水印神器

0 comments on commit 5b5f4c2

Please sign in to comment.