Hi guys,
I have to start ffmpeg from within my program, under Os X. It's installed via macports, so the executable file is in /opt/local/bin/ffmpeg. I'm trying to do this:
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("PATH", env.value("PATH") + ":/opt/local/bin");
env.insert("PATH", env.value("PATH") + ":/opt/local/sbin");
this->ffmpegProcess.setProcessEnvironment(env);
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("PATH", env.value("PATH") + ":/opt/local/bin");
env.insert("PATH", env.value("PATH") + ":/opt/local/sbin");
this->ffmpegProcess.setProcessEnvironment(env);
To copy to clipboard, switch view to plain text mode
After this I print the environment variables of the process with:
QStringList environment
= ffmpegProcess.
processEnvironment().
toStringList();
for(int i=0; i < environment.size(); i++){
std::cout << environment.at(i).toLocal8Bit().constData() << std::endl;
}
QStringList environment = ffmpegProcess.processEnvironment().toStringList();
for(int i=0; i < environment.size(); i++){
std::cout << environment.at(i).toLocal8Bit().constData() << std::endl;
}
To copy to clipboard, switch view to plain text mode
and in effect, I obtain:
QTDIR=/usr/local/Qt4.7
PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin:/opt/local/bin:/opt/local/sbin
TMPDIR=/var/folders/Do/DoA9CZUOFWa0g8wPOe-FYk+++TI/-Tmp-/
etc...
QTDIR=/usr/local/Qt4.7
PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin:/opt/local/bin:/opt/local/sbin
TMPDIR=/var/folders/Do/DoA9CZUOFWa0g8wPOe-FYk+++TI/-Tmp-/
etc...
To copy to clipboard, switch view to plain text mode
So, now the PATH is ok, but if I try to start ffmpeg WITHOUT prepending "/opt/local/bin/" it doesn't work.
Any suggestion?
Thx in advance
Bookmarks