an attempt at creating a thumbnailer
This commit is contained in:
parent
246c75c789
commit
6366dc2d88
2 changed files with 15 additions and 0 deletions
|
@ -18,6 +18,7 @@
|
|||
#include <QStandardPaths>
|
||||
#include <QImage>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
SlideModel::SlideModel(QObject *parent)
|
||||
: QAbstractListModel(parent) {
|
||||
|
@ -639,3 +640,15 @@ void SlideModel::moveRowFromService(const int &fromIndex,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
QString SlideModel::thumbnailVideo(QString video) {
|
||||
|
||||
std::system("ffmpeg -i Rust\ Tutorial\ Full\ Course.webm -vframes 1 -an -s 576x324 -ss 35 OutputFile.jpg");
|
||||
|
||||
QTemporaryFile thumbnail;
|
||||
if (thumbnail.open()) {
|
||||
|
||||
return thumbnail.fileName();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -79,6 +79,8 @@ public:
|
|||
Q_INVOKABLE QVariantMap getItem(int index) const;
|
||||
Q_INVOKABLE QVariantList getItems();
|
||||
Q_INVOKABLE int findSlideIdFromServItm(int index);
|
||||
Q_INVOKABLE void thumbnailVideo(QString video);
|
||||
|
||||
|
||||
public slots:
|
||||
Q_INVOKABLE bool select(int id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue