[Interest] QProcess performance issues

Matthew Woehlke mw_triad at users.sourceforge.net
Tue May 12 20:21:29 CEST 2015


I have an application that generates a series of images (QImage) and
writes them to disk as a video. I am encoding the video using an
external FFmpeg process, which I start and communicate with via
QProcess. I feed this the images via its stdin, using QImage::save to
write them to the QProcess in BMP format (FFmpeg options '-f image2pipe
-c:v bmp -i -').

This works fine on Linux. On Windows, it is APPALLINGLY slow; on the
order of seconds per frame. Also, on Windows, it takes a very long time
(minutes) before even the initial output from FFmpeg appears. (I'm using
QProcess::ForwardedChannels, although switching to default and just
letting the output buffer doesn't seem to make a difference.)

The problem *seems* to be with QProcess; running FFmpeg in a shell seems
to have reasonable performance. It's almost as if running the process
through QProcess is causing it to execute extremely slowly.

Has anyone else encountered anything like this, or have any idea what
might be going wrong?

(Note: This is with Qt 4. Upgrading to Qt 5 is not an option at this time.)

-- 
Matthew




More information about the Interest mailing list