1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00

Add macosx ffmpeg libs

This commit is contained in:
kelteseth 2018-12-01 18:00:49 +01:00
parent 615f23e861
commit a5ec0c7a5b
13 changed files with 52 additions and 12 deletions

BIN
ScreenPlay/ThirdParty/ffmpeg/OSX/ffmpeg vendored Normal file

Binary file not shown.

BIN
ScreenPlay/ThirdParty/ffmpeg/OSX/ffplay vendored Normal file

Binary file not shown.

BIN
ScreenPlay/ThirdParty/ffmpeg/OSX/ffprobe vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:78a3199769a97d122d30722e52c789066be5eee5c817c3b332c8fc3a3d08c6a8
size 47339168

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d663cad0911bce9f287b1ebad8964ba3e4672b6107563c6a25995993daede1dd
size 1926324

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:65ca937e920731f51910f29fb8630d32b38df31a544f6dfee23dcb21e325ebc6
size 7763628

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:29d7257882f656a5783cf64393eb717b78e7aceff053b437da6ab19ec44fd897
size 6585348

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:45500b2634e8f720ce2c824dc4066d7f23d403bf456f95f3e6cedc60a6687f4f
size 389200

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:51e735ec4a2ee1ff27a2f378ab1ca622c6e06dba3bb9422055b8ef66f3e35999
size 140948

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:93d037bcc9bcdf01f0e10b14353563a14f95211cd53141a4fcf98ce5f0d0e98e
size 371664

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3b881a81789a6e67972bc050ef283390c480454423b715a110764992d922b8ae
size 817308

View File

@ -51,10 +51,8 @@ bool Create::copyRecursively(const QString& srcFilePath, const QString& tgtFileP
void Create::createWallpaperStart(QString videoPath)
{
videoPath.remove("file:///");
qDebug() << this;
m_future = QtConcurrent::run([=]() {
qDebug() << this;
QDir dir;
dir.cd(this->m_settings->localStoragePath().toString());
@ -86,7 +84,6 @@ void Create::createWallpaperStart(QString videoPath)
bool Create::createWallpaperInfo()
{
qDebug() << this;
// Get video info
QStringList args;
args.append("-print_format");
@ -100,6 +97,9 @@ bool Create::createWallpaperInfo()
#ifdef Q_OS_WIN
pro.data()->setProgram(QApplication::applicationDirPath() + "/ffprobe.exe");
#endif
#ifdef Q_OS_MACOS
pro.data()->setProgram(QApplication::applicationDirPath() + "/ffprobe");
#endif
pro.data()->start();
emit createWallpaperStateChanged(Create::State::AnalyseVideo);
@ -194,6 +194,10 @@ bool Create::createWallpaperVideoPreview()
#ifdef Q_OS_WIN
proConvertImage.data()->setProgram(QApplication::applicationDirPath() + "/ffmpeg.exe");
#endif
#ifdef Q_OS_MACOS
pro.data()->setProgram(QApplication::applicationDirPath() + "/ffmpeg");
#endif
proConvertImage.data()->start();
while (!proConvertImage.data()->waitForFinished(100)) //Wake up every 100ms and check if we must exit
@ -241,6 +245,9 @@ bool Create::createWallpaperVideoPreview()
qDebug() << "Start converting video to preview mp4";
#ifdef Q_OS_WIN
proConvertPreviewMP4.data()->setProgram(QApplication::applicationDirPath() + "/ffmpeg.exe");
#endif
#ifdef Q_OS_MACOS
pro.data()->setProgram(QApplication::applicationDirPath() + "/ffmpeg");
#endif
emit createWallpaperStateChanged(Create::State::ConvertingPreviewVideo);
@ -251,11 +258,6 @@ bool Create::createWallpaperVideoPreview()
QCoreApplication::processEvents();
}
disconnect(this, &Create::abortCreateWallpaper, proConvertPreviewMP4.data(), &QProcess::kill);
if (proConvertPreviewMP4.data()->exitStatus() == QProcess::NormalExit) {
qDebug() << "normal exit";
} else {
qDebug() << "crash exit";
}
QString tmpErr = proConvertPreviewMP4.data()->readAllStandardError();
if (!tmpErr.isEmpty()) {
QFile previewVideo(m_createWallpaperData.exportPath + "/preview.mp4");
@ -292,6 +294,9 @@ bool Create::createWallpaperVideoPreview()
qDebug() << "Start converting video to preview gif";
#ifdef Q_OS_WIN
proConvertGif.data()->setProgram(QApplication::applicationDirPath() + "/ffmpeg.exe");
#endif
#ifdef Q_OS_MACOS
pro.data()->setProgram(QApplication::applicationDirPath() + "/ffmpeg");
#endif
connect(this, &Create::abortCreateWallpaper, proConvertGif.data(), &QProcess::kill);
proConvertGif.data()->start();
@ -346,7 +351,12 @@ bool Create::createWallpaperVideo()
QScopedPointer<QProcess> proConvertVideo(new QProcess());
proConvertVideo.data()->setArguments(args);
proConvertVideo.data()->setProcessChannelMode(QProcess::MergedChannels);
#ifdef Q_OS_WIN
proConvertVideo.data()->setProgram(QApplication::applicationDirPath() + "/ffmpeg.exe");
#endif
#ifdef Q_OS_MACOS
pro.data()->setProgram(QApplication::applicationDirPath() + "/ffmpeg");
#endif
qDebug() << "Start converting video";
connect(proConvertVideo.data(), &QProcess::readyReadStandardOutput, this, [&]() {
@ -367,10 +377,6 @@ bool Create::createWallpaperVideo()
this->processOutput(tmpOut);
});
// For some reason we only get output if we use execute instead of start....?!
#ifdef Q_OS_WIN
//proConvertVideo.data()->execute(QApplication::applicationDirPath() + "/ffmpeg.exe", args);
#endif
connect(this, &Create::abortCreateWallpaper, proConvertVideo.data(), &QProcess::kill);
proConvertVideo.data()->start(QIODevice::ReadOnly);
while (!proConvertVideo.data()->waitForFinished(100)) //Wake up every 100ms and check if we must exit
@ -430,4 +436,12 @@ void Create::abort()
emit abortCreateWallpaper();
m_futureWatcher.cancel();
QDir exportPath(m_createWallpaperData.exportPath);
if (exportPath.exists()) {
if (!exportPath.removeRecursively()) {
emit createWallpaperStateChanged(Create::State::AbortCleanupError);
qWarning() << "Could not delete temp exportPath: " << exportPath;
}
}
}

View File

@ -62,6 +62,7 @@ public:
ConvertingVideo,
ConvertingVideoFinished,
ConvertingVideoError,
AbortCleanupError,
Finished,
ErrorUnknown,
};
@ -98,6 +99,7 @@ public slots:
void abort();
void setWorkingDir(QString workingDir)
{
if (m_workingDir == workingDir)