Exemple #1
0
        public IEnumerable <Thumbnail> GetThumbnails(string filename, IThumbnailPropertiesProvider properties, int count, int mediaLengthms)
        {
            var tempPath = Path.GetTempPath();

            List <Thumbnail> res    = new List <Thumbnail>();
            Random           r      = new Random();
            FFMpeg           ffmpeg = new FFMpeg();
            var maxms = mediaLengthms - properties.CaptureStartTime * 1000;


            for (int i = 0; i < count; i++)
            {
                TimeSpan span = new TimeSpan(0, 0, 0, properties.CaptureStartTime, r.Next(0, maxms));
                //var large = ffmpeg.TakeScreenshot(filename, span, properties.LargeThumbSize);
                var       small = ffmpeg.TakeScreenshot(filename, span, properties.SmallThumbSize);
                Thumbnail thumb = new Thumbnail()
                {
                    //Large = large,
                    Small     = small,
                    Position  = span,
                    IsChecked = true,
                };

                res.Add(thumb);
            }

            return(res);
        }
Exemple #2
0
        public Thumbnail GetThumbnailAt(string filename, TimeSpan position, IThumbnailPropertiesProvider properties)
        {
            FFMpeg ffmpeg = new FFMpeg();


            var res = new Thumbnail();

            res.Small     = ffmpeg.TakeScreenshot(filename, position, properties.SmallThumbSize);
            res.Position  = position;
            res.IsChecked = true;
            return(res);
        }
Exemple #3
0
        public void GetMainThumb(string filename, Thumbnail thumb, IThumbnailPropertiesProvider properties)
        {
            FFMpeg ffmpeg = new FFMpeg();

            thumb.Large = ffmpeg.TakeScreenshot(filename, thumb.Position, properties.LargeThumbSize);
        }