C # takes a video picture frame

First, download the ffmpeg  http://ffmpeg.org/ 

Attention must download from the official website, the rest can be a problem

After extracting ffmpeg.exe found in the bin directory 

 

 

 The mission is to use

-i video address -ss the first few frames -f image2 picture storage address

Try using cmd, ffmpeg.exe first switch to the directory, enter the command, press Enter

 

 

 

 

 

 

 Finally, the C # code

using (System.Diagnostics.Process process = new System.Diagnostics.Process())
{ process.StartInfo.FileName = @"D:\ffmpeg.exe"; process.StartInfo.Arguments= @"-i D:\111.mp4 -ss 10 -f image2 D:\test\1.jpg"; process.Start();
}

 

Guess you like

Origin www.cnblogs.com/zhouyg2017/p/11691323.html