2019-02-08 11:19:40 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using FFMpegCore.Enums;
|
|
|
|
|
|
2019-03-03 00:33:00 +01:00
|
|
|
|
namespace FFMpegCore.Test.Resources
|
2019-02-08 11:19:40 +01:00
|
|
|
|
{
|
|
|
|
|
public enum AudioType
|
|
|
|
|
{
|
|
|
|
|
Mp3
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum ImageType
|
|
|
|
|
{
|
|
|
|
|
Png
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class VideoLibrary
|
|
|
|
|
{
|
2019-05-02 17:11:00 +02:00
|
|
|
|
public static readonly FileInfo LocalVideo = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}input.mp4");
|
2020-04-27 20:22:05 +02:00
|
|
|
|
public static readonly FileInfo LocalVideoWebm = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}input.webm");
|
2019-05-02 17:11:00 +02:00
|
|
|
|
public static readonly FileInfo LocalVideoAudioOnly = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}audio_only.mp4");
|
|
|
|
|
public static readonly FileInfo LocalVideoNoAudio = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}mute.mp4");
|
|
|
|
|
public static readonly FileInfo LocalAudio = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}audio.mp3");
|
|
|
|
|
public static readonly FileInfo LocalCover = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}cover.png");
|
|
|
|
|
public static readonly FileInfo ImageDirectory = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}images");
|
|
|
|
|
public static readonly FileInfo ImageJoinOutput = new FileInfo($".{Path.DirectorySeparatorChar}Resources{Path.DirectorySeparatorChar}images{Path.DirectorySeparatorChar}output.mp4");
|
2019-02-08 11:19:40 +01:00
|
|
|
|
|
2020-05-08 11:07:51 +02:00
|
|
|
|
public static string OutputLocation(this FileInfo file, VideoType type)
|
2019-02-08 11:19:40 +01:00
|
|
|
|
{
|
|
|
|
|
return OutputLocation(file, type, "_converted");
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-08 11:07:51 +02:00
|
|
|
|
public static string OutputLocation(this FileInfo file, AudioType type)
|
2019-02-08 11:19:40 +01:00
|
|
|
|
{
|
|
|
|
|
return OutputLocation(file, type, "_audio");
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-08 11:07:51 +02:00
|
|
|
|
public static string OutputLocation(this FileInfo file, ImageType type)
|
2019-02-08 11:19:40 +01:00
|
|
|
|
{
|
|
|
|
|
return OutputLocation(file, type, "_screenshot");
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-08 11:07:51 +02:00
|
|
|
|
public static string OutputLocation(this FileInfo file, Enum type, string keyword)
|
2019-02-08 11:19:40 +01:00
|
|
|
|
{
|
|
|
|
|
string originalLocation = file.Directory.FullName,
|
2020-05-10 23:16:52 +02:00
|
|
|
|
outputFile = file.Name.Replace(file.Extension, keyword + "." + type.ToString().ToLowerInvariant());
|
2019-02-08 11:19:40 +01:00
|
|
|
|
|
2020-05-08 11:07:51 +02:00
|
|
|
|
return $"{originalLocation}{Path.DirectorySeparatorChar}{outputFile}";
|
2019-02-08 11:19:40 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2019-05-02 17:11:00 +02:00
|
|
|
|
}
|