poc = new QProcess(this); QString command = QString("D:/ffmpeg-bbezxcy-compressMode-0.0.1/bin/ffmpeg -i F:rawvideo/1.mp4 -pass 1 -y F:/rawvideo/1xxx1.mp4"); connect(poc, SIGNAL(readyReadStandardOutput()), this, SLOT(sltOnReadOutput())); connect(poc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(onFinished(int, QProcess::ExitStatus))); //poc->start("D://ffmpeg.bat"); poc->setProcessChannelMode(QProcess::MergedChannels); poc->start(command);
在Qt的槽中这样获取ffmpeg的字符串
void QtClass::sltOnReadOutput(){ QString s = poc->readAllStandardOutput(); }