Commit 81026085 authored by shrabbit's avatar shrabbit
Browse files

初始化项目

parents
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+5 −0
Original line number Diff line number Diff line
bin/
obj/
/packages/
riderModule.iml
/_ReSharper.Caches/
 No newline at end of file

VideoSlice.slnx

0 → 100644
+4 −0
Original line number Diff line number Diff line
<Solution>
  <Project Path="src/VideoSlice.Cli/VideoSlice.Cli.csproj" />
  <Project Path="src/VideoSlice.Tests/VideoSlice.Tests.csproj" />
</Solution>
+28 −0
Original line number Diff line number Diff line
using System.ComponentModel;
using Spectre.Console.Cli;

namespace VideoSlice.Cli;

[Description("执行视频分片,将按固定的时间间隔对视频帧进行导出。")]
public class MainCommand : AsyncCommand<MainCommand.Settings>
{
    public class Settings : CommandSettings
    {
        [CommandOption("-f|--file")]
        [Description("选择的视频文件。")]
        public string? File { get; set; }

        [CommandOption("-d|--dir")]
        [Description("选择的视频目录。")]
        public string? Directory { get; set; }

        [CommandOption("-f|--ffmpeg")]
        [Description("FFmpeg命令行程序的路径。")]
        public string FfMpegPath { get; set; } = "ffmpeg";
    }

    protected override async Task<int> ExecuteAsync(CommandContext context, Settings settings, CancellationToken cancellationToken)
    {
        return 0;
    }
}
 No newline at end of file
+12 −0
Original line number Diff line number Diff line
using Spectre.Console.Cli;

namespace VideoSlice.Cli;

class Program
{
    static int Main(string[] args)
    {
        var app = new CommandApp<MainCommand>();
        return app.Run(args);
    }
}
 No newline at end of file
+14 −0
Original line number Diff line number Diff line
namespace VideoSlice.Cli;

public static class SimpleTimeSpanExpress
{
    public static string ToString(TimeSpan timeSpan)
    {
        var result = string.Empty;

        if (timeSpan.Days > 0)
            result += $"{timeSpan.Days}d";
        
        return result;
    }
}
 No newline at end of file
Loading