why cant I launch program through QT qprocess

I programmed a very simple interface for key frame extraction with backend of avconv. I use qprocess to call avconv whose path is surely put into PATH env. I cant get avconv launched. I debugged my program and found nothing going wrong, but the avconv just cant be launched. what could be the program. All the source are pasted below. Thx for any hints!

KeyFrameExtract.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
 * File:   KeyFrameExtract.cpp
 * Author: xieyi
 *
 * Created on 2014年9月30日, 下午9:03
 */

#include "KeyFrameExtract.h"

KeyFrameExtract::KeyFrameExtract()
{
	widget.setupUi(this);
	connect(widget.pushButtonSelectVideo,SIGNAL(clicked()),this,SLOT(selectVideoFile()));
}

KeyFrameExtract::~KeyFrameExtract()
{
}

void KeyFrameExtract::selectVideoFile()
{
	QString fileName;
	while(1) {
		fileName = QFileDialog::getOpenFileName(
			this,tr("打开视频文件"),tr("."),tr("视频文件 (*.mp4 *.mpeg *.avi)")
		);
		if(false == fileName.isEmpty()) break;
	}
	QStringList args;
	QDir output(QFileInfo(fileName).baseName());
	if(output.exists()) removeDir(output.path());
	QDir().mkdir(output.path());
	args<<"-i"<<fileName<<"-vf"<<"select='eq(pict_type\\,I),setpts=N/(25*TB)'"
		<<"-q"<<"1"<<output.path() + "/%09d.bmp";
	process = QSharedPointer<QProcess>(new QProcess);
	connect(process.data(),SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(processFinished(int,QProcess::ExitStatus)));
	process->start("avconv",args);
#ifndef NDEBUG
	QString cmd;
	cmd += "avconv";
	for(int i = 0 ; i < args.size() ; i++) cmd += " " + args[i];
	qDebug()<<cmd;
#endif
	if(false == process->waitForStarted()) {
		QMessageBox::critical(this,tr("错误"),tr("无法启动!"));
		return;
	}
}

void KeyFrameExtract::processFinished(int,QProcess::ExitStatus)
{
	QMessageBox::information(this,tr("成功"),tr("关键帧提取完毕!"));
	process.clear();
}

bool KeyFrameExtract::removeDir(const QString & dirName)
{
	bool result = true;
	QDir dir(dirName);

	if (dir.exists(dirName)) {
		Q_FOREACH(QFileInfo info, dir.entryInfoList(QDir::NoDotAndDotDot | QDir::System | QDir::Hidden  | QDir::AllDirs | QDir::Files, QDir::DirsFirst)) {
			if (info.isDir())
				result = removeDir(info.absoluteFilePath());
			else
				result = QFile::remove(info.absoluteFilePath());

			if (!result)
				return result;
        }
		result = dir.rmdir(dirName);
	}
	return result;
}

KeyFrameExtract.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* 
 * File:   KeyFrameExtract.h
 * Author: xieyi
 *
 * Created on 2014年9月30日, 下午9:03
 */

#ifndef _KEYFRAMEEXTRACT_H
#define	_KEYFRAMEEXTRACT_H

#include <QtGui>
#include <QSharedPointer>
#include "ui_KeyFrameExtract.h"

class KeyFrameExtract : public QDialog {
	Q_OBJECT
	QSharedPointer<QProcess> process;
public:
	KeyFrameExtract();
	virtual ~KeyFrameExtract();
private slots:
	void selectVideoFile();
	void processFinished(int,QProcess::ExitStatus);
private:
	Ui::KeyFrameExtract widget;
	bool removeDir(const QString & dirName);
};

#endif	/* _KEYFRAMEEXTRACT_H */

main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
 * File:   main.cpp
 * Author: xieyi
 *
 * Created on 2014年9月30日, 下午9:02
 */

#include <QtGui>
#include "KeyFrameExtract.h"

int main(int argc, char *argv[])
{
	// initialize resources, if needed
	// Q_INIT_RESOURCE(resfile);

	QApplication app(argc, argv);
	QTextCodec::setCodecForTr(QTextCodec::codecForName("utf-8"));
	// create and show your widgets here
	KeyFrameExtract dialog;
	dialog.show();
	
	return app.exec();
}

KeyFrameExtract.ui
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>KeyFrameExtract</class>
 <widget class="QDialog" name="KeyFrameExtract">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>400</width>
    <height>300</height>
   </rect>
  </property>
  <property name="windowTitle">
   <string>KeyFrameExtract</string>
  </property>
  <widget class="QPushButton" name="pushButtonSelectVideo">
   <property name="geometry">
    <rect>
     <x>40</x>
     <y>50</y>
     <width>331</width>
     <height>111</height>
    </rect>
   </property>
   <property name="text">
    <string>选择视频</string>
   </property>
  </widget>
 </widget>
 <resources/>
 <connections/>
</ui>
Topic archived. No new replies allowed.