[英]How Reliable is Microsoft.Expression.Encoder.MediaItem?
I am using the Microsoft.Expression.Encoder
Namespace to get the thumbnail of the VideoFile Upload Via following method: 我正在使用Microsoft.Expression.Encoder
命名空间通过以下方法获取VideoFile Upload的缩略图:
MediaItem video = new MediaItem(file);
int Duration = video.FileDuration.Seconds;
using (var bitmap = video.MainMediaFile.GetThumbnail
(new TimeSpan(0, 0, (int)Duration / 2),
new System.Drawing.Size(640, 480)
))
{
bitmap.Save(Path.Combine(_fileDirectory, UniqueId + "_thumb.jpg"));
}
Constructor new MediaItem(file) Require Native Software installed on the machine for eg QuickTime Player for .MOV Files, I am wondering If there are like 500 videos being uploaded every minute how reliable will be this scenario as it is using QuicktimePlayer to get the File info and does each thread will be able to use the QuickTimePlayer at same time? 构造函数new MediaItem(file)需要在计算机上安装本地软件,例如用于.MOV文件的QuickTime Player,我想知道如果每分钟上载500个视频,那么使用QuicktimePlayer获取文件时,这种情况的可靠性如何?信息,每个线程都可以同时使用QuickTimePlayer吗?
You would most likely need to test it yourself. 您很可能需要自己对其进行测试。 Try running this in a single thread and in several threads. 尝试在单个线程和多个线程中运行它。 It's probably wise to use threadpool, as threads can be reused. 使用线程池可能是明智的,因为线程可以重复使用。
The reason is that all the hardware is different and the same application may behave a bit differently, for example a single video card may not allow you to run two loads simultaneously, however if you have several video cards, it is likely to be possible. 原因是所有硬件都不相同,并且同一应用程序的行为可能有所不同,例如,单个视频卡可能不允许您同时运行两个负载,但是,如果您有多个视频卡,则可能会出现这种情况。
PS I have no knowledge of the video processing (or Microsoft.Expression.Encoder namespace). PS我不了解视频处理(或Microsoft.Expression.Encoder命名空间)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.