summaryrefslogtreecommitdiffstats
path: root/helper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'helper.cpp')
-rw-r--r--helper.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/helper.cpp b/helper.cpp
index 1881102..3856bfc 100644
--- a/helper.cpp
+++ b/helper.cpp
@@ -223,7 +223,6 @@ namespace Helper {
QSettings s;
QString ffProbe = s.value("paths/ffprobe").toString();
QStringList args;
- QVariantMap retval;
args << "-v" << "quiet" << "-print_format" << "json" << "-show_format" << path;
QProcess ffproc;
ffproc.start(ffProbe, args);
@@ -236,6 +235,21 @@ namespace Helper {
return jsDoc.object().value("format").toObject().toVariantMap();
}
+ QJsonDocument streamData(const QString &path){
+ QSettings s;
+ QString ffProbe = s.value("paths/ffprobe").toString();
+ QStringList args;
+ args << "-v" << "quiet" << "-print_format" << "json" << "-show_format" << "-show_streams" << path;
+ QProcess ffproc;
+ ffproc.start(ffProbe, args);
+ if(!ffproc.waitForStarted()){
+ return QJsonDocument();
+ }
+ ffproc.waitForFinished();
+ QByteArray ffData = ffproc.readAllStandardOutput();
+ return QJsonDocument::fromJson(ffData);
+ }
+
Duration::Duration() : mHours(0), mMinutes(0), mSeconds(0) {}
Duration::Duration(qint64 seconds){