update
This commit is contained in:
parent
a03660f4d8
commit
abd1c132a4
@ -19,6 +19,7 @@ namespace VideoConcat
|
|||||||
public partial class Video : Window
|
public partial class Video : Window
|
||||||
{
|
{
|
||||||
public string text = "", outPut = "";
|
public string text = "", outPut = "";
|
||||||
|
static int totalVideoCount = 0;
|
||||||
|
|
||||||
public Dictionary<int, string[]> videoFolders = [];
|
public Dictionary<int, string[]> videoFolders = [];
|
||||||
|
|
||||||
@ -56,11 +57,18 @@ namespace VideoConcat
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
totalVideoCount = 0;
|
||||||
WriteTxt($"生成视频的个数:{GenerateVideoCount} 个");
|
|
||||||
|
|
||||||
Check_Folder();
|
Check_Folder();
|
||||||
|
|
||||||
|
WriteTxt($"最多可生成视频个数为{totalVideoCount}个");
|
||||||
|
|
||||||
|
if (GenerateVideoCount > totalVideoCount)
|
||||||
|
{
|
||||||
|
WriteTxt($"生成视频个数不能超过{totalVideoCount}个");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
MakeOutPutDir();
|
MakeOutPutDir();
|
||||||
|
|
||||||
@ -91,6 +99,7 @@ namespace VideoConcat
|
|||||||
|
|
||||||
private void Check_Folder()
|
private void Check_Folder()
|
||||||
{
|
{
|
||||||
|
WriteTxt("开始检测视频文件路径");
|
||||||
DirectoryInfo? directory = Directory.GetParent(ParentPath);
|
DirectoryInfo? directory = Directory.GetParent(ParentPath);
|
||||||
if (directory == null)
|
if (directory == null)
|
||||||
{
|
{
|
||||||
@ -107,20 +116,32 @@ namespace VideoConcat
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
int k = 1;
|
int k = 1;
|
||||||
for (int i = 100; i >0; i--)
|
for (int i = 1; i < 100; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
var folder = string.Format("{0:D2}", i);
|
var folder = string.Format("{0:D2}", i);
|
||||||
string currentFolderPath = $"{Path}\\{folder}";
|
string currentFolderPath = $"{Path}\\{folder}";
|
||||||
if (Directory.Exists(currentFolderPath))
|
if (Directory.Exists(currentFolderPath))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
string[] videos = GetAllVideos(currentFolderPath);
|
string[] videos = GetAllVideos(currentFolderPath);
|
||||||
if (videos.Length > 0)
|
if (videos.Length > 0)
|
||||||
{
|
{
|
||||||
|
if(totalVideoCount == 0)
|
||||||
|
{
|
||||||
|
totalVideoCount = 1;
|
||||||
|
}
|
||||||
|
WriteTxt($"检测到视频文件夹:{folder},视频个数:{videos.Length}");
|
||||||
|
totalVideoCount *= videos.Length;
|
||||||
videoFolders.Add(k, videos);
|
videoFolders.Add(k, videos);
|
||||||
AllPublicCombinVideos.Add(k, new A());
|
AllPublicCombinVideos.Add(k, new A());
|
||||||
k++;
|
k++;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
WriteTxt($"视频文件夹【{folder}】未发现MP4格式视频文件");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -230,6 +251,10 @@ namespace VideoConcat
|
|||||||
{
|
{
|
||||||
List<string> lss = [];
|
List<string> lss = [];
|
||||||
List<Task> tasks = [];
|
List<Task> tasks = [];
|
||||||
|
Random rd = new();
|
||||||
|
|
||||||
|
ls = [.. ls.OrderBy(x => rd.Next())];
|
||||||
|
|
||||||
|
|
||||||
foreach (var item in ls)
|
foreach (var item in ls)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user