Java代码  [ffmpeg]通过Qt调用ffmpeg命令_springmvc

  1. poc = new QProcess(this);  

  2.    QString command = QString("D:/ffmpeg-bbezxcy-compressMode-0.0.1/bin/ffmpeg -i F:rawvideo/1.mp4 -pass 1 -y F:/rawvideo/1xxx1.mp4");  

  3.   connect(poc, SIGNAL(readyReadStandardOutput()), this, SLOT(sltOnReadOutput()));  

  4.    connect(poc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(onFinished(int, QProcess::ExitStatus)));  

  5.   

  6.    //poc->start("D://ffmpeg.bat");  

  7.    poc->setProcessChannelMode(QProcess::MergedChannels);  

  8.    poc->start(command);  

 在Qt的槽中这样获取ffmpeg的字符串

Cpp代码 下载  [ffmpeg]通过Qt调用ffmpeg命令_springmvc

  1. void QtClass::sltOnReadOutput(){  

  2.     QString s = poc->readAllStandardOutput();  

  3. }