Is there a neat way to check camera resolution in Mobile Sdk? As I don’t want to assume what’s the width and height of thumbnail I want to snatch?
var videoParams = new VideoParams()
{
CameraId = camera.CameraId,
DestWidth = 1920,
DestHeight = 1080,
CompressionLvl = 100,
FPS = 30,
MethodType = StreamParamsHelper.MethodType.Pull,
SignalType = StreamParamsHelper.SignalType.Playback,
StreamType = StreamParamsHelper.StreamType.Transcoded,
};
var playbackParams = new PlaybackParams { Time = DateTime.Now.AddMinutes(-1) };
if (connection.Thumbnail.GetThumbnailByTime(videoParams, playbackParams,
TimeSpan.FromSeconds(15)) is GetThumbnailResponse response
&& response.Thumbnail is byte thumbnail && thumbnail?.Length > 0
&& new MagickImage(thumbnail) is MagickImage image)
{
var savePath = $“{playbackParams.Time:yyyy-MM-ddThh-mm-ss}.jpg”;
if (File.Exists(savePath)) File.Delete(savePath);
image.Write(savePath);
Console.WriteLine($"Saved thumbnail to {savePath}...");
}