• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 390
  • Last Modified:

Picture of video

Hi

I have a list of videos which I want to show in the grid.

But I want the first scene of the video.

How can I get that
0
KaranGupta
Asked:
KaranGupta
  • 6
  • 4
1 Solution
 
Chad SmithSoftware EngineerCommented:
Several options for you
1) Using FFMpeg

FFMpeg.exe -i "c:\MyPath\MyVideo" -vframes 1 "c:\MyOutputPath\MyImage%d.jpg"
The %d is very important. If you do not include this, FFMpeg will throw an error. The %d will substitute a serial number when writing out the file

2) Using WPF MediaKit
http://wpfmediakit.codeplex.com/SourceControl/changeset/view/17356#245585
MediaDetector.GetImage()
0
 
tillgeffkenCommented:
mpg? xvid? flash? divx? wmv? mov? Probably different for each of them.
0
 
KaranGuptaAuthor Commented:
Hi

I have tried to search  FFMPEG utility but I am not able to see where it is on my machine
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
KaranGuptaAuthor Commented:
HI

I have tried WPF media kit

DO I need to import something to make it work.

Because when I am compiling the code I am getting run time error.
0
 
Chad SmithSoftware EngineerCommented:
FFMPEG is available here http://sourceforge.net/projects/ffmpeg
0
 
Chad SmithSoftware EngineerCommented:
0
 
KaranGuptaAuthor Commented:
HI

I have seen the samples about WPF Media kit.

But I am not getting the code from where I can see how to use the GetImage() function.

Can you please elaborate that.
0
 
Chad SmithSoftware EngineerCommented:
           MediaDetector det = new MediaDetector();
            det.LoadMedia("43630159.avi");
            BitmapSource bitmap = det.GetImage(TimeSpan.FromSeconds(1));
0
 
KaranGuptaAuthor Commented:
after I got the value in bitmap  

How can I put it in Image class.

I am using web application
0
 
KaranGuptaAuthor Commented:
I want to know is if the value comes into the BitMapSource then how can I save the image on the drive
0
 
KaranGuptaAuthor Commented:
Hi

I have written the following code
to save the jpg file

but I am not getting the picture of video
FileStream stream = new FileStream("c:\\empty.jpg", FileMode.Create);
            JpegBitmapEncoder encoder = new JpegBitmapEncoder();                        
            encoder.Frames.Add(BitmapFrame.Create(bitmap));
            encoder.Save(stream);

Open in new window

0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now