mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 17:46:36 +00:00
add controller for video
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
namespace Azaion.Repository;
|
||||
|
||||
public class Constants
|
||||
{
|
||||
public const string MEDIA_HLS_FOLDER = "/azaion-media/hls";
|
||||
public const string M3_U8_EXT = "m3u8";
|
||||
public const string TS_EXT = "ts";
|
||||
public const string FFMPEG_FILE = "/opt/homebrew/bin/ffmpeg";
|
||||
|
||||
}
|
||||
@@ -1,12 +1,22 @@
|
||||
using Azaion.Video.DTO;
|
||||
using IOPath = System.IO.Path;
|
||||
|
||||
namespace Azaion.Repository.Entities;
|
||||
|
||||
public class Media
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Path { get; set; } = null!;
|
||||
public Guid? AnnotatorId { get; set; }
|
||||
public MediaStatusEnum Status { get; set; }
|
||||
public DateTime CreatedDate { get; set; }
|
||||
public Guid Id { get; set; }
|
||||
public string Path { get; set; } = null!;
|
||||
public int Resolution { get; set; }
|
||||
public int Bitrate { get; set; }
|
||||
public Guid? AnnotatorId { get; set; }
|
||||
public MediaStatusEnum Status { get; set; }
|
||||
public DateTime CreatedDate { get; set; }
|
||||
|
||||
|
||||
private string MediaName => IOPath.GetFileNameWithoutExtension(Path);
|
||||
private string OutDir => Directory.CreateDirectory(IOPath.Combine(Constants.MEDIA_HLS_FOLDER, MediaName)).FullName;
|
||||
|
||||
public string M3U8File => IOPath.Combine(OutDir, $"{MediaName}.{Constants.M3_U8_EXT}");
|
||||
public string SegmentFile => IOPath.Combine(OutDir, $"{MediaName}%03d.{Constants.TS_EXT}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user