better clips

This commit is contained in:
2023-12-13 13:46:30 +00:00
parent 3998db8ea1
commit d087850f69
4 changed files with 95 additions and 33 deletions

View File

@ -2,17 +2,25 @@ namespace NostrStreamer.Services.Clips;
public interface IClipService
{
Task<List<ClipSegment>?> PrepareClip(Guid streamId);
Task<TempClip?> PrepareClip(Guid streamId);
Task<ClipResult?> MakeClip(string takenBy, List<ClipSegment> segments, float start, float length);
Task<ClipResult?> MakeClip(string takenBy, Guid streamId, Guid clipId, float start, float length);
}
public record ClipResult(Uri Url);
public record ClipResult(Uri Url, float Length);
public record ClipSegment(Guid Id, int Index)
public record ClipSegment(Guid Id, int Index, float Length)
{
public string GetPath()
{
return Path.Join(Path.GetTempPath(), Id.ToString(), $"{Index}.ts");
}
}
}
public record TempClip(Guid StreamId, Guid Id, float Length)
{
public string GetPath()
{
return Path.Join(Path.GetTempPath(), $"{Id}.mp4");
}
}