[Geesas-Devs] SF.net SVN: geesas:[12] pencilanimation/src/external/win32/win32.cpp
Status: Abandoned
Brought to you by:
creek23
From: <cr...@us...> - 2009-02-09 16:32:49
|
Revision: 12 http://geesas.svn.sourceforge.net/geesas/?rev=12&view=rev Author: creek23 Date: 2009-02-09 16:32:27 +0000 (Mon, 09 Feb 2009) Log Message: ----------- fixed bug in exporting AVI. bug occurs when user runs Pencil in a directory with spaces (ex: C:\Documents and Settings\Pencil.exe) Modified Paths: -------------- pencilanimation/src/external/win32/win32.cpp Modified: pencilanimation/src/external/win32/win32.cpp =================================================================== --- pencilanimation/src/external/win32/win32.cpp 2009-02-08 11:20:27 UTC (rev 11) +++ pencilanimation/src/external/win32/win32.cpp 2009-02-09 16:32:27 UTC (rev 12) @@ -36,30 +36,44 @@ QProgressDialog progress("Exporting movie...", "Abort", 0, 100, NULL); progress.setWindowModality(Qt::WindowModal); progress.show(); - - QDir dir2(tempPath); + + QDir dir2(filePath); if (QFile::exists(QDir::current().currentPath() +"/plugins/ffmpeg.exe") == true) { if (QFile::exists(filePath) == true) { dir2.remove(filePath); } - + exportFrames(startFrame, endFrame, view, currentLayer, exportSize, tempPath+"tmp", "png", 100, true, true, 2); // --------- Quicktime assemble call ---------- - + QDir sampledir; + qDebug() << "testmic:" << sampledir.filePath(filePath); QProcess ffmpeg; - - ffmpeg.start(QDir::current().currentPath() +"/plugins/ffmpeg -i " + tempPath + "tmp%03d.png -v 0 \"" + filePath + "\""); - ffmpeg.waitForStarted(); - ffmpeg.waitForFinished(); - - progress.setValue(100); - qDebug() << "AVI export done"; - + + qDebug() << "Trying to export AVI"; + ffmpeg.start("./plugins/ffmpeg.exe -i " + tempPath + "tmp%03d.png -v 0 -r " + QString::number(fps) + " -y \"" + filePath + "\""); + if (ffmpeg.waitForStarted() == true) { + if (ffmpeg.waitForFinished() == true) { + /* + qDebug() << ffmpeg.readAllStandardOutput(); + qDebug() << ffmpeg.readAllStandardError(); + + qDebug() << "dbg:" << QDir::current().currentPath() +"/plugins/"; + qDebug() << ":" << tempPath + "tmp%03d.png"; + qDebug() << ":\"" + filePath + "\""; + */ + qDebug() << "AVI export done."; + } else { + qDebug() << "ERROR: FFmpeg did not finish executing."; + } + } else { + qDebug() << "ERROR: Could not execute FFmpeg."; + } // --------- Clean up temp directory --------- QDir dir(tempPath); QStringList filtername("*.*"); QStringList entries = dir.entryList(filtername,QDir::Files,QDir::Type); - for(int i=0;i<entries.size();i++) + for(int i=0;i<entries.size();i++) dir.remove(entries[i]); } else { - qDebug() << "Please place ffmpeg in plugins directory"; + qDebug() << "Please place ffmpeg.exe in plugins directory"; } + qDebug() << "-----"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |