PDA

View Full Version : Qprocess that call ffmpeg in mac



polin
13th January 2013, 11:17
Hi guys, I would use Qprocess in a GUI Application in mac for call of ffmpeg, I have created the code in this way:

..
#include <QProcess>
..

after

void MainWindow::on_pushButton_2_clicked()
{
QProcess gzip;

gzip.start("mkdir", QStringList() << "/..PATH../byebye");

if (!gzip.waitForFinished())
qDebug() << "Make failed:" << gzip.errorString();
else
qDebug() << "Make output:" << gzip.readAll();

QProcess p;

p.start("ffmpeg", QStringList() <<"-i"<< "/..PATH../reg.mov"<< "-acodec"<< "pcm_s32le"<<"/..PATH../output.wav");

if (!p.waitForFinished())

qDebug() << "Make2 failed:" << p.errorString();
else
qDebug() << "Make2 output:" << p.readAll();

}

But I have in output:

Make output: ""
Make2 failed: "No such file or directory" http://www.qtcentre.org/images/smilies/frown.png

the first Qprocess make a new dir in the path, but the second Qprocess don't find the file that exist in that path.

I don't understand if is a visibility or permission denied problem, because if the path are the same and the file .mov exist, why the Qprocess don't find this?

Thank you very much!

seeingsites
11th April 2013, 22:11
You probably already know this, but just in case be sure that ffmpeg is in the path of the user account, which is running the application. To put it simply, does the application have a way to locate ffmpeg? If not, this can be achieved in one of two ways, add the path to its location to the users PATH or by explicitly supplying the full path to ffmpeg.

For example, if the full path to where ffmpeg is installed is

/usr/local/bin/ffmpeg

You could add /usr/local/bin/ to the users path, or specify the full path to ffmpeg in your call, like this...

p.start("/usr/local/bin/ffmpeg", QStringList() <<"-i"<< "/..PATH../reg.mov"<< "-acodec"<< "pcm_s32le"<<"/..PATH../output.wav");

I hope that is clear
-J