| 1 | #include <QProcess>
|
|---|
| 2 | #include <QString>
|
|---|
| 3 | #include <cstdlib>
|
|---|
| 4 | #include <iostream>
|
|---|
| 5 |
|
|---|
| 6 | int 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 |
|
|---|
| 18 | int 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 | }
|
|---|