Search code examples
c#video-streamingvideo-processingquicktimevideo-encoding

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:

 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 e.g 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?


Solution

  • 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).