[FFmpeg-user] [Windows] Running ffmpeg.exe programatically - possible to monitor progress?

Mark Richards mark at richardsemail.net
Fri Feb 10 15:11:59 CET 2012

>On 10 February 2012 13:27, Mark Richards <mark at richardsemail.net> wrote:
>>> If my Win32 app launches ffmpeg.exe with a command-line, does anyone 
>>> know if there is a way to monitor the progress and when it has 
>>> finished?
>> It's actually pretty easy.  Create a Process, give it all the info to 
>> run ffmpeg, then let it run async, and monitor StandardError (For some 
>> reason ffmpeg writes to standarderror instead of standardOut).  Here's 
>> a snippet of VB.Net code I use. <snip>

>Thanks Mark & Alex. More specifically to ffmpeg, I was more wondering what
to _look for_ in the console output, and if there are cmd-line >arguments I
should look up which can make the output more easily computer-readable? The
default output I'm getting is not too friendly in this >regard.
>Mark: with your approach (which is the general idea I had in mind), I noted
ffmpeg.exe doesn't just write new lines but seems to update the same console
line as it is progressing. Does that come through to stderr as normal each
time the line changes?

My code is looking for "Time=" to figure out how much it has progressed in
the encoding.  In StandardError it just reads as a new line, so it works
just fine.  I have also looked at the source video ahead of time (with
ffmpeg) to figure out the duration of the video, so I can calculate a
percent instead of just time.  (I just run "ffmpeg.exe -i mysourcefile.mov"
and parse the text to find the duration). 


More information about the ffmpeg-user mailing list