-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideoprocessor.h
55 lines (46 loc) · 1.52 KB
/
videoprocessor.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
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
#ifndef VIDEOPROCESSOR_H
#define VIDEOPROCESSOR_H
#include <QObject>
#include <QString>
#include <QFile>
#include <QTextStream>
#include <QStringList>
class VideoProcessor : public QObject {
Q_OBJECT
public:
enum SortType {
NoSort,
Quality,
Name,
Duration,
Size
};
VideoProcessor(const QString &directory, bool verbose, SortType sortType);
public slots:
void process(const QString &outputPath);
void processManualPlaylist(const QStringList &filePaths, const QString &outputPath);
signals:
void outputGenerated(const QString &output);
void errorOccurred(const QString &error);
void logMessage(const QString &message);
void finished();
private:
QString m_directory;
bool m_verbose;
SortType m_sortType;
QFile m_logFile;
QTextStream m_logStream;
QStringList findVideoFiles(const QString &directory);
int getVideoDuration(const QString &filePath);
QString getVideoCodec(const QString &filePath);
QString getVideoResolution(const QString &filePath);
double getVideoBitrate(const QString &filePath);
QString getAudioCodec(const QString &filePath);
int getAudioBitrate(const QString &filePath);
qint64 getFileSize(const QString &filePath);
QString getFileExtension(const QString &filePath);
void log(const QString &message);
QString generatePlaylist(const QStringList &videoFiles, const QString &outputPath);
void sortVideoFiles(QList<QPair<QString, int>> &videoList);
};
#endif // VIDEOPROCESSOR_H