-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathExtensions.cs
More file actions
21 lines (19 loc) · 1.02 KB
/
Extensions.cs
File metadata and controls
21 lines (19 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using TensorStack.Common.Tensor;
using TensorStack.Common.Video;
namespace TensorStack.Video
{
public static class Extensions
{
public static Task SaveAync(this VideoTensor videoTensor, string videoFile, string videoCodec = "mp4v", float? frameRateOverride = default, CancellationToken cancellationToken = default)
{
return VideoManager.SaveVideoTensorAync(videoFile, videoTensor, videoCodec, frameRateOverride, cancellationToken: cancellationToken);
}
public static Task SaveAync(this IAsyncEnumerable<VideoFrame> videoFrames, string videoFile, string videoCodec = "mp4v", int? widthOverride = null, int? heightOverride = null, float? frameRateOverride = null, CancellationToken cancellationToken = default)
{
return VideoManager.WriteVideoStreamAsync(videoFile, videoFrames, videoCodec, widthOverride, heightOverride, frameRateOverride, cancellationToken);
}
}
}