... //various declarations
QObject::connect(&ffmpeg,
SIGNAL(started
()),
this,
SLOT(getPid
()));
ffmpeg.start("ffmpeg -i movie.avi -y movie.mkv"); //just an example. here I call ffmpeg with right parameters to do a (long) encoding
... //getPid() function;
void getPid(){
qdebug() << "FFmpeg pid: " + this.ffmpeg.pid(); //here often it gives me a substring of the command line, let's say for this example "-y mov", but it can happen that it gives me also other strings of my program, like it reads unclean memory
}
//please note that the same piece of code, for other processes I call using QProcess, gives me the right pid
... //various declarations
QProcess ffmpeg;
QObject::connect(&ffmpeg, SIGNAL(started()), this, SLOT(getPid()));
ffmpeg.start("ffmpeg -i movie.avi -y movie.mkv"); //just an example. here I call ffmpeg with right parameters to do a (long) encoding
... //getPid() function;
void getPid(){
qdebug() << "FFmpeg pid: " + this.ffmpeg.pid(); //here often it gives me a substring of the command line, let's say for this example "-y mov", but it can happen that it gives me also other strings of my program, like it reads unclean memory
}
//please note that the same piece of code, for other processes I call using QProcess, gives me the right pid
To copy to clipboard, switch view to plain text mode
Bookmarks