when i do the following command into dos it will work fine
ffmpeg -f image2 -i frame%d.jpg -vcodec mpeg4 -b 800k video.avi
When I try to use the process class in c#, without the arguments, it loads ffmpeg in a console window then dissapears like usual. However, when I try to use the argument as I do above, formatted exactly the same…it doesn’t work! ffmpeg still loads, however since the console window closes so fast I cannot determine what the error is :/
Process ffmpeg = new Process();
ffmpeg.StartInfo.FileName = path + "//" + "ffmpeg.exe";
ffmpeg.StartInfo.Arguments = " -f image2 -i frame%d.jpg -vcodec mpeg4 -b 800k video.avi";
ffmpeg.Start();
Any one know why this is? Why would the command work from dos and then fail to work using c# even when the arguments are exactly the same? I’ve used this method before for many things and never encountered this.
Try fully qualifying the filenames in the arguments – I notice you’re specifying the path in the FileName part, so it’s possible that the process is being started elsewhere, then not finding the arguments and causing an error.
If that works, then setting the WorkingDirectory property on the StartInfo may be of use.
Actually, according to the link