FFMPeg

r3plica

Member
Joined
Dec 22, 2011
Messages
11
Programming Experience
5-10
I am posting this out of desperation.
I have a class which I use to pass arguments to the command line and execute. This works perfectly for execute my command line stuff, but I have come across a problem.
I have this line set up:

C#:
            string fileName = Guid.NewGuid() + ".jpg";
            string video = System.IO.Path.Combine(oAsset.getBaseDirectory, oAsset.Filename);
            string thumbnail = System.IO.Path.Combine(oAsset.getBaseDirectory, fileName);
            string path = "/Dependancies/ffmpeg/ffmpeg.exe";
            string args = "ffmpeg  -itsoffset -4  -i \"" + HttpContext.Current.Server.MapPath(video) + "\" -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 \"" + HttpContext.Current.Server.MapPath(thumbnail) + "\"";
            Debug.WriteLine(args);
            string result = CommandLineExecuter.Execute(HttpContext.Current.Server.MapPath(path), args);

What it should do is create a thumbnail from my video.
When I debug this, the args comes back as:

ffmpeg -itsoffset -4 -i "E:\Path\To\My\Video\8867fbd9-948d-4ee1-8de5-f38e6af4d1af.avi" -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 "E:\Path\To\My\Video\1dbe7bca-8ae7-472f-82fe-0496ef730e04.jpg"

If I open up command prompt and paste that command in, it works fine.
I find a nice jpg in the same directory as my video....but (and this is what is driving me nuts)....the code returns an error when I run it.
The error returned is:

unable to find a suitable output for 'ffmpeg'

Now I have tried everything, but it just won't work....
I really hope someone has come across this before, becuase I just can't work it out. It has sucked up hours and hours of my time :(

/r3plica
 
Back
Top Bottom