Ticket #8024: FFProbeWithQProcess.cpp

File FFProbeWithQProcess.cpp, 571 bytes (added by Alexis Foerster, 7 years ago)

Code example

Line 
1#include <QProcess>
2#include <QString>
3#include <cstdlib>
4#include <iostream>
5
6int executeCommand(const QString& command, const bool& log)
7{
8 QProcess process;
9 const int returnCode = process.execute(command);
10 if (log)
11 {
12 std::cout << "Command: " << command.toStdString() << std::endl;
13 std::cout << "ReturnCode: " << returnCode << std::endl;
14 }
15 return returnCode;
16}
17
18int main()
19{
20 const QString command = QString("ffprobe -v error -show_format input.mp4 > output.txt");
21 executeCommand(command, true);
22 return EXIT_SUCCESS;
23}