Problem with System.Diagnostics.Process

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I’m having a problem automating a command line application (FFmpeg). I’m
able to manually pull up a command window and type in my arguments and run
the application however when I try to automate it with
System.Diagnostics.Process it fails:

Here’s my code:

Process ffmpeg = new Process();
ffmpeg.StartInfo.WorkingDirectory = FFmpegDirectory;
ffmpeg.StartInfo.FileName = "ffmpeg.exe";
ffmpeg.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
ffmpeg.StartInfo.Arguments = arguments;
ffmpeg.Start();
ffmpeg.WaitForExit();


Here are my command line arguments:

ffmpeg -i D:\MediaTools\test\test.wmv -pass 2 -vcodec libx264 -s 512x288 -r
29.97 -vpre D:\MediaTools\test\libx264-normal.ffpreset -b 768kb -bt 256k
-acodec libfaac -ar 22050 -ab 96k -threads 0
D:\MediaTools\test\55a3e152-830c-4bfa-a62d-8c7f7b6be5db.mp4


It seems after I made some changes to my arguments FFmpeg is outputting some
other messages that weren’t there before. Could this be causing my process
object to trip up? Thanks,

Scott


.