Click here to Skip to main content
15,880,392 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hello,

I had searched lot of sites and much more googling. I had found several tools like,

Emgu CV
NReco.videoconverter (dot net wrapper for ffmpeg)
Dexter.lib

But all this tools works fine on avi video only. None of this tools works on any other video file formats.

Friends, it's an emergency. I am trying for almost a week. Please help me to resolve this problem.

What I have tried:

I had tried following but its only extracts frames from avi video files.

using Dexter.lib
public void ExtractFrame(string videofile)
{
try
{
Bitmap image = FrameGrabber.GetFrameFromVideo(videofile, 0.2d);
image.Save(FramesPath + "1.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
}
catch (Exception d)
{
Label1.Text = d.Message;
}
}

using NReco.videoconverter
public void ExtractFromMP4(string videofile)
{
try
{
NReco.VideoConverter.FFMpegConverter ffm = new FFMpegConverter();
ConvertSettings cs = new ConvertSettings();
cs.SetVideoFrameSize(320, 240);
ffm.ConvertMedia(videofile, "avi", FramesPath + "new.mp4", "mp4", cs);
ffm.GetVideoThumbnail(videofile, FramesPath + "4.jpg", 2);
}
catch (Exception d)
{
Label1.Text = d.Message;
}
}
Posted
Comments
RickZeeland 2-Apr-16 3:46am    
If you use html5 you can do it as mentioned here:
http://stackoverflow.com/questions/13760805/how-to-take-a-snapshot-of-html5-javascript-based-video-player
Rajesh Londhe 2-Apr-16 3:54am    
Hello Rick,

Thanks for your support.
But, i have to extract frames in background, at server side (code behind). Because, i have to implement further processing on extracted frames.
RickZeeland 2-Apr-16 4:03am    
Maybe you can have a look at the source code of the iSpy video software:
https://www.ispyconnect.com/

I think they will use FFmpeg: https://www.ffmpeg.org/

Example: http://stackoverflow.com/questions/27568254/how-to-extract-1-screenshot-for-a-video-with-ffmpeg-at-a-given-time
Rajesh Londhe 2-Apr-16 5:26am    
As mentioned in posted question, i already try dot net wrapper of ffmpeg. But it also extracts frames from avi video file. Even, i will try converter function of ffmpeg. It will convert avi to mp4 but not in reverse order.
RickZeeland 2-Apr-16 16:18pm    
And when you call ffmpeg directly as follows ?
ffmpeg -i input_file.mp4 -ss 01:23:45 -vframes 1 output.jpg

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900