Click here to Skip to main content
15,795,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to generate thumbnails from a video file.I had see a solution in codeproject but it is not working properly.

the code is here..

C#
// preview frame
Process ffmpeg; // creating process
string video;
string thumb;
video = Page.MapPath("Video0008.3gp"); // setting video input name with path
thumb = Page.MapPath("") +"\\frame3.jpg"; // thumb name with path !
ffmpeg = new Process();
ffmpeg.StartInfo.Arguments = " -i \""+video+"\ -s 108*80  -vframes 1 -f image2 -vcodec mjpeg \""+thumb+"\"; // arguments !
       
ffmpeg.StartInfo.FileName = Page.MapPath("ffmpeg.exe");
ffmpeg.Start(); // start !


please help me soon as possible...

[Modified: added <pre> tags]
Posted
Updated 26-Mar-10 9:26am
v2

eldhose777 wrote:
please help me soon as possible...


This is redundant. We'll help when we feel like it, and most people inclined to help will help when they read this ( as I did ).

What do you mean by 'not working' ? You seem to be just using ffmpeg.exe to do what you want, instead of writing code to extract a frame. You're obviously doing it on a website, why are your video and filenames hard coded ?

As your code does close to nothing, there's not much to say. You need to tell us what bit does not work. Does ffmpeg run ? It's what does the work, you either are not mapping paths properly, you have a permissions issue, or you're not running ffmpeg with the right parameters.
 
Share this answer
 
hai christian...
actually your code is working and ffmpeg.exe also fine.I had hard coded the path only for testing purposes and the problem is all generated thumnails are black background only.I had test it for a number of videos but the result is same..
 
Share this answer
 
v2

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