├── FUNDING.yml ├── New ├── assets │ ├── FrameGUI.rc │ ├── icon.ico │ ├── icon.png │ ├── icon.icns │ ├── ig_logo.png │ ├── yt_logo.png │ ├── FrameGUI.png │ ├── pp_donate.png │ ├── Fgui_small.png │ ├── discord_logo.png │ ├── patreon_logo.png │ └── FrameGUI.qrc ├── fgui.png ├── fgui_mos.png ├── src │ ├── main.cpp │ ├── ui │ │ ├── update.cpp │ │ ├── msgbox.cpp │ │ ├── settings.cpp │ │ └── config.cpp │ ├── vs │ │ ├── srmd.cpp │ │ ├── rife.cpp │ │ ├── svpflow.cpp │ │ ├── colors.cpp │ │ └── vapoursynth.cpp │ ├── process │ │ ├── processworker.cpp │ │ ├── scriptbuilder.cpp │ │ ├── mediaconfig.cpp │ │ └── ffloader.cpp │ ├── io │ │ ├── audioinfo.cpp │ │ ├── videoinfolist.cpp │ │ ├── subtitleinfo.cpp │ │ ├── processerror.cpp │ │ ├── progressinfo.cpp │ │ └── videoinfo.cpp │ ├── checks │ │ ├── files.cpp │ │ └── process.cpp │ ├── regex │ │ ├── processerrorregex.cpp │ │ ├── audiosubinforegex.cpp │ │ ├── progressinforegex.cpp │ │ └── videoinforegex.cpp │ └── arguments │ │ └── argument.cpp ├── include │ ├── audioinfo.hpp │ ├── update.hpp │ ├── processerrorregex.hpp │ ├── videoinfolist.hpp │ ├── progressinforegex.hpp │ ├── subtitleinfo.hpp │ ├── processerror.hpp │ ├── argument.hpp │ ├── videoinforegex.hpp │ ├── audiosubinforegex.hpp │ ├── vapoursynth.hpp │ ├── checks.hpp │ ├── mediaconfig.hpp │ ├── progressinfo.hpp │ ├── scriptbuilder.hpp │ ├── videoinfo.hpp │ ├── ffloader.hpp │ ├── windows │ │ ├── update.ui │ │ └── ui_update.hpp │ ├── darwin │ │ ├── ui_update.hpp │ │ └── update.ui │ └── framegui.hpp ├── FrameGUI.vcxproj.user ├── FrameGUI.sln └── fgui_darwin.pro ├── .gitattributes ├── Old (DEPRECATED) ├── photos │ ├── noob.PNG │ ├── save.PNG │ ├── x264.PNG │ ├── audio.PNG │ ├── avserr.PNG │ ├── input.PNG │ ├── frameGUI.PNG │ ├── inputerr.PNG │ ├── progress.PNG │ └── svpflow.PNG ├── FrameGUI │ ├── icon.ico │ ├── FrameGUI.csproj.user │ ├── Program.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Settings.settings │ │ └── Resources.resx │ ├── FrameGUI.sln │ └── App.config ├── EncodeProg │ ├── bin │ │ └── Debug │ │ │ └── EncodeProg.dll │ ├── ProgressBarLabel.Designer.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── ProgressBarLabel.cs │ └── EncodeProg.csproj ├── FFLoader │ ├── bin │ │ └── Debug │ │ │ └── netstandard2.0 │ │ │ └── FFLoader.dll │ ├── Properties │ │ └── launchSettings.json │ ├── FFLoader.csproj.user │ ├── FFLoader │ │ ├── FFLoaderException.cs │ │ ├── Arguments │ │ │ ├── MapArgs.cs │ │ │ ├── TuneArgs.cs │ │ │ ├── EncoderAppArgs.cs │ │ │ ├── SampleRateArgs.cs │ │ │ ├── PresetArgs.cs │ │ │ ├── FrameArgs.cs │ │ │ ├── SharpenArgs.cs │ │ │ ├── CodecArgs.cs │ │ │ ├── ResolutionArgs.cs │ │ │ ├── BitrateArgs.cs │ │ │ └── ArgsBuilder.cs │ │ ├── Handlers │ │ │ ├── InfoFPSHandler.cs │ │ │ ├── FFMpegErrorHandler.cs │ │ │ ├── AviSynthErrorHandler.cs │ │ │ ├── FFExceptionHandler.cs │ │ │ ├── ConversionProgressHandler.cs │ │ │ └── VideoInfoHandler.cs │ │ ├── Helpers │ │ │ ├── FileHelper.cs │ │ │ └── ProcessHelper.cs │ │ ├── FFEncoder.cs │ │ ├── ProcessWorker.cs │ │ └── FFEvents.cs │ ├── FFLoader.csproj │ └── FFLoader.sln └── CHANGELOG └── README.md /FUNDING.yml: -------------------------------------------------------------------------------- 1 | patreon: dagoose 2 | -------------------------------------------------------------------------------- /New/assets/FrameGUI.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "icon.ico" -------------------------------------------------------------------------------- /New/fgui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/New/fgui.png -------------------------------------------------------------------------------- /New/fgui_mos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/New/fgui_mos.png -------------------------------------------------------------------------------- /New/assets/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/New/assets/icon.ico -------------------------------------------------------------------------------- /New/assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/New/assets/icon.png -------------------------------------------------------------------------------- /New/assets/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/New/assets/icon.icns -------------------------------------------------------------------------------- /New/assets/ig_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/New/assets/ig_logo.png -------------------------------------------------------------------------------- /New/assets/yt_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/New/assets/yt_logo.png -------------------------------------------------------------------------------- /New/assets/FrameGUI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/New/assets/FrameGUI.png -------------------------------------------------------------------------------- /New/assets/pp_donate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/New/assets/pp_donate.png -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.hpp linguist-language=C++ 2 | *.cs linguist-language=C# 3 | *.cpp linguist-language=C++ 4 | -------------------------------------------------------------------------------- /New/assets/Fgui_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/New/assets/Fgui_small.png -------------------------------------------------------------------------------- /New/assets/discord_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/New/assets/discord_logo.png -------------------------------------------------------------------------------- /New/assets/patreon_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/New/assets/patreon_logo.png -------------------------------------------------------------------------------- /Old (DEPRECATED)/photos/noob.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/Old (DEPRECATED)/photos/noob.PNG -------------------------------------------------------------------------------- /Old (DEPRECATED)/photos/save.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/Old (DEPRECATED)/photos/save.PNG -------------------------------------------------------------------------------- /Old (DEPRECATED)/photos/x264.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/Old (DEPRECATED)/photos/x264.PNG -------------------------------------------------------------------------------- /Old (DEPRECATED)/FrameGUI/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/Old (DEPRECATED)/FrameGUI/icon.ico -------------------------------------------------------------------------------- /Old (DEPRECATED)/photos/audio.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/Old (DEPRECATED)/photos/audio.PNG -------------------------------------------------------------------------------- /Old (DEPRECATED)/photos/avserr.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/Old (DEPRECATED)/photos/avserr.PNG -------------------------------------------------------------------------------- /Old (DEPRECATED)/photos/input.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/Old (DEPRECATED)/photos/input.PNG -------------------------------------------------------------------------------- /Old (DEPRECATED)/photos/frameGUI.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/Old (DEPRECATED)/photos/frameGUI.PNG -------------------------------------------------------------------------------- /Old (DEPRECATED)/photos/inputerr.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/Old (DEPRECATED)/photos/inputerr.PNG -------------------------------------------------------------------------------- /Old (DEPRECATED)/photos/progress.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/Old (DEPRECATED)/photos/progress.PNG -------------------------------------------------------------------------------- /Old (DEPRECATED)/photos/svpflow.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/Old (DEPRECATED)/photos/svpflow.PNG -------------------------------------------------------------------------------- /Old (DEPRECATED)/EncodeProg/bin/Debug/EncodeProg.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/Old (DEPRECATED)/EncodeProg/bin/Debug/EncodeProg.dll -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/bin/Debug/netstandard2.0/FFLoader.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaGooseYT/FrameGUI/HEAD/Old (DEPRECATED)/FFLoader/bin/Debug/netstandard2.0/FFLoader.dll -------------------------------------------------------------------------------- /New/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "framegui.hpp" 2 | #include 3 | 4 | int main(int argc, char *argv[]) { 5 | QApplication a(argc, argv); 6 | FrameGUI *w = new FrameGUI(); 7 | w->show(); 8 | return(a.exec()); 9 | } 10 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "FFLoader": { 4 | "commandName": "Executable", 5 | "executablePath": "C:\\Users\\Garrett Aderholdt\\source\\repos\\FrameGUI\\bin\\x64\\Release\\FrameGUI.exe" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | false 5 | 6 | -------------------------------------------------------------------------------- /New/assets/FrameGUI.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | discord_logo.png 4 | ig_logo.png 5 | patreon_logo.png 6 | pp_donate.png 7 | yt_logo.png 8 | FrameGUI.png 9 | icon.ico 10 | 11 | 12 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/FFLoaderException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace FFLoader 3 | { 4 | [Serializable] 5 | public class FFLoaderException : Exception 6 | { 7 | public FFLoaderException() : base() { } 8 | 9 | /// 10 | /// FFLoaderException that inherits Exception. 11 | /// 12 | /// The exception message. 13 | public FFLoaderException(string exMessage) : base(exMessage) { } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Arguments/MapArgs.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | 3 | namespace FFLoader.Arguments 4 | { 5 | internal class MapArgs 6 | { 7 | /// 8 | /// Maps the input video and input audio to make a single media file. 9 | /// 10 | /// String representation of the argument. 11 | internal static string MapVideo() 12 | { 13 | return string.Format(" -map 0:v -map 1:a?", CultureInfo.InvariantCulture); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /New/include/audioinfo.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef AUDIOINFO_H 4 | #define AUDIOINFO_H 5 | 6 | #include 7 | 8 | class AudioInfo { 9 | public: 10 | static void setCodec(QString codec); 11 | static void setStream(QString stream); 12 | static QString getCodec(int index); 13 | static QString getStream(int index); 14 | static int totalStreams(); 15 | static void addStream(); 16 | static void clearAll(); 17 | 18 | private: 19 | static QStringList _codec; 20 | static QStringList _stream; 21 | static int _streams; 22 | }; 23 | 24 | #endif // !AUDIOINFO_H -------------------------------------------------------------------------------- /New/src/ui/update.cpp: -------------------------------------------------------------------------------- 1 | #include "update.hpp" 2 | 3 | Update::Update(QWidget* parent) : QDialog(parent) { 4 | _up = new Ui::Update(); 5 | _up->setupUi(this); 6 | } 7 | 8 | void Update::setText(QString text) { 9 | _up->textBrowser->insertPlainText(text + QString("\n")); 10 | } 11 | 12 | QPushButton *Update::getSkip() { 13 | return(_up->SkipBttn); 14 | } 15 | 16 | QPushButton *Update::getNow() { 17 | return(_up->UpdateBttn); 18 | } 19 | 20 | QPushButton *Update::getLater() { 21 | return(_up->RemindBttn); 22 | } 23 | 24 | Ui::Update *Update::getUpdate() { 25 | return(_up); 26 | } -------------------------------------------------------------------------------- /Old (DEPRECATED)/FrameGUI/FrameGUI.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ProjectFiles 5 | publish\ 6 | 7 | 8 | 9 | 10 | 11 | en-US 12 | false 13 | 14 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Arguments/TuneArgs.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | 3 | namespace FFLoader.Arguments 4 | { 5 | internal class TuneArgs 6 | { 7 | /// 8 | /// The selected output video tune. 9 | /// 10 | /// The tune in a string format. 11 | /// String representation of the argument. 12 | internal static string VideoTunes(string tune) 13 | { 14 | return string.Format($" -tune {tune}", CultureInfo.InvariantCulture); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Arguments/EncoderAppArgs.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | 3 | namespace FFLoader.Arguments 4 | { 5 | internal class EncoderAppArgs 6 | { 7 | /// 8 | /// Writes the encoder application to the metadata of the output video. 9 | /// 10 | /// The writing application in a string format. 11 | internal static string EncoderApp(string version) 12 | { 13 | return string.Format($@" -metadata:g encoding_tool=""{version}""", CultureInfo.InvariantCulture); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Arguments/SampleRateArgs.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | 3 | namespace FFLoader.Arguments 4 | { 5 | internal class SampleRateArgs 6 | { 7 | /// 8 | /// The selected output audio sample rate. 9 | /// 10 | /// The sample rate in a string format. 11 | /// String representation of the argument. 12 | internal static string SampleRate(string rate) 13 | { 14 | return string.Format($" -ar {rate}", CultureInfo.InvariantCulture); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /New/include/update.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef UPDATER 4 | #define UPDATER 5 | 6 | #include 7 | #include 8 | 9 | #ifdef Q_OS_WINDOWS 10 | #include "windows/ui_update.hpp" 11 | #endif 12 | #ifdef Q_OS_DARWIN 13 | #include "darwin/ui_update.hpp" 14 | #endif 15 | 16 | class Update : public QDialog { 17 | public: 18 | Update(QWidget *parent = Q_NULLPTR); 19 | void setText(QString text); 20 | 21 | Ui::Update *getUpdate(); 22 | QPushButton *getSkip(); 23 | QPushButton *getNow(); 24 | QPushButton *getLater(); 25 | 26 | private: 27 | Ui::Update *_up; 28 | }; 29 | 30 | #endif // !UPDATER -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Arguments/PresetArgs.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | 3 | namespace FFLoader.Arguments 4 | { 5 | internal class PresetArgs 6 | { 7 | /// 8 | /// The selected output video/cpu preset arguments. 9 | /// 10 | /// The output video/cpu preset in a string format. 11 | /// String representation of the argument. 12 | internal static string VideoPreset(string preset) 13 | { 14 | return string.Format($" -preset {preset}", CultureInfo.InvariantCulture); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /New/FrameGUI.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | 6 | 7 | 2023-10-29T09:35:08.0306047Z 8 | 9 | 10 | 2023-10-29T09:35:07.9837505Z 11 | 12 | -------------------------------------------------------------------------------- /New/include/processerrorregex.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef PROCESSERRORREGEX_H 4 | #define PROCESSERRORREGEX_H 5 | 6 | #include 7 | #include 8 | 9 | #include "processerror.hpp" 10 | 11 | class ProcessErrorRegex { 12 | public: 13 | static void errorRegex(QString output); 14 | static void clearBools(); 15 | 16 | private: 17 | enum GetError { 18 | Pipe = 0, 19 | Memory = 1, 20 | Queue = 2, 21 | Ncnn = 3 22 | }; 23 | 24 | static QList _indexerBool; 25 | static QList _indexerRegex; 26 | 27 | static void setupPatterns(); 28 | }; 29 | 30 | #endif // !PROCESSERRORREGEX_H -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Handlers/InfoFPSHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FFLoader 4 | { 5 | public class InfoFPSHandler : EventArgs 6 | { 7 | /// 8 | /// The input video fps from FFMpeg. 9 | /// 10 | public float InputFPS { get; private set; } 11 | 12 | /// 13 | /// Event handler for returning the input video fps from FFMpeg. 14 | /// 15 | /// The input video fps from FFMpeg. 16 | public InfoFPSHandler(float fps) 17 | { 18 | InputFPS = fps; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Handlers/FFMpegErrorHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FFLoader 4 | { 5 | public class FFMpegErrorHandler : EventArgs 6 | { 7 | /// 8 | /// The error message from FFMpeg console, if exists. 9 | /// 10 | public string ErrorMessage { get; private set; } 11 | 12 | /// 13 | /// The FFMpeg error event arguments. 14 | /// 15 | /// The FFMpeg error. 16 | public FFMpegErrorHandler(string message) 17 | { 18 | ErrorMessage = message; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /New/include/videoinfolist.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef VIDEOINFOLIST_H 4 | #define VIDEOINFOLIST_H 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | class VideoInfoList { 11 | public: 12 | static void setDuration(QTime duration); 13 | static void setFrameRate(QString frameRate); 14 | static QTime getDuration(int index); 15 | static QString getFrameRate(int index); 16 | static void removeDuration(int index); 17 | static void removeFrameRate(int index); 18 | static void clearAll(); 19 | 20 | private: 21 | static QList _duration; 22 | static QStringList _frameRate; 23 | }; 24 | 25 | #endif // !VIDEOINFOLIST_H -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Handlers/AviSynthErrorHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FFLoader 4 | { 5 | public class AviSynthErrorHandler : EventArgs 6 | { 7 | /// 8 | /// The message AviSynth+ throws if there is a problem. 9 | /// 10 | public string AviSynthErrorMessage { get; private set; } 11 | 12 | /// 13 | /// The AviSynth+ error arguments. 14 | /// 15 | /// The AviSynth+ error message in a string format. 16 | public AviSynthErrorHandler(string message) 17 | { 18 | AviSynthErrorMessage = message; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /New/include/progressinforegex.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef PROGRESSINFOREGEX_H 4 | #define PROGRESSINFOREGEX_H 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "progressinfo.hpp" 12 | 13 | class ProgressInfoRegex { 14 | public: 15 | static bool progressRegex(QString output, QTime totalDuration, int totalFrames, QElapsedTimer timer, QTime pause); 16 | 17 | private: 18 | enum GetInfo { 19 | Frame = 0, 20 | Fps = 1, 21 | Bitrate = 2, 22 | Time = 3 23 | }; 24 | 25 | static QList _indexer; 26 | 27 | static void setupPatterns(); 28 | }; 29 | 30 | #endif // !PROGRESSINFOREGEX_H -------------------------------------------------------------------------------- /New/include/subtitleinfo.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef SUBTITLEINFO_H 4 | #define SUBTITLEINFO_H 5 | 6 | #include 7 | #include 8 | 9 | class SubtitleInfo { 10 | public: 11 | static void setCodec(QString codec); 12 | static void setStream(QString stream); 13 | static void setChapter(bool chapter); 14 | static QString getStream(int index); 15 | static QString getCodec(int index); 16 | static bool getChapter(); 17 | static int totalStreams(); 18 | static void addStreams(); 19 | static void clearAll(); 20 | static bool isEmpty(); 21 | 22 | private: 23 | static QStringList _stream; 24 | static QStringList _codec; 25 | static int _streams; 26 | static bool _chapter; 27 | }; 28 | 29 | #endif // !SUBTITLEINFO_H -------------------------------------------------------------------------------- /New/include/processerror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef PROCESSERROR_H 4 | #define PROCESSERROR_H 5 | 6 | class ProcessError { 7 | public: 8 | static void setPipeError(bool pipeError); 9 | static void setVkMemoryError(bool vkMemoryError); 10 | static void setVkQueueError(bool vkQueueError); 11 | static void setNcnnError(bool ncnnError); 12 | static bool getPipeError(); 13 | static bool getVkMemoryError(); 14 | static bool getVkQueueError(); 15 | static bool getNcnnError(); 16 | static void clearAll(); 17 | static void setError(bool error); 18 | static bool error(); 19 | 20 | private: 21 | static bool _pipeError; 22 | static bool _vkMemoryError; 23 | static bool _vkQueueError; 24 | static bool _ncnnError; 25 | static bool _hasError; 26 | }; 27 | 28 | #endif // !PROCESSERROR_H -------------------------------------------------------------------------------- /Old (DEPRECATED)/FrameGUI/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace FrameGUI 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | SetProcessDPIAware(); 19 | Application.SetCompatibleTextRenderingDefault(false); 20 | Application.Run(new FrameGUI()); 21 | } 22 | 23 | [System.Runtime.InteropServices.DllImport("user32.dll")] 24 | private static extern bool SetProcessDPIAware(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /New/include/argument.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef ARGUMENT_H 4 | #define ARGUMENT_H 5 | 6 | #include 7 | 8 | class Argument { 9 | protected: 10 | static QString videoCodec(QString codec); 11 | static QString audioCodec(QString codec); 12 | static QString subtitleCodec(QString codec); 13 | static QString override(); 14 | static QString input(); 15 | static QString mapAll(QString type, QString s1); 16 | static QString metaData1(); 17 | static QString metaData2(QString str); 18 | static QString constantRateFactor(int crf); 19 | static QString videoResolution(int width, int height); 20 | static QString noAutoRotate(); 21 | static QString appleTag(); 22 | static QString vs(); 23 | 24 | #ifdef Q_OS_WINDOWS 25 | static QString vsPipe1(); 26 | static QString vsPipe2(); 27 | #endif 28 | }; 29 | 30 | #endif // !ARGUMENT_H -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | DaGoose 6 | DaGoose 7 | Converts media files using FFMpeg and AviSynth+. 8 | © 2021 DaGoose 9 | AnyCPU;x64 10 | 1.2.3 11 | 12 | 13 | 14 | x64 15 | 16 | 17 | 18 | x64 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Handlers/FFExceptionHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FFLoader 4 | { 5 | public class FFExceptionHandler : EventArgs 6 | { 7 | /// 8 | /// Gets the exception in a string format (ideal for message boxes). 9 | /// 10 | public string Message { get; private set; } 11 | 12 | /// 13 | /// The stack trace of the exception. 14 | /// 15 | public string StackTrace { get; private set; } 16 | 17 | /// 18 | /// The FFLoader exception arguments. 19 | /// 20 | /// The message of the exception in a string format. 21 | public FFExceptionHandler(string message) 22 | { 23 | Message = message; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /New/src/ui/msgbox.cpp: -------------------------------------------------------------------------------- 1 | #include "framegui.hpp" 2 | 3 | QMessageBox::StandardButton FrameGUI::msgBoxHelper(MessageType type, QString title, QString message, QMessageBox::StandardButton button1, QMessageBox::StandardButton button2, QMessageBox::StandardButton button3) { 4 | QMessageBox::StandardButton msg; 5 | 6 | switch (type) { 7 | case MessageType::Error: 8 | msg = QMessageBox::critical(this, title, message, button1 | button2 | button3); 9 | break; 10 | case MessageType::Warning: 11 | msg = QMessageBox::warning(this, title, message, button1 | button2 | button3); 12 | break; 13 | case MessageType::Info: 14 | msg = QMessageBox::information(this, title, message, button1 | button2 | button3); 15 | break; 16 | case MessageType::Question: 17 | msg = QMessageBox::question(this, title, message, button1 | button2 | button3); 18 | break; 19 | } 20 | 21 | return(msg); 22 | } -------------------------------------------------------------------------------- /New/include/videoinforegex.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef VIDEOINFOREGEX_H 4 | #define VIDEOINFOREGEX_H 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include "videoinfolist.hpp" 13 | #include "videoinfo.hpp" 14 | 15 | class VideoInfoRegex { 16 | public: 17 | static void durationBitrateRegex(QString output); 18 | static void videoInfoerRegex(QString output); 19 | 20 | static QString _durationLine; 21 | 22 | private: 23 | enum GetInfo { 24 | DurationBitrate = 0, 25 | VideoInfo = 1, 26 | Bitrate = 2, 27 | Duration = 3, 28 | Colors = 4, 29 | Fps = 5, 30 | Tbr = 6, 31 | Resolution = 7, 32 | PixFormat = 8, 33 | VideoInfoPart = 9, 34 | Codec = 10, 35 | Vk = 11 36 | }; 37 | 38 | static QList _indexer; 39 | 40 | static void setupPatterns(); 41 | }; 42 | 43 | #endif // !VIDEOINFOREGEX_H -------------------------------------------------------------------------------- /New/src/vs/srmd.cpp: -------------------------------------------------------------------------------- 1 | #include "vapoursynth.hpp" 2 | 3 | /// 4 | /// Enables SRMD super-resolution plugin. 5 | /// 6 | /// The upscaling rate factor. 7 | /// The amount of denoise to apply. 8 | /// The GPU id index to use. 9 | /// The number of GPU threads to use. 10 | /// Enables test time augmentation for better results. 11 | /// String representation of the argument. 12 | QString VapourSynth::srmd(int scale, int noise, int id, int thread, QString tta) { 13 | #ifdef Q_OS_WINDOWS 14 | return(QString("clip = core.srmdnv.SRMD(clip, scale=%1, noise=%2, gpu_id=%3, gpu_thread=%4, tta=%5)\n\n").arg(scale).arg(noise).arg(id).arg(thread).arg(tta)); 15 | #endif 16 | #ifdef Q_OS_DARWIN 17 | return(QString("clip = core.srmdnv.SRMD(clip, scale=%1, noise=%2, gpu_id=%3, gpu_thread=1, tta=%4)\n\n").arg(scale).arg(noise).arg(id).arg(tta)); 18 | #endif 19 | } -------------------------------------------------------------------------------- /New/include/audiosubinforegex.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef AUDIOSUBINFOREGEX_H 4 | #define AUDIOSUBINFOREGEX_H 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include "audioinfo.hpp" 13 | #include "subtitleinfo.hpp" 14 | 15 | class AudioSubInfoRegex { 16 | public: 17 | static void audioInfoRegex(QString output); 18 | static void subInfoRegex(QString output); 19 | 20 | private: 21 | enum GetInfo { 22 | Audio = 0, 23 | Subtitle = 1 24 | }; 25 | 26 | static QString _audioCodec; 27 | static QString _audioLanguage; 28 | static QString _sampleRate; 29 | static QString _channels; 30 | static QString _audioStreams; 31 | static QString _subCodec; 32 | static QString _subLanguage; 33 | static QString _subStreams; 34 | 35 | static QList _indexer; 36 | 37 | static void setupPattern(); 38 | }; 39 | 40 | #endif // !AUDIOSUBINFOREGEX_H -------------------------------------------------------------------------------- /New/src/process/processworker.cpp: -------------------------------------------------------------------------------- 1 | #include "ffloader.hpp" 2 | 3 | void ProcessWorker::newProcess(QProcess* process, QStringList arguments, QString program) { 4 | if (!arguments.isEmpty()) 5 | process->start(program, arguments); 6 | else 7 | process->start(program); 8 | } 9 | 10 | void ProcessWorker::pauseProcess(QProcess* process, bool pause) { 11 | if (pause) { 12 | #ifdef Q_OS_WINDOWS 13 | DebugActiveProcess(process->processId()); 14 | #endif 15 | #ifdef Q_OS_DARWIN 16 | kill(process->processId(), SIGSTOP); 17 | #endif 18 | } 19 | else { 20 | #ifdef Q_OS_WINDOWS 21 | DebugActiveProcessStop(process->processId()); 22 | #endif 23 | #ifdef Q_OS_DARWIN 24 | kill(process->processId(), SIGCONT); 25 | #endif 26 | } 27 | } 28 | 29 | void ProcessWorker::closeProcess(QProcess* process) { 30 | process->close(); 31 | } 32 | 33 | void ProcessWorker::killProcess(QProcess* process) { 34 | process->kill(); 35 | } 36 | 37 | void ProcessWorker::deconstruct(QProcess* process) { 38 | process->~QProcess(); 39 | } -------------------------------------------------------------------------------- /New/include/vapoursynth.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef VAPOURSYNTH_H 4 | #define VAPOURSYNTH_H 5 | 6 | #include 7 | 8 | class VapourSynth { 9 | protected: 10 | static QString rife(int multi, int id, int thread, QString tta, QString uhd, QString sc); 11 | static QString srmd(int scale, int noise, int id, int thread, QString tta); 12 | 13 | #ifdef Q_OS_WINDOWS 14 | static QString svpflow(int num, int den, int mode); 15 | #endif 16 | 17 | static QString rgb(QString matrix, QString transfer, QString primaries); 18 | static QString colorsInOut(QString format, QString matrix_in, QString transfer_in, QString primaries_in, QString matrix, QString transfer, QString primaries); 19 | static QString colorsOut(QString format, QString matrix, QString transfer, QString primaries); 20 | static QString scDetect(QString threshold); 21 | static QString plugin(QString path); 22 | static QString input(QString path, QString id); 23 | static QString include(); 24 | static QString concludeClip(); 25 | static QString newLine(); 26 | }; 27 | 28 | #endif // !VAPOURSYNTH_H -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Arguments/FrameArgs.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | 3 | namespace FFLoader.Arguments 4 | { 5 | internal class FrameArgs 6 | { 7 | /// 8 | /// The selected output video FPS arguments. 9 | /// 10 | /// The output video FPS in a double format. 11 | /// String representation of the argument. 12 | internal static string Fps(double fps) 13 | { 14 | return string.Format($@" -vf ""fps={fps}", CultureInfo.InvariantCulture); 15 | } 16 | 17 | /// 18 | /// The selected output video consecutive b-frames arguments. 19 | /// 20 | /// The output video consecutive b-frames in a double format. 21 | /// String representation of the argument. 22 | internal static string BFrame(double bframe) 23 | { 24 | return string.Format($" -bf {bframe}", CultureInfo.InvariantCulture); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /New/src/vs/rife.cpp: -------------------------------------------------------------------------------- 1 | #include "vapoursynth.hpp" 2 | 3 | /// 4 | /// Configures RIFE in it's NCNN implementation. 5 | /// 6 | /// Sets the GPU id index to use. 7 | /// Sets the number of GPU threads to use. 8 | /// Enables test time augmentation for better interpolation quality. 9 | /// Enables or disabled UHD mode for better frame rendering. 10 | /// Enables or disables scene change detection. 11 | /// String representation of the argument. 12 | QString VapourSynth::rife(int multi, int id, int thread, QString tta, QString uhd, QString sc) { 13 | #ifdef Q_OS_WINDOWS 14 | return(QString("clip = core.rife.RIFE(clip, model=0, fps_num=%1, fps_den=1, gpu_id=%2, gpu_thread=%3, tta=%4, uhd=%5, sc=%6)\n\n").arg(multi).arg(id).arg(thread).arg(tta).arg(uhd).arg(sc)); 15 | #endif 16 | #ifdef Q_OS_DARWIN 17 | return(QString("clip = core.rife.RIFE(clip, fps_num=%1, fps_den=1, gpu_id=%2, gpu_thread=1, tta=%3, uhd=%4, sc=%5)\n\n").arg(multi).arg(id).arg(tta).arg(uhd).arg(sc)); 18 | #endif 19 | } -------------------------------------------------------------------------------- /New/include/checks.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef CHECKS_H 4 | #define CHECKS_H 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // video 11 | #define AVC 0 12 | #define HEVC 1 13 | #define PRORES 2 14 | #define THEORA 3 15 | #define VP9 4 16 | #define VC1 5 17 | #define MPEG2 6 18 | #define MPEG4 7 19 | 20 | // audio 21 | #define AAC 0 22 | #define MP3 1 23 | #define AC3 2 24 | #define FLAC 3 25 | #define VORBIS 4 26 | #define OPUS 5 27 | #define DTS 6 28 | #define TRUEHD 7 29 | #define EAC3 8 30 | #define ALAC 9 31 | #define WMA 10 32 | #define PCM 11 33 | #define MP2 12 34 | 35 | class Checks { 36 | public: 37 | static bool checkVsScript(QString path); 38 | static bool checkInputExists(QString path); 39 | static bool checkInput(QString path); 40 | static bool checkOutput(QString path); 41 | static bool checkOutputOverwrite(QString path); 42 | static bool checkAudioCompatability(int format, QString container); 43 | static bool checkSubtitleCompatability(QString format, QString container); 44 | static bool fileCheck(QString path); 45 | }; 46 | 47 | #endif // !CHECKS_H -------------------------------------------------------------------------------- /New/FrameGUI.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32922.545 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FrameGUI", "FrameGUI.vcxproj", "{BFB1F5DA-BCC6-4569-B623-4C9B29D7F584}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {BFB1F5DA-BCC6-4569-B623-4C9B29D7F584}.Debug|x64.ActiveCfg = Debug|x64 15 | {BFB1F5DA-BCC6-4569-B623-4C9B29D7F584}.Debug|x64.Build.0 = Debug|x64 16 | {BFB1F5DA-BCC6-4569-B623-4C9B29D7F584}.Release|x64.ActiveCfg = Release|x64 17 | {BFB1F5DA-BCC6-4569-B623-4C9B29D7F584}.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {4645DA9B-B9E7-4FD2-85DA-7EA080AFB623} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /New/include/mediaconfig.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef MEDIACONFIG_H 4 | #define MEDIACONFIG_H 5 | 6 | #include 7 | #include "argument.hpp" 8 | 9 | class MediaConfig : protected Argument { 10 | public: 11 | static QStringList getArguments(); 12 | static void append(QString string); 13 | static void setVideoCodec(QString codec); 14 | static void setAudioCodec(QString codec); 15 | static void setSubtitleCodec(QString codec); 16 | static void setMapAll(QString type, QString s1); 17 | static void setConstantRateFactor(int crf); 18 | static void setVideoResolution(int width, int height); 19 | static void setMetaData1(); 20 | static void setMetaData2(QString str); 21 | static void setNoAutoRotate(); 22 | static void setOverride(); 23 | static void setInput(); 24 | static void setOutput(QString path); 25 | static void setAppleTag(); 26 | static void setVs(); 27 | static void resetArguments(); 28 | 29 | #ifdef Q_OS_WINDOWS 30 | static void setVsPipe1(); 31 | static void setVsPipe2(); 32 | #endif 33 | 34 | private: 35 | static QStringList _argumentList; 36 | 37 | static QStringList splitSpace(QString args); 38 | }; 39 | 40 | #endif // !MEDIACONFIG_H -------------------------------------------------------------------------------- /New/include/progressinfo.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef PROGRESSINFO_H 4 | #define PROGRESSINFO_H 5 | 6 | #include 7 | #include 8 | 9 | class ProgressInfo { 10 | public: 11 | static void setTimeLeft(QTime timeLeft); 12 | static void setTimeElapsed(QTime timeElapsed); 13 | static void setProcessedFrames(int processedFrames); 14 | static void setTotalFrames(int totalFrames); 15 | static void setTime(QTime time); 16 | static void setFps(QString fps); 17 | static void setBitrate(QString bitrate); 18 | static void setPercentage(double percentage); 19 | static QTime getTimeLeft(); 20 | static QTime getTimeElapsed(); 21 | static int getProcessedFrames(); 22 | static int getTotalFrames(); 23 | static QTime getTime(); 24 | static QString getFps(); 25 | static QString getBitrate(); 26 | static double getPercentage(); 27 | static void clearAll(); 28 | 29 | private: 30 | static QTime _timeLeft; 31 | static QTime _timeElapsed; 32 | static int _processedFrames; 33 | static int _totalFrames; 34 | static QTime _time; 35 | static QString _fps; 36 | static QString _bitrate; 37 | static double _percentage; 38 | }; 39 | 40 | #endif // !PROGRESSINFO_H -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30804.86 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FFLoader", "FFLoader.csproj", "{81586B50-1D4E-4165-85BF-AA62E5E68C31}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {81586B50-1D4E-4165-85BF-AA62E5E68C31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {81586B50-1D4E-4165-85BF-AA62E5E68C31}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {81586B50-1D4E-4165-85BF-AA62E5E68C31}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {81586B50-1D4E-4165-85BF-AA62E5E68C31}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {9B808C23-4F36-47E9-BB8C-8008F9811F5C} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Arguments/SharpenArgs.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | 3 | namespace FFLoader.Arguments 4 | { 5 | internal class SharpenArgs 6 | { 7 | /// 8 | /// The selected output video sharpening level. 9 | /// 10 | /// The sharpening strength. 11 | /// Determins if resultion is also being changed for the purposes of correct formatting; bool format. 12 | /// String representation of the argument. 13 | internal static string SharpenResEnabled(float sharpen, bool resEnabeled, bool fps) 14 | { 15 | string sh = sharpen.ToString(); 16 | 17 | if (sharpen.ToString().Contains(",")) 18 | { 19 | sh = sh.Replace(",", "."); 20 | } 21 | 22 | if (resEnabeled || fps) 23 | { 24 | return string.Format($@" , unsharp=5:5:{sh}""", CultureInfo.InvariantCulture); 25 | } 26 | else 27 | { 28 | return string.Format($@" -vf unsharp=5:5:{sh}", CultureInfo.InvariantCulture); 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /New/include/scriptbuilder.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef SCRIPTBUILDER_H 4 | #define SCRIPTBUILDER_H 5 | 6 | #include 7 | 8 | #include "vapoursynth.hpp" 9 | 10 | class ScriptBuilder : protected VapourSynth { 11 | public: 12 | static QString getScript(); 13 | static void setRIFE(int multi, int id, int thread, QString tta, QString uhd, QString sc); 14 | static void setSRMD(int scale, int noise, int id, int thread, QString tta); 15 | static void setRGB(QString matrix, QString transfer, QString primaries); 16 | 17 | #ifdef Q_OS_WINDOWS 18 | static void setSVPFlow(int num, int den, int mode); 19 | #endif 20 | 21 | static void setColorsInOut(QString format, QString matrix_in, QString transfer_in, QString primaries_in, QString matrix, QString transfer, QString primaries); 22 | static void setColorsOut(QString format, QString matrix, QString transfer, QString primaries); 23 | static void setSCDetect(QString threshold); 24 | static void setPlugin(QString path); 25 | static void setInput(QString path, QString id); 26 | static void setInclude(); 27 | static void setConcludeClip(); 28 | static void setNewLine(); 29 | static void clearScript(); 30 | 31 | private: 32 | static QString _scriptList; 33 | }; 34 | 35 | #endif // !SCRIPTBUILDER_H -------------------------------------------------------------------------------- /Old (DEPRECATED)/EncodeProg/ProgressBarLabel.Designer.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace EncodeProg 4 | { 5 | public partial class ProgressBarLabel : ProgressBar 6 | { 7 | /// 8 | /// Required designer variable. 9 | /// 10 | private System.ComponentModel.IContainer components = null; 11 | 12 | /// 13 | /// Clean up any resources being used. 14 | /// 15 | /// true if managed resources should be disposed; otherwise, false. 16 | protected override void Dispose(bool disposing) 17 | { 18 | if (disposing && (components != null)) 19 | { 20 | components.Dispose(); 21 | } 22 | base.Dispose(disposing); 23 | } 24 | 25 | #region Component Designer generated code 26 | 27 | /// 28 | /// Required method for Designer support - do not modify 29 | /// the contents of this method with the code editor. 30 | /// 31 | private void InitializeComponent() 32 | { 33 | components = new System.ComponentModel.Container(); 34 | } 35 | 36 | #endregion 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /New/include/videoinfo.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef VIDEOINFO_H 4 | #define VIDEOINFO_H 5 | 6 | #include 7 | #include 8 | 9 | class VideoInfo { 10 | public: 11 | static void setVideoCodec(QString videoCodec); 12 | static void setDuration(QTime duration); 13 | static void setDurationStrng(QString duration); 14 | static void setWidth(int width); 15 | static void setHeight(int height); 16 | static void setColors(QString colors); 17 | static void setMatrix(QString matrix); 18 | static void setTransfer(QString transfer); 19 | static void setPrimaries(QString primaries); 20 | static void setFrameRate(QString frameRate); 21 | static QString getVideoCodec(); 22 | static QTime getDuration(); 23 | static QString getDurationStrng(); 24 | static int getWidth(); 25 | static int getHeight(); 26 | static QString getColors(); 27 | static QString getMatrix(); 28 | static QString getTransfer(); 29 | static QString getPrimaries(); 30 | static QString getFrameRate(); 31 | 32 | static void clearAll(); 33 | 34 | private: 35 | static int _width; 36 | static int _height; 37 | static QTime _duration; 38 | static QString _videoCodec; 39 | static QString _durationStrng; 40 | static QString _colors; 41 | static QString _matrix; 42 | static QString _transfer; 43 | static QString _primaries; 44 | static QString _frameRate; 45 | }; 46 | 47 | #endif // !VIDEOINFO_H -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Arguments/CodecArgs.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | 3 | namespace FFLoader.Arguments 4 | { 5 | internal class CodecArgs 6 | { 7 | /// 8 | /// The selected output video codec. 9 | /// 10 | /// The output video codec represented in a string format. 11 | /// String representation of the argument. 12 | internal static string VideoCodecs(string vCodec) 13 | { 14 | return string.Format($" -c:v {vCodec}", CultureInfo.InvariantCulture); 15 | } 16 | 17 | /// 18 | /// The selected output audio codec. 19 | /// 20 | /// The output audio codec represented in a string format. 21 | /// String representation of the argument. 22 | internal static string AudioCodecs(string aCodec) 23 | { 24 | if (aCodec == "aac") 25 | { 26 | return string.Format($" -c:a {aCodec}", CultureInfo.InvariantCulture); //Native FFMpeg AAC encoder (it sucks; will find better alternative soon). 27 | } 28 | else 29 | { 30 | return string.Format($" -c:a lib{aCodec}lame", CultureInfo.InvariantCulture); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /New/src/vs/svpflow.cpp: -------------------------------------------------------------------------------- 1 | #include "vapoursynth.hpp" 2 | 3 | #ifdef Q_OS_WINDOWS 4 | /// 5 | /// Configures SVPFlow for if you don't know how to write the parameters. 6 | /// 7 | /// The frame rate numerator. 8 | /// The frame rate denominator. 9 | /// /// The frame interpolation mode to use. 10 | /// String representation of the script. 11 | QString VapourSynth::svpflow(int num, int den, int mode) { 12 | QString super(QString("{scale:{up:2},gpu:0}")); 13 | QString analyse(QString("{gpu:0,main:{search:{coarse:{distance:0},type:4}},refine:[{thsad:250}]}")); 14 | QString smooth(QString("{rate:{num:%1,den:%2,abs:true},algo:13,mask:{area:0},scene:{mode:%3,blend:false}}").arg(num).arg(den).arg(mode)); 15 | 16 | QString complete(QString("super_params=\"%1\"\n").arg(super) + 17 | QString("analyse_params=\"%1\"\n").arg(analyse) + 18 | QString("smoothfps_params=\"%1\"\n\n").arg(smooth) + 19 | QString("super = core.svp1.Super(clip, super_params)\n") + 20 | QString("vectors = core.svp1.Analyse(super[\"clip\"], super[\"data\"], clip, analyse_params)\n") + 21 | QString("clip = core.svp2.SmoothFps(clip, super[\"clip\"], super[\"data\"], vectors[\"clip\"], vectors[\"data\"], smoothfps_params)\n") + 22 | QString("clip = core.std.AssumeFPS(clip, fpsnum=%1, fpsden=%2)\n\n").arg(num).arg(den)); 23 | 24 | return(complete); 25 | } 26 | #endif -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Arguments/ResolutionArgs.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | 3 | namespace FFLoader.Arguments 4 | { 5 | internal class ResolutionArgs 6 | { 7 | /// 8 | /// The selected output video resolution. 9 | /// 10 | /// The height of the video in pixels in double format. 11 | /// The width of the video in pixels in double format. 12 | /// String representation of the argument. 13 | internal static string VideoResolution(double height, double width, bool fps) 14 | { 15 | if (fps) 16 | { 17 | return string.Format($@" , scale={width}:{height}", CultureInfo.InvariantCulture); 18 | } 19 | else 20 | { 21 | return string.Format($@" -vf ""scale={width}:{height}", CultureInfo.InvariantCulture); 22 | } 23 | } 24 | 25 | /// 26 | /// The selected output video scale resize algorithm. 27 | /// 28 | /// The algorithm to use in a string format. 29 | /// String representation of the argument. 30 | internal static string VideoResizeAlgo(string algo) 31 | { 32 | return string.Format($":flags={algo.ToLower()}", CultureInfo.InvariantCulture); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/FrameGUI/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("FrameGUI")] 8 | [assembly: AssemblyDescription("Media encoder utilizing FFMpeg and AviSynth+")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("DaGoose")] 11 | [assembly: AssemblyProduct("FrameGUI")] 12 | [assembly: AssemblyCopyright("Copyright © 2021")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("678ea14b-ee0e-4be5-9de8-2a11d51cc714")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.2.3")] 35 | [assembly: AssemblyFileVersion("1.2.3")] 36 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/EncodeProg/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("EncodeProg")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("EncodeProg")] 13 | [assembly: AssemblyCopyright("Copyright © 2021 DaGoose")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("ed40b686-1396-4d0c-a72e-6a65aab3681d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.1.0")] 36 | [assembly: AssemblyFileVersion("1.0.1.0")] 37 | -------------------------------------------------------------------------------- /New/src/io/audioinfo.cpp: -------------------------------------------------------------------------------- 1 | #include "audioinfo.hpp" 2 | 3 | QStringList AudioInfo::_codec; 4 | QStringList AudioInfo::_stream; 5 | int AudioInfo::_streams; 6 | 7 | /// 8 | /// Adds the audio codec to the audio info list. 9 | /// 10 | /// The audio codec. 11 | void AudioInfo::setCodec(QString codec) { 12 | _codec << codec; 13 | } 14 | 15 | /// 16 | /// Adds the audio strream number to the audio info list. 17 | /// 18 | /// The audio stream number. 19 | void AudioInfo::setStream(QString stream) { 20 | _stream << stream; 21 | } 22 | 23 | /// 24 | /// Gets the audio codec from the audio info list. 25 | /// 26 | /// The index to get from the list. 27 | /// The audio codec. 28 | QString AudioInfo::getCodec(int index) { 29 | return(_codec.at(index)); 30 | } 31 | 32 | /// 33 | /// Gets the audio stream identifier from the audio info list. 34 | /// 35 | /// The index to get from the list. 36 | /// 37 | QString AudioInfo::getStream(int index) { 38 | return(_stream.at(index)); 39 | } 40 | 41 | /// 42 | /// Gets the total number of audio streams counted. 43 | /// 44 | /// The total number of streams. 45 | int AudioInfo::totalStreams() { 46 | return(_streams); 47 | } 48 | 49 | /// 50 | /// Adds an audio stream to info. 51 | /// 52 | void AudioInfo::addStream() { 53 | _streams++; 54 | } 55 | 56 | /// 57 | /// Resets all private variables. 58 | /// 59 | void AudioInfo::clearAll() { 60 | _codec.clear(); 61 | _stream.clear(); 62 | _streams = 0; 63 | } -------------------------------------------------------------------------------- /New/src/io/videoinfolist.cpp: -------------------------------------------------------------------------------- 1 | #include "videoinfolist.hpp" 2 | 3 | QList VideoInfoList::_duration; 4 | QStringList VideoInfoList::_frameRate; 5 | 6 | /// 7 | /// Sets the total duration. 8 | /// 9 | /// The duration. 10 | void VideoInfoList::setDuration(QTime duration) { 11 | _duration << duration; 12 | } 13 | 14 | /// 15 | /// Sets the frame rate. 16 | /// 17 | /// The frame rate. 18 | void VideoInfoList::setFrameRate(QString frameRate) { 19 | _frameRate << frameRate; 20 | } 21 | 22 | /// 23 | /// Gets the duration from the video list. 24 | /// 25 | /// The index to get. 26 | /// The duration. 27 | QTime VideoInfoList::getDuration(int index) { 28 | return(_duration.at(index)); 29 | } 30 | 31 | /// 32 | /// Gets the frame rate from the video list. 33 | /// 34 | /// The index to get. 35 | /// The frame rate. 36 | QString VideoInfoList::getFrameRate(int index) { 37 | return(_frameRate.at(index)); 38 | } 39 | 40 | /// 41 | /// Removes a duration from the video list. 42 | /// 43 | /// The index to remove. 44 | void VideoInfoList::removeDuration(int index) { 45 | _duration.removeAt(index); 46 | } 47 | 48 | /// 49 | /// The frame rate to remove at an index in the video list. 50 | /// 51 | /// The index to remove. 52 | void VideoInfoList::removeFrameRate(int index) { 53 | _frameRate.removeAt(index); 54 | } 55 | 56 | /// 57 | /// Resets all private variables. 58 | /// 59 | void VideoInfoList::clearAll() { 60 | _duration.clear(); 61 | _frameRate.clear(); 62 | } -------------------------------------------------------------------------------- /New/src/checks/files.cpp: -------------------------------------------------------------------------------- 1 | #include "checks.hpp" 2 | 3 | /// 4 | /// Ensures the path to the VapourSynth script exists. 5 | /// 6 | /// The file path. 7 | /// True or false. 8 | bool Checks::checkVsScript(QString path) { 9 | return(fileCheck(path)); 10 | } 11 | 12 | /// 13 | /// Ensures the path to the source video exists. 14 | /// 15 | /// The file path. 16 | /// True or false. 17 | bool Checks::checkInputExists(QString path) { 18 | return(fileCheck(path)); 19 | } 20 | 21 | /// 22 | /// Ensures the source video is defined. 23 | /// 24 | /// The file path. 25 | /// True or false. 26 | bool Checks::checkInput(QString input) { 27 | if (!input.isEmpty()) { 28 | return(true); 29 | } 30 | else { 31 | return(false); 32 | } 33 | } 34 | 35 | /// 36 | /// Ensures the output video path is defined. 37 | /// 38 | /// The file path. 39 | /// True or false. 40 | bool Checks::checkOutput(QString output) { 41 | if (!output.isEmpty()) 42 | return(true); 43 | else 44 | return(false); 45 | } 46 | 47 | /// 48 | /// Checks to see if the output path already exists. 49 | /// 50 | /// The file path. 51 | /// True or false. 52 | bool Checks::checkOutputOverwrite(QString path) { 53 | return(fileCheck(path)); 54 | } 55 | 56 | /// 57 | /// Checks a file to see if it exists. 58 | /// 59 | /// The file path. 60 | /// True or false. 61 | bool Checks::fileCheck(QString path) { 62 | if (QFile::exists(path)) 63 | return(true); 64 | else 65 | return(false); 66 | } -------------------------------------------------------------------------------- /New/include/ffloader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef FFLOADER_H 4 | #define FFLOADER_H 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "audiosubinforegex.hpp" 12 | #include "processerrorregex.hpp" 13 | #include "progressinforegex.hpp" 14 | #include "videoinforegex.hpp" 15 | #include "videoinfolist.hpp" 16 | 17 | #ifdef Q_OS_WINDOWS 18 | #include "windows.h" 19 | #endif 20 | 21 | #ifdef Q_OS_DARWIN 22 | #include "signal.h" 23 | #endif 24 | 25 | enum class ProcessType { 26 | Encode, 27 | VideoInfo, 28 | VideoFinish, 29 | EncodeFinish, 30 | VS 31 | }; 32 | 33 | class ProcessWorker : public QObject { 34 | public: 35 | void newProcess(QProcess *process, QStringList arguments, QString program); 36 | void pauseProcess(QProcess *process, bool pause); 37 | void closeProcess(QProcess *process); 38 | void killProcess(QProcess *process); 39 | void deconstruct(QProcess *process); 40 | 41 | QProcess *_video, *_encode, *_vs, *_vk; 42 | int _currentJob; 43 | }; 44 | 45 | class FFLoader : public ProcessWorker { 46 | Q_OBJECT; 47 | 48 | public: 49 | void encode(QStringList args, QStringList vsArgs, QString ffmpeg, QString vsPipe); 50 | void videoInfo(QStringList args, QString ffprobe); 51 | void connector(QProcess *process, ProcessType type); 52 | void disconnecter(QProcess *process, ProcessType type); 53 | void finisher(QProcess *process, ProcessType type); 54 | void outputData(QProcess *process, ProcessType type); 55 | void outputDataVideo(); 56 | void outputDataInfo(); 57 | void outputDataVS(); 58 | void videoFinished(); 59 | void encodeFinished(); 60 | 61 | QElapsedTimer *_timer; 62 | QTime *_pauseTime; 63 | 64 | signals: 65 | void setVideoInfo(); 66 | void setProgress(); 67 | void completed(); 68 | void logs(QString); 69 | }; 70 | 71 | #endif // !FFLOADER_H -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Arguments/BitrateArgs.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | 3 | namespace FFLoader.Arguments 4 | { 5 | internal class BitrateArgs 6 | { 7 | /// 8 | /// The selected output video bitrate arguments. 9 | /// 10 | /// The bitrate of the output video in a double format. 11 | /// String representation of the argument. 12 | internal static string VideoBitrate(double bitrate) 13 | { 14 | return string.Format($" -b:v {bitrate}k", CultureInfo.InvariantCulture); 15 | } 16 | 17 | /// 18 | /// Copies the output video bitrate from the input video bitrate if vBitrate == 0. 19 | /// 20 | /// String representation of the argument. 21 | internal static string VideoBitrateCopy() 22 | { 23 | return string.Format(" -b:v copy", CultureInfo.InvariantCulture); 24 | } 25 | 26 | /// 27 | /// The selected output audio bitrate arguments. 28 | /// 29 | /// The bitrate of the output audio in a string format. 30 | /// String representation of the argument. 31 | internal static string AudioBitrate(string bitrate) 32 | { 33 | return string.Format($" -b:a {bitrate}k", CultureInfo.InvariantCulture); 34 | } 35 | 36 | /// 37 | /// The constant rate factor value of the output video. 38 | /// 39 | /// The constant rate factor value. 40 | /// String representation of the argument. 41 | internal static string RateFactor(double crf) 42 | { 43 | return string.Format($" -crf {crf}", CultureInfo.InvariantCulture); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /New/src/process/scriptbuilder.cpp: -------------------------------------------------------------------------------- 1 | #include "scriptbuilder.hpp" 2 | 3 | QString ScriptBuilder::_scriptList; 4 | 5 | void ScriptBuilder::setRIFE(int multi, int id, int thread, QString tta, QString uhd, QString sc) { 6 | _scriptList.append(VapourSynth::rife(multi, id, thread, tta, uhd, sc)); 7 | } 8 | 9 | void ScriptBuilder::setSRMD(int scale, int noise, int id, int thread, QString tta) { 10 | _scriptList.append(VapourSynth::srmd(scale, noise, id, thread, tta)); 11 | } 12 | 13 | void ScriptBuilder::setRGB(QString matrix, QString transfer, QString primaries) { 14 | _scriptList.append(VapourSynth::rgb(matrix, transfer, primaries)); 15 | } 16 | 17 | #ifdef Q_OS_WINDOWS 18 | void ScriptBuilder::setSVPFlow(int num, int den, int mode) { 19 | _scriptList.append(VapourSynth::svpflow(num, den, mode)); 20 | } 21 | #endif 22 | 23 | void ScriptBuilder::setColorsInOut(QString format, QString matrix_in, QString transfer_in, QString primaries_in, QString matrix, QString transfer, QString primaries) { 24 | _scriptList.append(VapourSynth::colorsInOut(format, matrix_in, transfer_in, primaries_in, matrix, transfer, primaries)); 25 | } 26 | 27 | void ScriptBuilder::setColorsOut(QString format, QString matrix, QString transfer, QString primaries) { 28 | _scriptList.append(VapourSynth::colorsOut(format, matrix, transfer, primaries)); 29 | } 30 | 31 | void ScriptBuilder::setSCDetect(QString threshold) { 32 | _scriptList.append(VapourSynth::scDetect(threshold)); 33 | } 34 | 35 | void ScriptBuilder::setPlugin(QString path) { 36 | _scriptList.append(VapourSynth::plugin(path)); 37 | } 38 | 39 | void ScriptBuilder::setInput(QString path, QString id) { 40 | _scriptList.append(VapourSynth::input(path, id)); 41 | } 42 | 43 | void ScriptBuilder::setInclude() { 44 | _scriptList.append(VapourSynth::include()); 45 | } 46 | 47 | void ScriptBuilder::setConcludeClip() { 48 | _scriptList.append(VapourSynth::concludeClip()); 49 | } 50 | 51 | void ScriptBuilder::setNewLine() { 52 | _scriptList.append(VapourSynth::newLine()); 53 | } 54 | 55 | void ScriptBuilder::clearScript() { 56 | _scriptList.clear(); 57 | } 58 | 59 | QString ScriptBuilder::getScript() { 60 | return(_scriptList); 61 | } -------------------------------------------------------------------------------- /New/fgui_darwin.pro: -------------------------------------------------------------------------------- 1 | QT += core widgets gui network 2 | TEMPLATE = app 3 | TARGET = FrameGUI 4 | DESTDIR = ./x64/Release 5 | CONFIG += ./x64/Release 6 | LIBS += -L"." 7 | DEPENDPATH += . 8 | INCLUDEPATH += ./include 9 | MOC_DIR += ./x64/Release 10 | OBJECTS_DIR += ./x64/Release 11 | RC_FILE = ./assets/FrameGUI.rc 12 | ICON = ./assets/icon.icns 13 | HEADERS += ./include/argument.hpp \ 14 | ./include/checks.hpp \ 15 | ./include/audioinfo.hpp \ 16 | ./include/processerror.hpp \ 17 | ./include/progressinfo.hpp \ 18 | ./include/subtitleinfo.hpp \ 19 | ./include/videoinfo.hpp \ 20 | ./include/videoinfolist.hpp \ 21 | ./include/mediaconfig.hpp \ 22 | ./include/scriptbuilder.hpp \ 23 | ./include/audiosubinforegex.hpp \ 24 | ./include/processerrorregex.hpp \ 25 | ./include/progressinforegex.hpp \ 26 | ./include/videoinforegex.hpp \ 27 | ./include/update.hpp \ 28 | ./include/vapoursynth.hpp \ 29 | ./include/framegui.hpp \ 30 | ./include/ffloader.hpp \ 31 | ./include/darwin/ui_framegui.hpp \ 32 | ./include/darwin/ui_update.hpp 33 | SOURCES += ./src/arguments/argument.cpp \ 34 | ./src/checks/files.cpp \ 35 | ./src/checks/process.cpp \ 36 | ./src/io/audioinfo.cpp \ 37 | ./src/io/processError.cpp \ 38 | ./src/io/progressinfo.cpp \ 39 | ./src/io/subtitleinfo.cpp \ 40 | ./src/io/videoinfo.cpp \ 41 | ./src/io/videoinfolist.cpp \ 42 | ./src/process/ffloader.cpp \ 43 | ./src/process/mediaconfig.cpp \ 44 | ./src/process/processworker.cpp \ 45 | ./src/process/scriptbuilder.cpp \ 46 | ./src/regex/audiosubinforegex.cpp \ 47 | ./src/regex/processerrorregex.cpp \ 48 | ./src/regex/progressinforegex.cpp \ 49 | ./src/regex/videoinforegex.cpp \ 50 | ./src/ui/config.cpp \ 51 | ./src/ui/enviornment.cpp \ 52 | ./src/ui/framegui.cpp \ 53 | ./src/ui/jobs.cpp \ 54 | ./src/ui/msgbox.cpp \ 55 | ./src/ui/script.cpp \ 56 | ./src/ui/settings.cpp \ 57 | ./src/ui/update.cpp \ 58 | ./src/vs/colors.cpp \ 59 | ./src/vs/rife.cpp \ 60 | ./src/vs/srmd.cpp \ 61 | ./src/vs/svpflow.cpp \ 62 | ./src/vs/vapoursynth.cpp \ 63 | ./src/main.cpp 64 | RESOURCES += ./assets/FrameGUI.qrc 65 | -------------------------------------------------------------------------------- /New/src/regex/processerrorregex.cpp: -------------------------------------------------------------------------------- 1 | #include "processerrorregex.hpp" 2 | 3 | QList ProcessErrorRegex::_indexerBool; 4 | QList ProcessErrorRegex::_indexerRegex; 5 | 6 | void ProcessErrorRegex::setupPatterns() { 7 | _indexerRegex << QRegularExpression(QString("pipe::\\sInvalid\\sdata\\sfound\\swhen\\sprocessing\\sinput")); 8 | _indexerRegex << QRegularExpression(QString("vkAllocateMemory\\sfailed")); 9 | _indexerRegex << QRegularExpression(QString("vkQueueSubmit\\sfailed")); 10 | _indexerRegex << QRegularExpression(QString("The\\sfile\\syou\\stried\\sto\\sload\\sor\\sone\\sof\\sits\\sdependencies\\sis\\sprobably\\smissing\\.")); 11 | } 12 | 13 | void ProcessErrorRegex::clearBools() { 14 | _indexerBool.clear(); 15 | } 16 | 17 | void ProcessErrorRegex::errorRegex(QString output) { 18 | if (_indexerRegex.isEmpty()) 19 | setupPatterns(); 20 | 21 | if (_indexerBool.isEmpty()) 22 | for (int i = 0; i < _indexerRegex.count(); i++) 23 | _indexerBool << false; 24 | 25 | QRegularExpressionMatch matchPipeError(_indexerRegex.at(GetError::Pipe).match(output)); 26 | QRegularExpressionMatch matchVkMemoryError(_indexerRegex.at(GetError::Memory).match(output)); 27 | QRegularExpressionMatch matchVkQueueError(_indexerRegex.at(GetError::Queue).match(output)); 28 | QRegularExpressionMatch matchNcnnError(_indexerRegex.at(GetError::Ncnn).match(output)); 29 | 30 | if (matchPipeError.hasMatch()) 31 | _indexerBool.replace(GetError::Pipe, true); 32 | if (matchVkMemoryError.hasMatch()) 33 | _indexerBool.replace(GetError::Memory, true); 34 | if (matchVkQueueError.hasMatch()) 35 | _indexerBool.replace(GetError::Queue, true); 36 | if (matchNcnnError.hasMatch()) 37 | _indexerBool.replace(GetError::Ncnn, true); 38 | 39 | if (matchVkMemoryError.hasMatch() || matchVkQueueError.hasMatch() || matchNcnnError.hasMatch()) { 40 | 41 | #ifdef PROCESSERROR_H 42 | ProcessError::setVkMemoryError(_indexerBool.at(GetError::Memory)); 43 | ProcessError::setVkQueueError(_indexerBool.at(GetError::Queue)); 44 | ProcessError::setNcnnError(_indexerBool.at(GetError::Ncnn)); 45 | 46 | ProcessError::setError(true); 47 | #endif // PROCESSERROR_H 48 | } 49 | else if (matchPipeError.hasMatch()) { 50 | #ifdef PROCESSERROR_H 51 | ProcessError::setPipeError(_indexerBool.at(GetError::Pipe)); 52 | #endif // PROCESSERROR_H 53 | } 54 | } -------------------------------------------------------------------------------- /New/src/regex/audiosubinforegex.cpp: -------------------------------------------------------------------------------- 1 | #include "audiosubinforegex.hpp" 2 | 3 | QList AudioSubInfoRegex::_indexer; 4 | 5 | QString AudioSubInfoRegex::_audioCodec; 6 | QString AudioSubInfoRegex::_audioStreams; 7 | QString AudioSubInfoRegex::_subCodec; 8 | QString AudioSubInfoRegex::_subStreams; 9 | 10 | void AudioSubInfoRegex::setupPattern() { 11 | _indexer << QRegularExpression(QString("Stream\\s?#0:([0-9]?[0-9]?)\\[?[^\\]]*?\\]?\\(?(\\w*)\\)?:?\\[?[^\\]]*\\]?:\\s?Audio:\\s?(\\w*)[^,]*,?\\s?([^\\s]*)\\sHz,\\s?([^,]*),?")); 12 | _indexer << QRegularExpression(QString("Stream\\s?#0:([0-9]?[0-9]?)\\[?[^\\]]*?\\]?\\(?(\\w*)\\)?:?\\[?[^\\]]*\\]?:\\s?Subtitle:\\s?([^\\s]*)")); 13 | } 14 | 15 | void AudioSubInfoRegex::audioInfoRegex(QString output) { 16 | if (_indexer.isEmpty()) 17 | setupPattern(); 18 | 19 | QRegularExpressionMatch matchAudioInfo(_indexer.at(GetInfo::Audio).match(output)); 20 | 21 | if (!matchAudioInfo.hasMatch()) 22 | return; 23 | else { 24 | _audioCodec = matchAudioInfo.captured(3); 25 | _audioStreams = matchAudioInfo.captured(1); 26 | 27 | if (_audioCodec.contains(QString("vorbis"))) 28 | _audioCodec = QString("Vorbis"); 29 | else if (_audioCodec.contains(QString("pcm"))) 30 | _audioCodec = QString("PCM"); 31 | else if (_audioCodec.contains(QString("truehd"))) 32 | _audioCodec = QString("TrueHD"); 33 | else if (_audioCodec.contains(QString("opus"))) 34 | _audioCodec = QString("Opus"); 35 | else if (_audioCodec.isEmpty()) 36 | _audioCodec = QString("?"); 37 | else 38 | _audioCodec = _audioCodec.toUpper(); 39 | 40 | #ifdef AUDIOINFO_H 41 | AudioInfo::addStream(); 42 | AudioInfo::setCodec(_audioCodec); 43 | AudioInfo::setStream(_audioStreams); 44 | #endif // AUDIOINFO_H 45 | } 46 | } 47 | 48 | void AudioSubInfoRegex::subInfoRegex(QString output) { 49 | if (_indexer.isEmpty()) 50 | setupPattern(); 51 | 52 | QRegularExpressionMatch matchSubtitleInfo(_indexer.at(GetInfo::Subtitle).match(output)); 53 | 54 | if (!matchSubtitleInfo.hasMatch()) 55 | return; 56 | else { 57 | _subStreams = matchSubtitleInfo.captured(1); 58 | _subCodec = matchSubtitleInfo.captured(3); 59 | 60 | #ifdef SUBTITLEINFO_H 61 | SubtitleInfo::addStreams(); 62 | SubtitleInfo::setStream(_subStreams); 63 | SubtitleInfo::setCodec(_subCodec); 64 | #endif // SUBTITLEINFO_H 65 | } 66 | } -------------------------------------------------------------------------------- /New/src/io/subtitleinfo.cpp: -------------------------------------------------------------------------------- 1 | #include "subtitleinfo.hpp" 2 | 3 | QStringList SubtitleInfo::_stream; 4 | QStringList SubtitleInfo::_codec; 5 | int SubtitleInfo::_streams; 6 | bool SubtitleInfo::_chapter; 7 | 8 | /// 9 | /// Sets the subtitle codecs. 10 | /// 11 | /// The codec. 12 | void SubtitleInfo::setCodec(QString codec) { 13 | _codec << codec; 14 | } 15 | 16 | /// 17 | /// Sets the subtitle stream identifier. 18 | /// 19 | /// The stream identifier. 20 | void SubtitleInfo::setStream(QString stream) { 21 | _stream << stream; 22 | } 23 | 24 | /// 25 | /// Sets the chapters. 26 | /// 27 | /// True or false. 28 | void SubtitleInfo::setChapter(bool chapter) { 29 | _chapter = chapter; 30 | } 31 | 32 | /// 33 | /// Gets the subtitle codec from the the subtitle list. 34 | /// 35 | /// The index to get. 36 | /// The codec. 37 | QString SubtitleInfo::getCodec(int index) { 38 | return(_codec.at(index)); 39 | } 40 | 41 | /// 42 | /// Gets the stream identifier from the subtitle list. 43 | /// 44 | /// The index from the list. 45 | /// 46 | QString SubtitleInfo::getStream(int index) { 47 | return(_stream.at(index)); 48 | } 49 | 50 | /// 51 | /// Gets the chapters. 52 | /// 53 | /// True or false. 54 | bool SubtitleInfo::getChapter() { 55 | return(_chapter); 56 | } 57 | 58 | /// 59 | /// Adds a stream to the total. 60 | /// 61 | void SubtitleInfo::addStreams() { 62 | _streams++; 63 | } 64 | 65 | /// 66 | /// Gets the total number of streams. 67 | /// 68 | /// The total streams. 69 | int SubtitleInfo::totalStreams() { 70 | return(_streams); 71 | } 72 | 73 | /// 74 | /// Determines if subtitles exist. 75 | /// 76 | /// True or false. 77 | bool SubtitleInfo::isEmpty() { 78 | return(_codec.isEmpty()); 79 | } 80 | 81 | /// 82 | /// Resets all local variables. 83 | /// 84 | void SubtitleInfo::clearAll() { 85 | _stream.clear(); 86 | _codec.clear(); 87 | _streams = 0; 88 | _chapter = false; 89 | } -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Helpers/FileHelper.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace FFLoader.Helpers 4 | { 5 | internal partial class FFHelper 6 | { 7 | /// 8 | /// Checks to make sure the selected input video path is not null and exists in string "InputFile" 9 | /// 10 | internal static void InputFileNullOrMissing(string inputPath) 11 | { 12 | if (string.IsNullOrEmpty(inputPath)) 13 | { 14 | throw new FFLoaderException("Video input path is not defined in configuration"); 15 | } 16 | else if (!File.Exists(inputPath)) 17 | { 18 | throw new FFLoaderException("The selected input video in path: " + inputPath + " is missing or does not exist."); 19 | } 20 | } 21 | 22 | /// 23 | /// Checks to make sure that the .avs AviSynth+ script file exists. 24 | /// 25 | /// The path to the .avs AviSynth+ script file. 26 | internal static void AvsScriptFileNullOrMissing(string scriptPath) 27 | { 28 | if (!File.Exists(scriptPath)) 29 | { 30 | throw new FFLoaderException("The selected input AviSynth script in path: " + scriptPath + " is missing or does not exist"); 31 | } 32 | } 33 | 34 | /// 35 | /// Confirms that the file was created in the specified output path. 36 | /// 37 | internal static void OutputPathNullOrMissing(string outputPath) 38 | { 39 | if (string.IsNullOrEmpty(outputPath)) 40 | { 41 | throw new FFLoaderException("Output video path is not defined in configuration"); 42 | } 43 | } 44 | 45 | /// 46 | /// Determines if the output file has been made or not. 47 | /// 48 | /// The output video path. 49 | /// True or False. 50 | internal static bool OutputFileNotCreated(string outputPath) 51 | { 52 | if (!File.Exists(outputPath)) 53 | { 54 | return true; 55 | } 56 | else 57 | { 58 | return false; 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FrameGUI (NEW v2.0.0+) 2 |

3 | 4 | 5 |

6 | 7 | FrameGUI (frame-gooey) is a free, cross-platform, very easy to use encoding utility featuring AI filters, based on the more comprehensive [EncodeGUI](https://github.com/DaGooseYT/EncodeGUI) encoding tool.
8 | FrameGUI is now the first RIFE GUI app to run 100% natively on Apple Silicon. 9 | 10 | This repository only consists of the source code; no builds are hosted here. See https://encodegui.com/downloads for the latest builds. 11 | 12 | # Features 13 | Below is a list of key features in FrameGUI: 14 | - 100% native Apple Scilicon support for the FrameGUI app itself and ALL its dependencies. 15 | - Supports nearly any video as an input. 16 | - Extreamly lightweight with a total installation size of around 140MB (MacOS). 17 | - Advanced job queue with status indicators and an advanced control set. 18 | - Decluttered encoding settings layout allows you to start processes in as little as a few clicks. 19 | - Features RIFE v4.6 AI frame interpolation as the Convert FPS function. 20 | - Features SRMD super resolution AI upscaling. 21 | - AI filters can be used with ALL major GPU vendors: NVIDIA, AMD, INTEL (Intel iGPUs are not supported). 22 | - Features VapourSynth API for ALL included filters **which doesn't extract frames before rendering, allowing a faster render time than nearly all competing software.** 23 | 24 | # Usage 25 | Documentation including the basic usage guide can be found at https://encodegui.com/docs/documentation. 26 | 27 | # Support 28 | Support for issues and directions for how to submit a proper issue/bug report are available on https://encodegui.com/support.
29 | **No support is provided for legacy versions of FrameGUI (before v2.0.0).** 30 | 31 | # Compilation 32 | Requires `Qt 6.2.4 SDK` and MSVC. Install the Qt Visual Studio extension and compile using the built in Visual Studio tools. 33 | 34 | # License 35 | FrameGUI's source code is licensed under the AGPL v3.0. See LICENSE for more details. Early released versions of FrameGUI are licensed under a custom license. Read it at https://encodegui.com/privacy-terms. 36 | 37 | **The setup file for FrameGUI is closed source and is NOT a part of this repository or the AGPL license. Read the privacy and terms at EncodeGUI.com linked above for more details.** 38 | -------------------------------------------------------------------------------- /New/src/vs/colors.cpp: -------------------------------------------------------------------------------- 1 | #include "vapoursynth.hpp" 2 | 3 | /// 4 | /// Converts the video to the RGB color space. 5 | /// 6 | /// The input color matrix. 7 | /// The input color transfer. 8 | /// The input color primaries. 9 | /// String representation of the argument. 10 | QString VapourSynth::rgb(QString matrix, QString transfer, QString primaries) { 11 | return(QString("clip = core.resize.Lanczos(clip, format=vs.RGBS, matrix_in_s=\"%1\", transfer_in_s=\"%2\", primaries_in_s=\"%3\")\n\n").arg(matrix).arg(transfer).arg(primaries)); 12 | } 13 | 14 | /// 15 | /// Sets both the input and output color spaces. 16 | /// 17 | /// The pixel format to use. 18 | /// The input color matrix. 19 | /// The input color transfer. 20 | /// The input color primaries. 21 | /// The output color matrix. 22 | /// The output color transfer. 23 | /// The output color primaries. 24 | /// String representation of the argument. 25 | QString VapourSynth::colorsInOut(QString format, QString matrix_in, QString transfer_in, QString primaries_in, QString matrix, QString transfer, QString primaries) { 26 | return(QString("clip = core.resize.Lanczos(clip, format=vs.%1, matrix_s=\"%2\", transfer_s=\"%3\", primaries_s=\"%4\", matrix_in_s=\"%5\", transfer_in_s=\"%6\", primaries_in_s=\"%7\")\n\n") 27 | .arg(format).arg(matrix).arg(transfer).arg(primaries).arg(matrix_in).arg(transfer_in).arg(primaries_in)); 28 | } 29 | 30 | /// 31 | /// Sets the output color spaces, assuming the inputs have already been defined. 32 | /// 33 | /// The pixel format to use. 34 | /// The output color matrix. 35 | /// The output color transfer. 36 | /// The output color primaries. 37 | /// String representation of the argument. 38 | QString VapourSynth::colorsOut(QString format, QString matrix, QString transfer, QString primaries) { 39 | return(QString("clip = core.resize.Lanczos(clip, format=vs.%1, matrix_s=\"%2\", transfer_s=\"%3\", primaries_s=\"%4\")\n\n") 40 | .arg(format).arg(matrix).arg(transfer).arg(primaries)); 41 | } -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Helpers/ProcessHelper.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace FFLoader.Helpers 4 | { 5 | internal partial class FFHelper 6 | { 7 | /// 8 | /// Checks to make sure FFMpeg's path is not null and exists in string "FFMpegPath" 9 | /// 10 | internal static void FFMpegPathNullOrMissing(string ffmpegPath) 11 | { 12 | if (string.IsNullOrEmpty(ffmpegPath)) 13 | { 14 | throw new FFLoaderException("FFMpeg path is not defined in configuration"); 15 | } 16 | 17 | else if (!File.Exists(ffmpegPath)) 18 | { 19 | throw new FFLoaderException("ffmpeg.exe does not exist in the path: " + Path.GetDirectoryName(ffmpegPath) + "."); 20 | } 21 | } 22 | 23 | /// 24 | /// Checks to make sure AviSynth+ paths are not null or empty if used. 25 | /// 26 | /// The path to AviSynth.dll. 27 | /// The path to the AviSynth+ directory. 28 | /// 29 | internal static string AviSynthNullOrMissing(string avsdll, string avplusDirectory) 30 | { 31 | if (!File.Exists(avsdll) || !Directory.Exists(avplusDirectory)) 32 | { 33 | return "AviSynth+ is missing or wasn't installed properly. Check to make sure an antivirus or other program didn't remove the AviSynth+ files."; 34 | } 35 | else 36 | { 37 | return null; 38 | } 39 | } 40 | 41 | /// 42 | /// Checks to make sure that a process of the same type isn't already running. 43 | /// 44 | /// The name of the process. 45 | internal static void ProcessAlreadyRunning(string process) 46 | { 47 | throw new FFLoaderException(process.ToString() + " is still running. Please wait until its process is complete before starting a new one."); 48 | } 49 | 50 | /// 51 | /// Throws exception if a process isn't running and the user is trying to do a function related to it. 52 | /// 53 | internal static void NoProcessRunning() 54 | { 55 | throw new FFLoaderException("No process is running that can be stopped."); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /New/src/vs/vapoursynth.cpp: -------------------------------------------------------------------------------- 1 | #include "vapoursynth.hpp" 2 | 3 | /// 4 | /// Sets the VapourSynth plugins to use. 5 | /// 6 | QString VapourSynth::plugin(QString path) { 7 | #ifdef Q_OS_WINDOWS 8 | return(QString("core.std.LoadPlugin(\"%1\")\n").arg(path.replace(QString("\\"), QString("\\\\")))); 9 | #endif 10 | #ifdef Q_OS_DARWIN 11 | return(QString("core.std.LoadPlugin(\"%1\")\n").arg(path)); 12 | #endif 13 | } 14 | 15 | /// 16 | /// Includes required python nodes. 17 | /// 18 | QString VapourSynth::include() { 19 | #ifdef Q_OS_WINDOWS 20 | return(QString("# This file was generated using FrameGUI\n\nimport tempfile\nimport vapoursynth as vs\nfrom vapoursynth import core\n\n")); 21 | #endif 22 | #ifdef Q_OS_DARWIN 23 | return(QString("# This file was generated using FrameGUI\n\nimport os\nimport vapoursynth as vs\nfrom vapoursynth import core\n\n")); 24 | #endif 25 | } 26 | 27 | /// 28 | /// Configures the source video for vapoursynth. 29 | /// 30 | /// The source video file path. 31 | /// String representation of the script. 32 | QString VapourSynth::input(QString path, QString id) { 33 | #ifdef Q_OS_WINDOWS 34 | return(QString("\nclip = core.lsmas.LWLibavSource(source=\"%1\", cachefile=tempfile.gettempdir() + \"\\%2.lwi\")\n\n").arg(path).replace(QString("\\"), QString("\\\\")).arg(id)); 35 | #endif 36 | #ifdef Q_OS_DARWIN 37 | 38 | return(QString("\nclip = core.ffms2.Source(source=\"%1\", cachefile=os.getenv(\"HOME\") + \"/Library/Caches/TemporaryItems/%2.ffindex\")\n\n").arg(path).arg(id)); 39 | #endif 40 | } 41 | 42 | /// 43 | /// Enabled scene change detection for frame interpolation. 44 | /// 45 | /// The sensitivity level for the scene change detection. 46 | /// String representation of the script. 47 | QString VapourSynth::scDetect(QString threshold) { 48 | return(QString("clip = core.misc.SCDetect(clip, threshold=%1)\n").arg(threshold)); 49 | } 50 | 51 | /// 52 | /// Concludes the clip for output pipe. 53 | /// 54 | /// String representation of the script. 55 | QString VapourSynth::concludeClip() { 56 | return(QString("clip.set_output()")); 57 | } 58 | 59 | /// 60 | /// Adds a new line to the script. 61 | /// 62 | /// String representation of the script. 63 | QString VapourSynth::newLine() { 64 | return(QString("\n")); 65 | } -------------------------------------------------------------------------------- /New/src/io/processerror.cpp: -------------------------------------------------------------------------------- 1 | #include "processerror.hpp" 2 | 3 | bool ProcessError::_pipeError; 4 | bool ProcessError::_vkMemoryError; 5 | bool ProcessError::_vkQueueError; 6 | bool ProcessError::_ncnnError; 7 | bool ProcessError::_hasError; 8 | 9 | /// 10 | /// Raises the FFMpeg pipe error. 11 | /// 12 | /// True or false. 13 | void ProcessError::setPipeError(bool pipeError) { 14 | _pipeError = pipeError; 15 | } 16 | 17 | /// 18 | /// Raises the VkAllocateMemory error. 19 | /// 20 | /// True or false. 21 | void ProcessError::setVkMemoryError(bool vkMemoryError) { 22 | _vkMemoryError = vkMemoryError; 23 | } 24 | 25 | /// 26 | /// Raises the VkQueueSubmit error. 27 | /// 28 | /// True or false. 29 | void ProcessError::setVkQueueError(bool vkQueueError) { 30 | _vkQueueError = vkQueueError; 31 | } 32 | 33 | /// 34 | /// Raises the NCNN error. 35 | /// 36 | /// True or false. 37 | void ProcessError::setNcnnError(bool ncnnError) { 38 | _ncnnError = ncnnError; 39 | } 40 | 41 | /// 42 | /// Receives the error. 43 | /// 44 | /// True or false. 45 | void ProcessError::setError(bool error) { 46 | _hasError = error; 47 | } 48 | 49 | /// 50 | /// Receives the FFMpeg pipe error. 51 | /// 52 | /// True or false. 53 | bool ProcessError::getPipeError() { 54 | return(_pipeError); 55 | } 56 | 57 | /// 58 | /// Receives the VkAllocateMemory error. 59 | /// 60 | /// True or false. 61 | bool ProcessError::getVkMemoryError() { 62 | return(_vkMemoryError); 63 | } 64 | 65 | /// 66 | /// Receives the VkQueueSubmit error. 67 | /// 68 | /// True or false. 69 | bool ProcessError::getVkQueueError() { 70 | return(_vkQueueError); 71 | } 72 | 73 | /// 74 | /// Receives the NCNN error. 75 | /// 76 | /// True or false. 77 | bool ProcessError::getNcnnError() { 78 | return(_ncnnError); 79 | } 80 | 81 | /// 82 | /// Raises the error. 83 | /// 84 | /// True or false. 85 | bool ProcessError::error() { 86 | return(_hasError); 87 | } 88 | 89 | /// 90 | /// Resets all private variables. 91 | /// 92 | void ProcessError::clearAll() { 93 | _pipeError = false; 94 | _vkMemoryError = false; 95 | _vkQueueError = false; 96 | _ncnnError = false; 97 | _hasError = false; 98 | } -------------------------------------------------------------------------------- /New/src/process/mediaconfig.cpp: -------------------------------------------------------------------------------- 1 | #include "mediaconfig.hpp" 2 | 3 | QStringList MediaConfig::_argumentList; 4 | 5 | void MediaConfig::setVideoCodec(QString codec) { 6 | foreach(QString argument, splitSpace(Argument::videoCodec(codec))) 7 | _argumentList.append(argument); 8 | } 9 | 10 | void MediaConfig::setAudioCodec(QString codec) { 11 | foreach(QString argument, splitSpace(Argument::audioCodec(codec))) 12 | _argumentList.append(argument); 13 | } 14 | 15 | void MediaConfig::setSubtitleCodec(QString codec) { 16 | foreach(QString argument, splitSpace(Argument::subtitleCodec(codec))) 17 | _argumentList.append(argument); 18 | } 19 | 20 | void MediaConfig::setMapAll(QString type, QString s1) { 21 | foreach(QString argument, splitSpace(Argument::mapAll(type, s1))) 22 | _argumentList.append(argument); 23 | } 24 | 25 | void MediaConfig::setConstantRateFactor(int crf) { 26 | foreach(QString argument, splitSpace(Argument::constantRateFactor(crf))) 27 | _argumentList.append(argument); 28 | } 29 | 30 | void MediaConfig::setInput() { 31 | _argumentList.append(Argument::input()); 32 | } 33 | 34 | void MediaConfig::setAppleTag() { 35 | foreach(QString argument, splitSpace(Argument::appleTag())) 36 | _argumentList.append(argument); 37 | } 38 | 39 | void MediaConfig::setVs() { 40 | foreach(QString argument, splitSpace(Argument::vs())) 41 | _argumentList.append(argument); 42 | } 43 | 44 | void MediaConfig::setVideoResolution(int width, int height) { 45 | foreach(QString argument, splitSpace(Argument::videoResolution(width, height))) 46 | _argumentList.append(argument); 47 | } 48 | 49 | void MediaConfig::append(QString string) { 50 | _argumentList.append(string); 51 | } 52 | 53 | void MediaConfig::setMetaData1() { 54 | _argumentList.append(Argument::metaData1()); 55 | } 56 | 57 | void MediaConfig::setMetaData2(QString str) { 58 | _argumentList.append(Argument::metaData2(str)); 59 | } 60 | 61 | void MediaConfig::setNoAutoRotate() { 62 | _argumentList.append(Argument::noAutoRotate()); 63 | } 64 | 65 | #ifdef Q_OS_WINDOWS 66 | void MediaConfig::setVsPipe1() { 67 | _argumentList.append(Argument::vsPipe1()); 68 | } 69 | 70 | void MediaConfig::setVsPipe2() { 71 | _argumentList.append(Argument::vsPipe2()); 72 | } 73 | #endif 74 | 75 | void MediaConfig::setOverride() { 76 | _argumentList.append(Argument::override()); 77 | } 78 | 79 | void MediaConfig::setOutput(QString path) { 80 | _argumentList.append(path); 81 | } 82 | 83 | void MediaConfig::resetArguments() { 84 | _argumentList.clear(); 85 | } 86 | 87 | QStringList MediaConfig::splitSpace(QString args) { 88 | QStringList arg(args.split(QString(" "))); 89 | return(arg); 90 | } 91 | 92 | QStringList MediaConfig::getArguments() { 93 | return(_argumentList); 94 | } -------------------------------------------------------------------------------- /Old (DEPRECATED)/FrameGUI/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | 12 | namespace FrameGUI.Properties 13 | { 14 | /// 15 | /// A strongly-typed resource class, for looking up localized strings, etc. 16 | /// 17 | // This class was auto-generated by the StronglyTypedResourceBuilder 18 | // class via a tool like ResGen or Visual Studio. 19 | // To add or remove a member, edit your .ResX file then rerun ResGen 20 | // with the /str option, or rebuild your VS project. 21 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 22 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 23 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 24 | internal class Resources 25 | { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() 33 | { 34 | } 35 | 36 | /// 37 | /// Returns the cached ResourceManager instance used by this class. 38 | /// 39 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 40 | internal static global::System.Resources.ResourceManager ResourceManager 41 | { 42 | get 43 | { 44 | if ((resourceMan == null)) 45 | { 46 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FrameGUI.Properties.Resources", typeof(Resources).Assembly); 47 | resourceMan = temp; 48 | } 49 | return resourceMan; 50 | } 51 | } 52 | 53 | /// 54 | /// Overrides the current thread's CurrentUICulture property for all 55 | /// resource lookups using this strongly typed resource class. 56 | /// 57 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 58 | internal static global::System.Globalization.CultureInfo Culture 59 | { 60 | get 61 | { 62 | return resourceCulture; 63 | } 64 | set 65 | { 66 | resourceCulture = value; 67 | } 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/EncodeProg/ProgressBarLabel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | 5 | namespace EncodeProg 6 | { 7 | public partial class ProgressBarLabel : ProgressBar 8 | { 9 | /// 10 | /// The text to write to the ProgressBar. 11 | /// 12 | private string progressText; 13 | 14 | /// 15 | /// The color of the text in the ProgressBar. 16 | /// 17 | public Color TextColor { get; set; } 18 | 19 | /// 20 | /// The text to write to the ProgressBar. 21 | /// 22 | public string ProgressText 23 | { 24 | get 25 | { 26 | return progressText; 27 | } 28 | set 29 | { 30 | if (progressText != value) 31 | { 32 | Invalidate(); 33 | progressText = value; 34 | } 35 | } 36 | } 37 | 38 | /// 39 | /// Overrides the message from the control. 40 | /// 41 | /// The message. 42 | protected override void WndProc(ref Message m) 43 | { 44 | base.WndProc(ref m); 45 | 46 | switch (m.Msg) 47 | { 48 | case 15: 49 | using (var graphics = Graphics.FromHwnd(Handle)) 50 | { 51 | DrawText(graphics); 52 | } 53 | 54 | break; 55 | } 56 | } 57 | 58 | /// 59 | /// Draws the text to go on the progress bar. 60 | /// 61 | /// 62 | private void DrawText(Graphics graphics) 63 | { 64 | if (!string.IsNullOrEmpty(ProgressText)) 65 | { 66 | var font = new Font("Arial", 8.25F, FontStyle.Regular, 67 | GraphicsUnit.Point, 0); 68 | 69 | var size = graphics.MeasureString(ProgressText, font); 70 | var point = new PointF(Width / 2 - size.Width / 2.0F, Height / 2 - size.Height / 2.0F + 1); 71 | 72 | graphics.DrawString(ProgressText, font, new SolidBrush(TextColor), point); 73 | } 74 | } 75 | 76 | /// 77 | /// Overrides the WS_EX_COMPOSITED parameters to prevent the control from blinking. 78 | /// 79 | protected override CreateParams CreateParams 80 | { 81 | get 82 | { 83 | CreateParams result = base.CreateParams; 84 | result.ExStyle |= 0x02000000; 85 | 86 | return result; 87 | } 88 | } 89 | 90 | /// 91 | /// Configuration. 92 | /// 93 | public ProgressBarLabel() 94 | { 95 | InitializeComponent(); 96 | SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /New/src/regex/progressinforegex.cpp: -------------------------------------------------------------------------------- 1 | #include "progressinforegex.hpp" 2 | 3 | QList ProgressInfoRegex::_indexer; 4 | 5 | void ProgressInfoRegex::setupPatterns() { 6 | _indexer << QRegularExpression(QString("frame=\\s*([0-9]*)")); // frame 7 | _indexer << QRegularExpression(QString("fps=\\s*([0-9]*\\.?[0-9]?)")); // fps 8 | _indexer << QRegularExpression(QString("bitrate=\\s*([0-9]*\\.?[0-9]?)kbits/s")); // bitrate 9 | _indexer << QRegularExpression(QString("time=\\s*([0-9]*):([0-9]*):([0-9]*)\\.([0-9]*)")); // processed time 10 | } 11 | 12 | bool ProgressInfoRegex::progressRegex(QString output, QTime totalDuration, int totalFrames, QElapsedTimer timer, QTime pause) { 13 | if (_indexer.isEmpty()) 14 | setupPatterns(); 15 | 16 | QRegularExpressionMatch matchFrames(_indexer.at(GetInfo::Frame).match(output)); 17 | QRegularExpressionMatch matchFps(_indexer.at(GetInfo::Fps).match(output)); 18 | QRegularExpressionMatch matchBitrate(_indexer.at(GetInfo::Bitrate).match(output)); 19 | QRegularExpressionMatch matchTimeProcessed(_indexer.at(GetInfo::Time).match(output)); 20 | 21 | int frames; 22 | QString fps, bitrate; 23 | QTime timeProcessed; 24 | 25 | if (!matchFrames.hasMatch() || !matchFps.hasMatch() || !matchBitrate.hasMatch() || !matchTimeProcessed.hasMatch()) 26 | return false; 27 | else { 28 | frames = matchFrames.captured(1).toInt(); 29 | fps = matchFps.captured(1); 30 | bitrate = matchBitrate.captured(1); 31 | timeProcessed = QTime(matchTimeProcessed.captured(1).toInt(), matchTimeProcessed.captured(2).toInt(), matchTimeProcessed.captured(3).toInt(), 32 | QString(matchTimeProcessed.captured(4) + QString("0")).toInt()); 33 | 34 | int mSecondsProcessed = QTime(0, 0, 0, 0).msecsTo(timeProcessed); 35 | int mSecondsTotal = QTime(0, 0, 0, 0).msecsTo(totalDuration); 36 | 37 | double percentage = ceil(static_cast(mSecondsProcessed) / mSecondsTotal * 10000.0) / 100.0; 38 | 39 | int elapsed = (timer.elapsed() + QTime(0, 0, 0, 0).msecsTo(pause)) / 1000; 40 | 41 | int framesLeft = totalFrames - frames; 42 | double timeLeft = framesLeft * (static_cast(elapsed) / frames); 43 | 44 | int seconds = ((int)timeLeft % 60); 45 | timeLeft /= 60; 46 | int minutes = ((int)timeLeft % 60); 47 | timeLeft /= 60; 48 | int hours = ((int)timeLeft); 49 | 50 | if (seconds < 0) 51 | seconds = 0; 52 | if (minutes < 0) 53 | minutes = 0; 54 | if (hours < 0) 55 | hours = 0; 56 | 57 | if (percentage > 100) 58 | percentage = 100; 59 | 60 | QTime qTimeLeft(QTime(hours, minutes, seconds)); 61 | 62 | int sec = (int)(elapsed % 60); 63 | elapsed /= 60; 64 | int min = (int)(elapsed % 60); 65 | elapsed /= 60; 66 | int hr = (int)(elapsed); 67 | 68 | QTime timeElapsed(QTime(hr, min, sec)); 69 | 70 | if (bitrate.isEmpty()) 71 | bitrate = QString("0.0"); 72 | if (fps.isEmpty()) 73 | fps = QString("0.0"); 74 | 75 | #ifdef PROGRESSINFO_H 76 | ProgressInfo::setTimeLeft(qTimeLeft); 77 | ProgressInfo::setTimeElapsed(timeElapsed); 78 | ProgressInfo::setProcessedFrames(frames); 79 | ProgressInfo::setTotalFrames(totalFrames); 80 | ProgressInfo::setTime(timeProcessed); 81 | ProgressInfo::setFps(fps); 82 | ProgressInfo::setBitrate(bitrate); 83 | ProgressInfo::setPercentage(percentage); 84 | #endif // PROGRESSINFO_H 85 | 86 | return true; 87 | } 88 | } -------------------------------------------------------------------------------- /New/include/windows/update.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Update 4 | 5 | 6 | 7 | 0 8 | 0 9 | 551 10 | 294 11 | 12 | 13 | 14 | 15 | 551 16 | 294 17 | 18 | 19 | 20 | 21 | 551 22 | 294 23 | 24 | 25 | 26 | FrameGUI - Updates 27 | 28 | 29 | 30 | 31 | 175 32 | 7 33 | 200 34 | 32 35 | 36 | 37 | 38 | <html><head/><body><p><span style=" font-size:16pt; font-weight:700;">It's Time to Update!</span></p></body></html> 39 | 40 | 41 | 42 | 43 | 44 | 9 45 | 266 46 | 97 47 | 16 48 | 49 | 50 | 51 | Choose an action: 52 | 53 | 54 | 55 | 56 | 57 | 209 58 | 263 59 | 93 60 | 24 61 | 62 | 63 | 64 | 65 | true 66 | 67 | 68 | 69 | Update Now 70 | 71 | 72 | 73 | 74 | 75 | 309 76 | 263 77 | 116 78 | 24 79 | 80 | 81 | 82 | Remind Me Later 83 | 84 | 85 | 86 | 87 | 88 | 432 89 | 263 90 | 112 91 | 24 92 | 93 | 94 | 95 | Skip This Update 96 | 97 | 98 | 99 | 100 | 101 | 8 102 | 63 103 | 536 104 | 192 105 | 106 | 107 | 108 | 109 | 110 | 111 | 106 112 | 38 113 | 341 114 | 20 115 | 116 | 117 | 118 | Below are the details for the next new update for FrameGUI 119 | 120 | 121 | Qt::AlignCenter 122 | 123 | 124 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/FFEncoder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Text; 4 | using System.Diagnostics; 5 | using FFLoader.Helpers; 6 | 7 | namespace FFLoader 8 | { 9 | internal class FFEncoder 10 | { 11 | /// 12 | /// The timer for the encoding process. 13 | /// 14 | internal static Stopwatch Timer = new Stopwatch(); 15 | 16 | /// 17 | /// Attmpts to start the process and will catch FFLoader exceptions if they occur. 18 | /// 19 | /// Instace of StreamWriter logger. 20 | /// Instance of the process. 21 | /// Instace of the AviSynth+ error StringBuilder. 22 | /// Instance of FFLoader. 23 | internal static void TryStartProcess(StreamWriter log, Process process, StringBuilder sb, FFLoaderBase ffloader) 24 | { 25 | try 26 | { 27 | FFHelper.FFMpegPathNullOrMissing(ffloader.FFMpegPath); 28 | FFHelper.InputFileNullOrMissing(ffloader.InputVideoPath); 29 | FFHelper.OutputPathNullOrMissing(ffloader.OutputVideoPath); 30 | 31 | if (!string.IsNullOrEmpty(ffloader.AvisynthScriptPath)) 32 | { 33 | FFHelper.AvsScriptFileNullOrMissing(ffloader.AvisynthScriptPath); 34 | } 35 | 36 | process.Start(); 37 | Timer.Restart(); 38 | 39 | string line = new string('=', 100); 40 | 41 | //Create and write log file. 42 | log.WriteLine(line); 43 | log.WriteLine($"FFMpeg logs generated by FFLoader on {DateTime.Now}"); 44 | log.WriteLine($"FFMpeg Command: ffmpeg.exe {ffloader.FFMpegCommand}"); 45 | log.WriteLine(line + Environment.NewLine); 46 | 47 | process.BeginErrorReadLine(); 48 | process.WaitForExit(); 49 | Timer.Stop(); 50 | 51 | FileInfo file = new FileInfo(ffloader.OutputVideoPath); 52 | 53 | if (!string.IsNullOrEmpty(sb.ToString())) 54 | { 55 | ffloader.CatchAvsError(sb.ToString(), out AviSynthErrorHandler handler); 56 | ffloader.UpdateAvsError(handler); 57 | ProcessWorker.Cancelled = true; 58 | } 59 | else if (FFHelper.OutputFileNotCreated(ffloader.OutputVideoPath) || file.Length < 10000) 60 | { 61 | ffloader.CatchFFMpegError("An unknown error occured with FFMpeg.", out FFMpegErrorHandler handler); 62 | ffloader.UpdateFFMpegError(handler); 63 | ProcessWorker.Cancelled = true; 64 | } 65 | 66 | log.WriteLine(); 67 | log.WriteLine(line); 68 | log.WriteLine("End of logs."); 69 | log.WriteLine(line); 70 | log.Close(); 71 | line = null; 72 | } 73 | catch (FFLoaderException e) 74 | { 75 | ffloader.CatchException(e.Source + ": " + e.Message, out FFExceptionHandler handler); 76 | ffloader.UpdateException(handler); 77 | } 78 | finally 79 | { 80 | try 81 | { 82 | log = null; 83 | ffloader.CloseProcess(); 84 | } 85 | catch (FFLoaderException e) 86 | { 87 | ffloader.CatchException(e.Source + ": " + e.Message, out FFExceptionHandler handler); 88 | ffloader.UpdateException(handler); 89 | } 90 | } 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /New/include/windows/ui_update.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | ** Form generated from reading UI file 'update.ui' 3 | ** 4 | ** Created by: Qt User Interface Compiler version 6.2.4 5 | ** 6 | ** WARNING! All changes made in this file will be lost when recompiling UI file! 7 | ********************************************************************************/ 8 | 9 | #ifndef UI_UPDATE_H 10 | #define UI_UPDATE_H 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | QT_BEGIN_NAMESPACE 20 | 21 | class Ui_Update 22 | { 23 | public: 24 | QLabel *TitleLabel; 25 | QLabel *ToDoLabel; 26 | QPushButton *UpdateBttn; 27 | QPushButton *RemindBttn; 28 | QPushButton *SkipBttn; 29 | QTextBrowser *textBrowser; 30 | QLabel *DetailsLabel; 31 | 32 | void setupUi(QWidget *Update) 33 | { 34 | if (Update->objectName().isEmpty()) 35 | Update->setObjectName(QString::fromUtf8("Update")); 36 | Update->resize(551, 294); 37 | Update->setMinimumSize(QSize(551, 294)); 38 | Update->setMaximumSize(QSize(551, 294)); 39 | TitleLabel = new QLabel(Update); 40 | TitleLabel->setObjectName(QString::fromUtf8("TitleLabel")); 41 | TitleLabel->setGeometry(QRect(175, 7, 200, 32)); 42 | ToDoLabel = new QLabel(Update); 43 | ToDoLabel->setObjectName(QString::fromUtf8("ToDoLabel")); 44 | ToDoLabel->setGeometry(QRect(9, 266, 97, 16)); 45 | UpdateBttn = new QPushButton(Update); 46 | UpdateBttn->setObjectName(QString::fromUtf8("UpdateBttn")); 47 | UpdateBttn->setGeometry(QRect(209, 263, 93, 24)); 48 | QFont font; 49 | font.setBold(true); 50 | UpdateBttn->setFont(font); 51 | RemindBttn = new QPushButton(Update); 52 | RemindBttn->setObjectName(QString::fromUtf8("RemindBttn")); 53 | RemindBttn->setGeometry(QRect(309, 263, 116, 24)); 54 | SkipBttn = new QPushButton(Update); 55 | SkipBttn->setObjectName(QString::fromUtf8("SkipBttn")); 56 | SkipBttn->setGeometry(QRect(432, 263, 112, 24)); 57 | textBrowser = new QTextBrowser(Update); 58 | textBrowser->setObjectName(QString::fromUtf8("textBrowser")); 59 | textBrowser->setGeometry(QRect(8, 63, 536, 192)); 60 | DetailsLabel = new QLabel(Update); 61 | DetailsLabel->setObjectName(QString::fromUtf8("DetailsLabel")); 62 | DetailsLabel->setGeometry(QRect(106, 38, 341, 20)); 63 | DetailsLabel->setAlignment(Qt::AlignCenter); 64 | 65 | retranslateUi(Update); 66 | 67 | QMetaObject::connectSlotsByName(Update); 68 | } // setupUi 69 | 70 | void retranslateUi(QWidget *Update) 71 | { 72 | Update->setWindowTitle(QCoreApplication::translate("Update", "FrameGUI - Updates", nullptr)); 73 | TitleLabel->setText(QCoreApplication::translate("Update", "

It's Time to Update!

", nullptr)); 74 | ToDoLabel->setText(QCoreApplication::translate("Update", "Choose an action:", nullptr)); 75 | UpdateBttn->setText(QCoreApplication::translate("Update", "Update Now", nullptr)); 76 | RemindBttn->setText(QCoreApplication::translate("Update", "Remind Me Later", nullptr)); 77 | SkipBttn->setText(QCoreApplication::translate("Update", "Skip This Update", nullptr)); 78 | DetailsLabel->setText(QCoreApplication::translate("Update", "Below are the details for the next new update for FrameGUI", nullptr)); 79 | } // retranslateUi 80 | 81 | }; 82 | 83 | namespace Ui { 84 | class Update: public Ui_Update {}; 85 | } // namespace Ui 86 | 87 | QT_END_NAMESPACE 88 | 89 | #endif // UI_UPDATE_H 90 | -------------------------------------------------------------------------------- /New/src/ui/settings.cpp: -------------------------------------------------------------------------------- 1 | #include "framegui.hpp" 2 | 3 | void FrameGUI::loadSysSetting() { 4 | QSettings sys(QSettings(QSettings::NativeFormat, QSettings::UserScope, QString("DaGoose"), QString("FrameGUI"))); 5 | 6 | _arguments = sys.value(QString("arguments"), QVariantList()).toList(); 7 | _audioArgs = sys.value(QString("audargs"), QVariantList()).toList(); 8 | 9 | #ifdef Q_OS_WINDOWS 10 | _vapourScript = sys.value(QString("vs"), QVariantList()).toList(); 11 | #endif 12 | 13 | foreach(QVariant id, sys.value(QString("jobid"), QVariantList()).toList()) 14 | *_job << id.toString(); 15 | 16 | foreach(QVariant in, sys.value(QString("input"), QVariantList()).toList()) 17 | *_inputList << in.toString(); 18 | 19 | foreach(QVariant out, sys.value(QString("output"), QVariantList()).toList()) 20 | *_outputList << out.toString(); 21 | 22 | foreach(QVariant tmp, sys.value(QString("temp"), QVariantList()).toList()) 23 | *_tempList << tmp.toString(); 24 | 25 | foreach(QVariant sta, sys.value(QString("state"), QVariantList()).toList()) 26 | *_state << sta.toString(); 27 | 28 | foreach(QVariant dur, sys.value(QString("dur"), QVariantList()).toList()) 29 | VideoInfoList::setDuration(dur.toTime()); 30 | 31 | foreach(QVariant fr, sys.value(QString("fr"), QVariantList()).toList()) 32 | VideoInfoList::setFrameRate(fr.toString()); 33 | } 34 | 35 | void FrameGUI::saveSettings() { 36 | _sArguments.clear(); 37 | _sJob.clear(); 38 | _sState.clear(); 39 | 40 | #ifdef Q_OS_WINDOWS 41 | _sVapourScript.clear(); 42 | #endif 43 | 44 | _sInputList.clear(); 45 | _sOutputList.clear(); 46 | _sTempList.clear(); 47 | _sDuration.clear(); 48 | _sAudioArgs.clear(); 49 | _sFrameRate.clear(); 50 | 51 | _sArguments = _arguments; 52 | _sAudioArgs = _audioArgs; 53 | 54 | #ifdef Q_OS_WINDOWS 55 | _sVapourScript = _vapourScript; 56 | #endif 57 | 58 | foreach(QString id, *_job) 59 | _sJob.append(id); 60 | 61 | foreach(QString sta, *_state) 62 | _sState.append(sta); 63 | 64 | foreach(QString in, *_inputList) 65 | _sInputList.append(in); 66 | 67 | foreach(QString out, *_outputList) 68 | _sOutputList.append(out); 69 | 70 | foreach(QString temp, *_tempList) 71 | _sTempList.append(temp); 72 | 73 | FOR_EACH(_arguments.count()) 74 | _sDuration.append(VideoInfoList::getDuration(i)); 75 | 76 | FOR_EACH(_arguments.count()) 77 | _sFrameRate.append(VideoInfoList::getFrameRate(i)); 78 | } 79 | 80 | void FrameGUI::setJobSetting() { 81 | QSettings(QSettings::NativeFormat, QSettings::UserScope, QString("DaGoose"), QString("FrameGUI")).setValue(QString("arguments"), _sArguments); 82 | QSettings(QSettings::NativeFormat, QSettings::UserScope, QString("DaGoose"), QString("FrameGUI")).setValue(QString("jobid"), _sJob); 83 | 84 | #ifdef Q_OS_WINDOWS 85 | QSettings(QSettings::NativeFormat, QSettings::UserScope, QString("DaGoose"), QString("FrameGUI")).setValue(QString("vs"), _sVapourScript); 86 | #endif 87 | 88 | QSettings(QSettings::NativeFormat, QSettings::UserScope, QString("DaGoose"), QString("FrameGUI")).setValue(QString("input"), _sInputList); 89 | QSettings(QSettings::NativeFormat, QSettings::UserScope, QString("DaGoose"), QString("FrameGUI")).setValue(QString("output"), _sOutputList); 90 | QSettings(QSettings::NativeFormat, QSettings::UserScope, QString("DaGoose"), QString("FrameGUI")).setValue(QString("temp"), _sTempList); 91 | QSettings(QSettings::NativeFormat, QSettings::UserScope, QString("DaGoose"), QString("FrameGUI")).setValue(QString("audargs"), _sAudioArgs); 92 | QSettings(QSettings::NativeFormat, QSettings::UserScope, QString("DaGoose"), QString("FrameGUI")).setValue(QString("state"), _sState); 93 | QSettings(QSettings::NativeFormat, QSettings::UserScope, QString("DaGoose"), QString("FrameGUI")).setValue(QString("dur"), _sDuration); 94 | QSettings(QSettings::NativeFormat, QSettings::UserScope, QString("DaGoose"), QString("FrameGUI")).setValue(QString("fr"), _sFrameRate); 95 | } -------------------------------------------------------------------------------- /New/include/darwin/ui_update.hpp: -------------------------------------------------------------------------------- 1 | #ifndef UPDATETIKRXK_H 2 | #define UPDATETIKRXK_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | QT_BEGIN_NAMESPACE 12 | 13 | class Ui_Update 14 | { 15 | public: 16 | QLabel *TitleLabel; 17 | QLabel *ToDoLabel; 18 | QPushButton *UpdateBttn; 19 | QPushButton *RemindBttn; 20 | QPushButton *SkipBttn; 21 | QTextBrowser *textBrowser; 22 | QLabel *DetailsLabel; 23 | 24 | void setupUi(QWidget *Update) 25 | { 26 | if (Update->objectName().isEmpty()) 27 | Update->setObjectName(QString::fromUtf8("Update")); 28 | Update->resize(550, 294); 29 | Update->setMinimumSize(QSize(550, 294)); 30 | Update->setMaximumSize(QSize(550, 294)); 31 | TitleLabel = new QLabel(Update); 32 | TitleLabel->setObjectName(QString::fromUtf8("TitleLabel")); 33 | TitleLabel->setGeometry(QRect(200, 7, 150, 32)); 34 | TitleLabel->setAlignment(Qt::AlignCenter); 35 | ToDoLabel = new QLabel(Update); 36 | ToDoLabel->setObjectName(QString::fromUtf8("ToDoLabel")); 37 | ToDoLabel->setGeometry(QRect(7, 264, 111, 16)); 38 | UpdateBttn = new QPushButton(Update); 39 | UpdateBttn->setObjectName(QString::fromUtf8("UpdateBttn")); 40 | UpdateBttn->setGeometry(QRect(200, 259, 95, 32)); 41 | UpdateBttn->setMinimumSize(QSize(0, 32)); 42 | UpdateBttn->setSizeIncrement(QSize(0, 32)); 43 | QFont font; 44 | font.setBold(true); 45 | UpdateBttn->setFont(font); 46 | UpdateBttn->setFocusPolicy(Qt::NoFocus); 47 | RemindBttn = new QPushButton(Update); 48 | RemindBttn->setObjectName(QString::fromUtf8("RemindBttn")); 49 | RemindBttn->setGeometry(QRect(300, 259, 120, 32)); 50 | RemindBttn->setMinimumSize(QSize(0, 32)); 51 | RemindBttn->setSizeIncrement(QSize(0, 32)); 52 | RemindBttn->setFocusPolicy(Qt::NoFocus); 53 | SkipBttn = new QPushButton(Update); 54 | SkipBttn->setObjectName(QString::fromUtf8("SkipBttn")); 55 | SkipBttn->setGeometry(QRect(425, 259, 118, 32)); 56 | SkipBttn->setMinimumSize(QSize(0, 32)); 57 | SkipBttn->setSizeIncrement(QSize(0, 32)); 58 | SkipBttn->setFocusPolicy(Qt::NoFocus); 59 | textBrowser = new QTextBrowser(Update); 60 | textBrowser->setObjectName(QString::fromUtf8("textBrowser")); 61 | textBrowser->setGeometry(QRect(7, 63, 536, 192)); 62 | DetailsLabel = new QLabel(Update); 63 | DetailsLabel->setObjectName(QString::fromUtf8("DetailsLabel")); 64 | DetailsLabel->setGeometry(QRect(95, 38, 360, 20)); 65 | DetailsLabel->setAlignment(Qt::AlignCenter); 66 | 67 | retranslateUi(Update); 68 | 69 | QMetaObject::connectSlotsByName(Update); 70 | } // setupUi 71 | 72 | void retranslateUi(QWidget *Update) 73 | { 74 | Update->setWindowTitle(QCoreApplication::translate("Update", "FrameGUI - Updates", nullptr)); 75 | TitleLabel->setText(QCoreApplication::translate("Update", "

It's Time to Update!

", nullptr)); 76 | ToDoLabel->setText(QCoreApplication::translate("Update", "Choose an action:", nullptr)); 77 | UpdateBttn->setText(QCoreApplication::translate("Update", "Update Now", nullptr)); 78 | RemindBttn->setText(QCoreApplication::translate("Update", "Remind Me Later", nullptr)); 79 | SkipBttn->setText(QCoreApplication::translate("Update", "Skip This Update", nullptr)); 80 | DetailsLabel->setText(QCoreApplication::translate("Update", "Below are the details for the next new update for FrameGUI", nullptr)); 81 | } // retranslateUi 82 | 83 | }; 84 | 85 | namespace Ui { 86 | class Update: public Ui_Update {}; 87 | } // namespace Ui 88 | 89 | QT_END_NAMESPACE 90 | 91 | #endif // UPDATETIKRXK_H 92 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/ProcessWorker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using FFLoader.Helpers; 4 | 5 | namespace FFLoader 6 | { 7 | public class ProcessWorker : IDisposable 8 | { 9 | internal Process _process; 10 | 11 | /// 12 | /// True if the user requested to cancel the encode, otherwise false. 13 | /// 14 | public static bool Cancelled { get; set; } 15 | 16 | /// 17 | /// The process at which to execute. 18 | /// 19 | internal enum ExeName 20 | { 21 | FFMpeg 22 | //More to come? (TODO) 23 | } 24 | 25 | /// 26 | /// Determines if a process is currently running. 27 | /// 28 | /// 29 | /// 30 | internal static bool IsProcessRunning(Process process) 31 | { 32 | bool processClosed; 33 | 34 | try 35 | { 36 | processClosed = process.HasExited; 37 | } 38 | catch 39 | { 40 | processClosed = true; 41 | } 42 | 43 | return !processClosed; 44 | } 45 | 46 | /// 47 | /// Starts a new process and defines StartInfo. 48 | /// 49 | /// The name of exe to launch. 50 | /// The path to the exe to launch 51 | /// The arguments to pass to the exe 52 | internal IDisposable NewProcess(ExeName exeName, string exePath, string cmdArgs) 53 | { 54 | _process = new Process(); 55 | 56 | if (IsProcessRunning(_process)) 57 | { 58 | FFHelper.ProcessAlreadyRunning(exeName.ToString()); 59 | } 60 | 61 | _process.StartInfo.FileName = exePath; 62 | _process.StartInfo.Arguments = cmdArgs; 63 | _process.StartInfo.UseShellExecute = false; 64 | _process.StartInfo.CreateNoWindow = true; 65 | _process.StartInfo.RedirectStandardInput = true; 66 | _process.StartInfo.RedirectStandardError = true; 67 | 68 | return _process; 69 | } 70 | 71 | /// 72 | /// Stops the running FFMpeg process using a soft kill. 73 | /// 74 | public void StopFFMpegProcess() 75 | { 76 | if (IsProcessRunning(_process)) 77 | { 78 | Cancelled = true; 79 | _process.StandardInput.Write('q'); 80 | CloseProcess(); 81 | } 82 | else 83 | { 84 | FFHelper.NoProcessRunning(); 85 | Cancelled = false; 86 | } 87 | } 88 | 89 | /// 90 | /// Closes the running process. 91 | /// 92 | internal void CloseProcess() 93 | { 94 | if (_process != null) 95 | { 96 | _process.Close(); 97 | Dispose(); 98 | } 99 | } 100 | 101 | /// 102 | /// WIP 103 | /// 104 | /// 105 | public void PauseProcess(bool pause) 106 | { 107 | if (pause) 108 | { 109 | _process.StandardInput.Write(ConsoleSpecialKey.ControlBreak); 110 | } 111 | else 112 | { 113 | _process.StandardInput.Write(ConsoleKey.Enter); 114 | } 115 | } 116 | 117 | /// 118 | /// Frees all resources used by the process. 119 | /// 120 | public void Dispose() 121 | { 122 | _process?.Dispose(); 123 | } 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/FrameGUI/FrameGUI.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30804.86 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FrameGUI", "FrameGUI.csproj", "{678EA14B-EE0E-4BE5-9DE8-2A11D51CC714}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FFLoader", "..\FFLoader\FFLoader.csproj", "{79AFB019-5BE7-4226-BE65-B4FC678B88A6}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EncodeProg", "..\EncodeProg\EncodeProg.csproj", "{ED40B686-1396-4D0C-A72E-6A65AAB3681D}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Debug|x64 = Debug|x64 16 | Debug|x86 = Debug|x86 17 | Release|Any CPU = Release|Any CPU 18 | Release|x64 = Release|x64 19 | Release|x86 = Release|x86 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {678EA14B-EE0E-4BE5-9DE8-2A11D51CC714}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {678EA14B-EE0E-4BE5-9DE8-2A11D51CC714}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {678EA14B-EE0E-4BE5-9DE8-2A11D51CC714}.Debug|x64.ActiveCfg = Debug|x64 25 | {678EA14B-EE0E-4BE5-9DE8-2A11D51CC714}.Debug|x64.Build.0 = Debug|x64 26 | {678EA14B-EE0E-4BE5-9DE8-2A11D51CC714}.Debug|x86.ActiveCfg = Debug|x86 27 | {678EA14B-EE0E-4BE5-9DE8-2A11D51CC714}.Debug|x86.Build.0 = Debug|x86 28 | {678EA14B-EE0E-4BE5-9DE8-2A11D51CC714}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {678EA14B-EE0E-4BE5-9DE8-2A11D51CC714}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {678EA14B-EE0E-4BE5-9DE8-2A11D51CC714}.Release|x64.ActiveCfg = Release|x64 31 | {678EA14B-EE0E-4BE5-9DE8-2A11D51CC714}.Release|x64.Build.0 = Release|x64 32 | {678EA14B-EE0E-4BE5-9DE8-2A11D51CC714}.Release|x86.ActiveCfg = Release|x86 33 | {678EA14B-EE0E-4BE5-9DE8-2A11D51CC714}.Release|x86.Build.0 = Release|x86 34 | {79AFB019-5BE7-4226-BE65-B4FC678B88A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {79AFB019-5BE7-4226-BE65-B4FC678B88A6}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {79AFB019-5BE7-4226-BE65-B4FC678B88A6}.Debug|x64.ActiveCfg = Debug|x64 37 | {79AFB019-5BE7-4226-BE65-B4FC678B88A6}.Debug|x64.Build.0 = Debug|x64 38 | {79AFB019-5BE7-4226-BE65-B4FC678B88A6}.Debug|x86.ActiveCfg = Debug|Any CPU 39 | {79AFB019-5BE7-4226-BE65-B4FC678B88A6}.Debug|x86.Build.0 = Debug|Any CPU 40 | {79AFB019-5BE7-4226-BE65-B4FC678B88A6}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {79AFB019-5BE7-4226-BE65-B4FC678B88A6}.Release|Any CPU.Build.0 = Release|Any CPU 42 | {79AFB019-5BE7-4226-BE65-B4FC678B88A6}.Release|x64.ActiveCfg = Release|x64 43 | {79AFB019-5BE7-4226-BE65-B4FC678B88A6}.Release|x64.Build.0 = Release|x64 44 | {79AFB019-5BE7-4226-BE65-B4FC678B88A6}.Release|x86.ActiveCfg = Release|Any CPU 45 | {79AFB019-5BE7-4226-BE65-B4FC678B88A6}.Release|x86.Build.0 = Release|Any CPU 46 | {ED40B686-1396-4D0C-A72E-6A65AAB3681D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 47 | {ED40B686-1396-4D0C-A72E-6A65AAB3681D}.Debug|Any CPU.Build.0 = Debug|Any CPU 48 | {ED40B686-1396-4D0C-A72E-6A65AAB3681D}.Debug|x64.ActiveCfg = Debug|x64 49 | {ED40B686-1396-4D0C-A72E-6A65AAB3681D}.Debug|x64.Build.0 = Debug|x64 50 | {ED40B686-1396-4D0C-A72E-6A65AAB3681D}.Debug|x86.ActiveCfg = Debug|x86 51 | {ED40B686-1396-4D0C-A72E-6A65AAB3681D}.Debug|x86.Build.0 = Debug|x86 52 | {ED40B686-1396-4D0C-A72E-6A65AAB3681D}.Release|Any CPU.ActiveCfg = Release|Any CPU 53 | {ED40B686-1396-4D0C-A72E-6A65AAB3681D}.Release|Any CPU.Build.0 = Release|Any CPU 54 | {ED40B686-1396-4D0C-A72E-6A65AAB3681D}.Release|x64.ActiveCfg = Release|x64 55 | {ED40B686-1396-4D0C-A72E-6A65AAB3681D}.Release|x64.Build.0 = Release|x64 56 | {ED40B686-1396-4D0C-A72E-6A65AAB3681D}.Release|x86.ActiveCfg = Release|x86 57 | {ED40B686-1396-4D0C-A72E-6A65AAB3681D}.Release|x86.Build.0 = Release|x86 58 | EndGlobalSection 59 | GlobalSection(SolutionProperties) = preSolution 60 | HideSolutionNode = FALSE 61 | EndGlobalSection 62 | GlobalSection(ExtensibilityGlobals) = postSolution 63 | SolutionGuid = {A061B769-43C7-4EB5-AF50-70B9D43987FD} 64 | EndGlobalSection 65 | EndGlobal 66 | -------------------------------------------------------------------------------- /New/src/io/progressinfo.cpp: -------------------------------------------------------------------------------- 1 | #include "progressinfo.hpp" 2 | 3 | QTime ProgressInfo::_timeLeft; 4 | QTime ProgressInfo::_timeElapsed; 5 | int ProgressInfo::_processedFrames; 6 | int ProgressInfo::_totalFrames; 7 | QTime ProgressInfo::_time; 8 | QString ProgressInfo::_fps; 9 | QString ProgressInfo::_bitrate; 10 | double ProgressInfo::_percentage; 11 | 12 | /// 13 | /// Sets the time left. 14 | /// 15 | /// The amount of time left. 16 | void ProgressInfo::setTimeLeft(QTime timeLeft) { 17 | _timeLeft = timeLeft; 18 | } 19 | 20 | /// 21 | /// Sets the time elapsed. 22 | /// 23 | /// The amount of time elapsed. 24 | void ProgressInfo::setTimeElapsed(QTime timeElapsed) { 25 | _timeElapsed = timeElapsed; 26 | } 27 | 28 | /// 29 | /// Sets the processed frames. 30 | /// 31 | /// The amount of frames processed. 32 | void ProgressInfo::setProcessedFrames(int processedFrames) { 33 | _processedFrames = processedFrames; 34 | } 35 | 36 | /// 37 | /// Sets the total number of frames. 38 | /// 39 | /// The total number of frames. 40 | void ProgressInfo::setTotalFrames(int totalFrames) { 41 | _totalFrames = totalFrames; 42 | } 43 | 44 | /// 45 | /// Sets the time processed. 46 | /// 47 | /// The time processed. 48 | void ProgressInfo::setTime(QTime time) { 49 | _time = time; 50 | } 51 | 52 | /// 53 | /// Sets the fps. 54 | /// 55 | /// The fps. 56 | void ProgressInfo::setFps(QString fps) { 57 | _fps = fps; 58 | } 59 | 60 | /// 61 | /// Sets the bitrate. 62 | /// 63 | /// The bitrate. 64 | void ProgressInfo::setBitrate(QString bitrate) { 65 | _bitrate = bitrate; 66 | } 67 | 68 | /// 69 | /// Sets the encoding percentage. 70 | /// 71 | /// The percentage. 72 | void ProgressInfo::setPercentage(double percentage) { 73 | _percentage = percentage; 74 | } 75 | 76 | /// 77 | /// Gets the time left. 78 | /// 79 | /// The time left. 80 | QTime ProgressInfo::getTimeLeft() { 81 | return(_timeLeft); 82 | } 83 | 84 | /// 85 | /// Gets the time elapsed. 86 | /// 87 | /// The time elapsed. 88 | QTime ProgressInfo::getTimeElapsed() { 89 | return(_timeElapsed); 90 | } 91 | 92 | /// 93 | /// Gets the processed frames. 94 | /// 95 | /// The number of processed frames. 96 | int ProgressInfo::getProcessedFrames() { 97 | return(_processedFrames); 98 | } 99 | 100 | /// 101 | /// Gets the total number of frames. 102 | /// 103 | /// The total number of frames. 104 | int ProgressInfo::getTotalFrames() { 105 | return(_totalFrames); 106 | } 107 | 108 | /// 109 | /// Gets the time processed. 110 | /// 111 | /// The time processed. 112 | QTime ProgressInfo::getTime() { 113 | return(_time); 114 | } 115 | 116 | /// 117 | /// Gets the fps. 118 | /// 119 | /// The fps. 120 | QString ProgressInfo::getFps() { 121 | return(_fps); 122 | } 123 | 124 | /// 125 | /// Gets the bitrate. 126 | /// 127 | /// The bitrate. 128 | QString ProgressInfo::getBitrate() { 129 | return(_bitrate); 130 | } 131 | 132 | /// 133 | /// Gets the percentage. 134 | /// 135 | /// The percentage. 136 | double ProgressInfo::getPercentage() { 137 | return(_percentage); 138 | } 139 | 140 | /// 141 | /// Resets all private variables. 142 | /// 143 | void ProgressInfo::clearAll() { 144 | _timeLeft = QTime(); 145 | _timeElapsed = QTime(); 146 | _processedFrames = 0; 147 | _totalFrames = 0; 148 | _time = QTime(); 149 | _fps.clear(); 150 | _bitrate.clear(); 151 | _percentage = 0.0; 152 | } -------------------------------------------------------------------------------- /New/src/ui/config.cpp: -------------------------------------------------------------------------------- 1 | #include "framegui.hpp" 2 | 3 | #ifdef Q_OS_WINDOWS 4 | QStringList FrameGUI::configureVS(QString id) { 5 | MediaConfig::resetArguments(); 6 | 7 | MediaConfig::setVsPipe1(); 8 | MediaConfig::setVsPipe2(); 9 | MediaConfig::append(QDir::toNativeSeparators(LOGPATH_WIN + QString("\\job-%1\\%1.vpy").arg(id))); 10 | MediaConfig::append(QString("-")); 11 | 12 | return(MediaConfig::getArguments()); 13 | } 14 | #endif 15 | 16 | QStringList FrameGUI::configureAudioPT(int stream, QString id, QString container) { 17 | MediaConfig::resetArguments(); 18 | 19 | if (stream == 1) { 20 | MediaConfig::setOverride(); 21 | MediaConfig::setInput(); 22 | 23 | #ifdef Q_OS_WINDOWS 24 | MediaConfig::append(QDir::toNativeSeparators(QDir::tempPath() + QString("\\%1").arg(id))); 25 | #endif 26 | #ifdef Q_OS_DARWIN 27 | MediaConfig::append(QDir::toNativeSeparators(TEMPPATH_DAR + QString("/%1").arg(id))); 28 | #endif 29 | 30 | MediaConfig::setInput(); 31 | MediaConfig::append(_ui->SelectInTxtBox->text()); 32 | MediaConfig::setMapAll(QString("v"), QString("0")); 33 | MediaConfig::setVideoCodec(QString("copy")); 34 | } 35 | 36 | if (stream == 1) 37 | MediaConfig::setMapAll(QString("a"), QString("%1").arg(stream)); 38 | 39 | MediaConfig::setAudioCodec(QString("copy")); 40 | MediaConfig::setMapAll(QString("s?"), QString("%1").arg(stream)); 41 | 42 | if (container.contains(QString(".mkv"))) 43 | MediaConfig::setSubtitleCodec("srt"); 44 | else if (container.contains(QString(".mov")) || container.contains(QString(".mp4"))) 45 | MediaConfig::setSubtitleCodec("mov_text"); 46 | 47 | if (stream == 1) { 48 | MediaConfig::setMetaData1(); 49 | MediaConfig::setMetaData2(QString("\"FrameGUI v%1\"").arg(VERSION)); 50 | MediaConfig::setOutput(_ui->SaveOutTxtBox->text() + container); 51 | } 52 | 53 | return(MediaConfig::getArguments()); 54 | } 55 | 56 | QStringList FrameGUI::configureArgs(QString container, QString id, QString vsScript) { 57 | MediaConfig::resetArguments(); 58 | 59 | #ifdef Q_OS_DARWIN 60 | MediaConfig::setVs(); 61 | #endif 62 | 63 | MediaConfig::setOverride(); 64 | MediaConfig::setNoAutoRotate(); 65 | MediaConfig::setInput(); 66 | 67 | #ifdef Q_OS_WINDOWS 68 | MediaConfig::append(QString("-")); 69 | #endif 70 | #ifdef Q_OS_DARWIN 71 | MediaConfig::append(vsScript); 72 | #endif 73 | 74 | if (_ui->IWantDD->currentIndex() == 0) 75 | MediaConfig::setVideoCodec(QString("libx264")); 76 | else { 77 | MediaConfig::setVideoCodec(QString("libx265")); 78 | MediaConfig::setAppleTag(); 79 | } 80 | 81 | MediaConfig::setConstantRateFactor(17); 82 | 83 | if (CHECKED(_ui->UpscaleSetGB)) { 84 | int resH = _ui->OutputResDD->currentText().remove(QString("(")).remove(QString(")")).remove(QString("p")).remove(QString("HD")).remove(QString("F")).remove(QString("Q")).remove(QString("U")).remove(QString("4K")).remove(QString(" ")).toInt(); 85 | double factor = 0; 86 | int outH = 0; 87 | int outW = 0; 88 | 89 | switch (resH) { 90 | case 720: 91 | outW = 1280; 92 | break; 93 | case 1080: 94 | outW = 1920; 95 | break; 96 | case 1440: 97 | outW = 2560; 98 | break; 99 | case 2160: 100 | outW = 3840; 101 | break; 102 | } 103 | 104 | factor = static_cast(outW) / VideoInfo::getWidth(); 105 | outH = static_cast(factor) * VideoInfo::getHeight(); 106 | 107 | if (outH % 2 != 0) 108 | outH++; 109 | 110 | MediaConfig::setVideoResolution(outW, outH); 111 | } 112 | 113 | MediaConfig::setMetaData1(); 114 | MediaConfig::setMetaData2(QString("\"FrameGUI v%1\"").arg(VERSION)); 115 | 116 | if (AudioInfo::totalStreams() == 0 && SubtitleInfo::totalStreams() == 0) 117 | MediaConfig::setOutput(_ui->SaveOutTxtBox->text() + container); 118 | else { 119 | #ifdef Q_OS_WINDOWS 120 | MediaConfig::setOutput(QDir::toNativeSeparators(QDir::tempPath() + QString("\\%1.mkv").arg(id))); 121 | #endif 122 | #ifdef Q_OS_DARWIN 123 | MediaConfig::setOutput(QDir::toNativeSeparators(TEMPPATH_DAR + QString("/%1.mkv").arg(id))); 124 | #endif 125 | } 126 | 127 | return(MediaConfig::getArguments()); 128 | } -------------------------------------------------------------------------------- /Old (DEPRECATED)/EncodeProg/EncodeProg.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {ED40B686-1396-4D0C-A72E-6A65AAB3681D} 8 | Library 9 | Properties 10 | EncodeProg 11 | EncodeProg 12 | v4.7.2 13 | 512 14 | true 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | true 35 | bin\x86\Debug\ 36 | DEBUG;TRACE 37 | full 38 | x86 39 | 7.3 40 | prompt 41 | 42 | 43 | bin\x86\Release\ 44 | TRACE 45 | true 46 | pdbonly 47 | x86 48 | 7.3 49 | prompt 50 | 51 | 52 | true 53 | bin\x64\Debug\ 54 | DEBUG;TRACE 55 | full 56 | x64 57 | 7.3 58 | prompt 59 | 60 | 61 | bin\x64\Release\ 62 | TRACE 63 | true 64 | pdbonly 65 | x64 66 | 7.3 67 | prompt 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | Component 84 | 85 | 86 | ProgressBarLabel.cs 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Handlers/ConversionProgressHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | 4 | namespace FFLoader 5 | { 6 | public class ConversionProgress : EventArgs 7 | { 8 | /// 9 | /// The speed of the conversion progress in FPS. 10 | /// 11 | public float ConversionFPS { get; private set; } 12 | 13 | /// 14 | /// The speed of the conversion progress in bitrate. 15 | /// 16 | public float ConversionBitrate { get; private set; } 17 | 18 | /// 19 | /// The total processed duration of the video being encoded. 20 | /// 21 | public TimeSpan ProcessedDuration { get; private set; } 22 | 23 | /// 24 | /// The estimated time remaining of the process. 25 | /// 26 | public TimeSpan TimeRemaining { get; private set; } 27 | 28 | /// 29 | /// The elapsed time of the current running process. 30 | /// 31 | public TimeSpan TimeElapsed { get; private set; } 32 | 33 | /// 34 | /// The progress percentage of the operation in a integer format. 35 | /// 36 | public int ProgressPercentInt { get; internal set; } 37 | 38 | /// 39 | /// The progress percentage of the operation in a string format. 40 | /// 41 | public string ProgressPercentStrng { get; internal set; } 42 | 43 | /// 44 | /// Lists all aspects of the conversion progress for use in a windows form label. 45 | /// 46 | public string ConversionProgressLabel { get; private set; } 47 | 48 | /// 49 | /// The encoding conversion progress arguments. 50 | /// 51 | /// The FPS at which the conversion is processing. 52 | /// The Bitrate at which the conversion is processing. 53 | /// The Processed Duration at which the conversion is processing. 54 | /// The Total Duration from VideoInfo. Used for the purposes of finding the progress percentage and time remaining. 55 | public ConversionProgress(float fps, float bitrate, double frame, TimeSpan processedDuration, TimeSpan totalDuration, float VIfps, TimeSpan timer) 56 | { 57 | ConversionFPS = fps; 58 | ConversionBitrate = bitrate; 59 | ProcessedDuration = processedDuration; 60 | TimeElapsed = timer; 61 | 62 | double totalFrames = totalDuration.TotalSeconds * VIfps; 63 | double framesLeft = totalFrames - frame; 64 | double timeLeft = framesLeft * (timer.TotalSeconds / frame); 65 | 66 | TimeRemaining = TimeSpan.FromSeconds(Math.Floor(timeLeft)); 67 | 68 | ProgressPercentInt = (int)Math.Round(processedDuration.TotalMilliseconds / totalDuration.TotalMilliseconds * 100, 2); 69 | ProgressPercentStrng = Math.Round(processedDuration.TotalMilliseconds / totalDuration.TotalMilliseconds * 100, 2).ToString(); 70 | 71 | ConversionProgressLabel = $"FPS: {fps}, Bitrate: {bitrate}kb/s, Time left: {TimeRemaining}, Time elapsed: {timer} - " + string.Format("{0:000.00}%", ProgressPercentStrng); 72 | } 73 | 74 | /// 75 | /// Sets ConversionProgress to complete (fixes incomplete progress bug). 76 | /// 77 | /// Percentage in a string format. 78 | /// Instance of the timer for the encoding. 79 | public ConversionProgress(string percent, Stopwatch timer) 80 | { 81 | ProgressPercentInt = 100; 82 | 83 | double ts = timer.Elapsed.TotalSeconds; 84 | TimeSpan timeElapsed = TimeSpan.FromSeconds(Math.Round(ts)); 85 | TimeElapsed = timeElapsed; 86 | 87 | ConversionProgressLabel = $"FPS: {ConversionFPS}, Bitrate: {ConversionBitrate}kb/s, Time left: {TimeRemaining}, Time elapsed: {TimeElapsed} - " + string.Format("{0:000.00}%", percent); 88 | } 89 | } 90 | } 91 | 92 | 93 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/FrameGUI/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 0 16 | 17 | 18 | 3 19 | 20 | 21 | 0 22 | 23 | 24 | 1000 25 | 26 | 27 | 0 28 | 29 | 30 | 22 31 | 32 | 33 | 6 34 | 35 | 36 | 0 37 | 38 | 39 | 2048 40 | 41 | 42 | 16 43 | 44 | 45 | 24 46 | 47 | 48 | 1 49 | 50 | 51 | 1080 52 | 53 | 54 | 1920 55 | 56 | 57 | 9 58 | 59 | 60 | 8 61 | 62 | 63 | False 64 | 65 | 66 | 0 67 | 68 | 69 | 0 70 | 71 | 72 | 60 73 | 74 | 75 | False 76 | 77 | 78 | False 79 | 80 | 81 | True 82 | 83 | 84 | 1 85 | 86 | 87 | False 88 | 89 | 90 | True 91 | 92 | 93 | 0 94 | 95 | 96 | -------------------------------------------------------------------------------- /New/src/checks/process.cpp: -------------------------------------------------------------------------------- 1 | #include "checks.hpp" 2 | 3 | /// 4 | /// Checks to ensure that the audio codec is compatible with the selected output video container. 5 | /// 6 | /// The audio codec index. 7 | /// The output video container. 8 | /// True or false. 9 | bool Checks::checkAudioCompatability(int format, QString container) { 10 | bool result = true; 11 | 12 | switch (format) { 13 | case AAC: 14 | if (container.contains(QString(".mp4")) || container.contains(QString(".mkv")) || container.contains(QString(".mov")) || container.contains(QString(".avi"))) 15 | result = true; 16 | else 17 | result = false; 18 | break; 19 | case MP3: 20 | if (container.contains(QString(".mp4")) || container.contains(QString(".mkv")) || container.contains(QString(".mov")) || container.contains(QString(".avi"))) 21 | result = true; 22 | else 23 | result = false; 24 | break; 25 | case AC3: 26 | if (container.contains(QString(".mp4")) || container.contains(QString(".mkv")) || container.contains(QString(".mov")) || container.contains(QString(".avi"))) 27 | result = true; 28 | else 29 | result = false; 30 | break; 31 | case FLAC: 32 | if (container.contains(QString(".mkv")) || container.contains(QString(".avi"))) 33 | result = true; 34 | else 35 | result = false; 36 | break; 37 | case VORBIS: 38 | if (container.contains(QString(".mp4")) || container.contains(QString(".mkv")) || container.contains(QString(".avi"))) 39 | result = true; 40 | else 41 | result = false; 42 | break; 43 | case OPUS: 44 | if (container.contains(QString(".mp4")) || container.contains(QString(".mkv"))) 45 | result = true; 46 | else 47 | result = false; 48 | break; 49 | case DTS: 50 | if (container.contains(QString(".mp4")) || container.contains(QString(".mkv")) || container.contains(QString(".mov"))) 51 | result = true; 52 | else 53 | result = false; 54 | break; 55 | case TRUEHD: 56 | if (container.contains(QString(".mp4")) || container.contains(QString(".mkv"))) 57 | result = true; 58 | else 59 | result = false; 60 | break; 61 | case EAC3: 62 | if (container.contains(QString(".mp4")) || container.contains(QString(".mkv")) || container.contains(QString(".mov"))) 63 | result = true; 64 | else 65 | result = false; 66 | break; 67 | case ALAC: 68 | if (container.contains(QString(".mp4")) || container.contains(QString(".mkv")) || container.contains(QString(".mov"))) 69 | result = true; 70 | else 71 | result = false; 72 | break; 73 | case WMA: 74 | if (container.contains(QString(".mkv")) || container.contains(QString(".avi"))) 75 | result = true; 76 | else 77 | result = false; 78 | break; 79 | case PCM: 80 | if (container.contains(QString(".mkv")) || container.contains(QString(".mov")) || container.contains(QString(".avi"))) 81 | result = true; 82 | else 83 | result = false; 84 | break; 85 | case MP2: 86 | if (container.contains(QString(".mp4")) || container.contains(QString(".mkv")) || container.contains(QString(".mov")) || container.contains(QString(".avi"))) 87 | result = true; 88 | else 89 | result = false; 90 | break; 91 | } 92 | 93 | return(result); 94 | } 95 | 96 | /// 97 | /// Checks to ensure that the subtitle codec is compatible with the selected output container. 98 | /// 99 | /// The subtitle codec. 100 | /// The output video container. 101 | /// True or false. 102 | bool Checks::checkSubtitleCompatability(QString format, QString container) { 103 | bool result = false; 104 | 105 | if ((format.contains(QString("subrip")) || format.contains(QString("srt"))) && container.contains(QString(".mkv"))) 106 | result = true; 107 | else 108 | result = false; 109 | if (format.contains(QString("webvtt")) && container.contains(QString(".mkv"))) 110 | result = true; 111 | else 112 | result = false; 113 | if ((format.contains(QString("ass")) || format.contains(QString("ssa"))) && container.contains(QString(".mkv"))) 114 | result = true; 115 | else 116 | result = false; 117 | if (format.contains(QString("mov_text")) && (container.contains(QString(".mp4")) || container.contains(QString(".mov")))) 118 | result = true; 119 | else 120 | result = false; 121 | 122 | return(result); 123 | } -------------------------------------------------------------------------------- /New/src/arguments/argument.cpp: -------------------------------------------------------------------------------- 1 | #include "argument.hpp" 2 | 3 | /// 4 | /// Creates an argument for the video codec. 5 | /// 6 | /// The video codec to use. 7 | /// String representation of the argument. 8 | QString Argument::videoCodec(QString codec) { 9 | return(QString("-c:v %1").arg(codec)); 10 | } 11 | 12 | /// 13 | /// Creates an argument for the audio codec. 14 | /// 15 | /// The audio codec to use. 16 | /// String representation of the argument. 17 | QString Argument::audioCodec(QString codec) { 18 | return(QString("-c:a %1").arg(codec)); 19 | } 20 | 21 | /// 22 | /// Creates an argument for the subtitle codec. 23 | /// 24 | /// The subtitle codec to use. 25 | /// String representation of the argument. 26 | QString Argument::subtitleCodec(QString codec) { 27 | return(QString("-c:s %1").arg(codec)); 28 | } 29 | 30 | /// 31 | /// Overrides the output file. 32 | /// 33 | /// String representation of the argument. 34 | QString Argument::override() { 35 | return(QString("-y")); 36 | } 37 | 38 | /// 39 | /// Sets the source video to encode. 40 | /// 41 | /// String representation of the argument. 42 | QString Argument::input() { 43 | return(QString("-i")); 44 | } 45 | 46 | /// 47 | /// Maps all of a particular stream in a video container. 48 | /// 49 | /// The stream type to target. 50 | /// Stream one identifier. 51 | /// String representation of the argument. 52 | QString Argument::mapAll(QString type, QString s1) { 53 | return(QString("-map %1:%2").arg(s1).arg(type)); 54 | } 55 | 56 | /// 57 | /// Sets the constant rate factor value of the video. 58 | /// 59 | /// The constant rate factor value. 60 | /// String representation of the argument. 61 | QString Argument::constantRateFactor(int crf) { 62 | return(QString("-crf %1").arg(crf)); 63 | } 64 | 65 | /// 66 | /// Sets the video resolution to the specified value. 67 | /// 68 | /// The selected width of the video. 69 | /// The selected height of the video. 70 | /// String representation of the argument. 71 | QString Argument::videoResolution(int width, int height) { 72 | return(QString("-filter:v scale=%1x%2").arg(width).arg(height)); 73 | } 74 | 75 | /// 76 | /// Writes string metadata to the video file. 77 | /// 78 | /// String representation of the argument. 79 | QString Argument::metaData1() { 80 | return(QString("-metadata:g")); 81 | } 82 | 83 | /// 84 | /// Writes string metadata to the video file. 85 | /// 86 | /// The string to write. 87 | /// String representation of the argument. 88 | QString Argument::metaData2(QString str) { 89 | return(QString("encoding_tool=%1").arg(str)); 90 | } 91 | 92 | /// 93 | /// Disables the auto rotate feature in FFMpeg. 94 | /// 95 | /// String representation of the argument. 96 | QString Argument::noAutoRotate() { 97 | return(QString("-noautorotate")); 98 | } 99 | 100 | /// 101 | /// Adds tag for "Apple industry standard" HEVC videos. 102 | /// 103 | /// String representation of the argument. 104 | QString Argument::appleTag() { 105 | return(QString("-tag:v hvc1")); 106 | } 107 | 108 | /// 109 | /// Enables vapoursynth script input. 110 | /// 111 | /// String representation of the argument. 112 | QString Argument::vs() { 113 | return(QString("-f vapoursynth")); 114 | } 115 | 116 | #ifdef Q_OS_WINDOWS 117 | /// 118 | /// Configures the pipe for vspipe.exe. 119 | /// 120 | /// String representation of the argument. 121 | QString Argument::vsPipe1() { 122 | return(QString("-c")); 123 | } 124 | 125 | /// 126 | /// Configures the pipe for vspipe.exe. 127 | /// 128 | /// String representation of the argument. 129 | QString Argument::vsPipe2() { 130 | return(QString("y4m")); 131 | } 132 | #endif -------------------------------------------------------------------------------- /Old (DEPRECATED)/FrameGUI/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 0 24 | 25 | 26 | 3 27 | 28 | 29 | 0 30 | 31 | 32 | 1000 33 | 34 | 35 | 0 36 | 37 | 38 | 22 39 | 40 | 41 | 6 42 | 43 | 44 | 0 45 | 46 | 47 | 2048 48 | 49 | 50 | 16 51 | 52 | 53 | 24 54 | 55 | 56 | 1 57 | 58 | 59 | 1080 60 | 61 | 62 | 1920 63 | 64 | 65 | 9 66 | 67 | 68 | 8 69 | 70 | 71 | False 72 | 73 | 74 | 0 75 | 76 | 77 | 0 78 | 79 | 80 | 60 81 | 82 | 83 | False 84 | 85 | 86 | False 87 | 88 | 89 | True 90 | 91 | 92 | 1 93 | 94 | 95 | False 96 | 97 | 98 | True 99 | 100 | 101 | 0 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /New/include/darwin/update.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Update 4 | 5 | 6 | 7 | 0 8 | 0 9 | 550 10 | 294 11 | 12 | 13 | 14 | 15 | 550 16 | 294 17 | 18 | 19 | 20 | 21 | 550 22 | 294 23 | 24 | 25 | 26 | FrameGUI - Updates 27 | 28 | 29 | 30 | 31 | 200 32 | 7 33 | 150 34 | 32 35 | 36 | 37 | 38 | <html><head/><body><p><span style=" font-size:16pt; font-weight:700;">It's Time to Update!</span></p></body></html> 39 | 40 | 41 | Qt::AlignCenter 42 | 43 | 44 | 45 | 46 | 47 | 7 48 | 264 49 | 111 50 | 16 51 | 52 | 53 | 54 | Choose an action: 55 | 56 | 57 | 58 | 59 | 60 | 200 61 | 259 62 | 95 63 | 32 64 | 65 | 66 | 67 | 68 | 0 69 | 32 70 | 71 | 72 | 73 | 74 | 0 75 | 32 76 | 77 | 78 | 79 | 80 | true 81 | 82 | 83 | 84 | Qt::NoFocus 85 | 86 | 87 | Update Now 88 | 89 | 90 | 91 | 92 | 93 | 300 94 | 259 95 | 120 96 | 32 97 | 98 | 99 | 100 | 101 | 0 102 | 32 103 | 104 | 105 | 106 | 107 | 0 108 | 32 109 | 110 | 111 | 112 | Qt::NoFocus 113 | 114 | 115 | Remind Me Later 116 | 117 | 118 | 119 | 120 | 121 | 425 122 | 259 123 | 118 124 | 32 125 | 126 | 127 | 128 | 129 | 0 130 | 32 131 | 132 | 133 | 134 | 135 | 0 136 | 32 137 | 138 | 139 | 140 | Qt::NoFocus 141 | 142 | 143 | Skip This Update 144 | 145 | 146 | 147 | 148 | 149 | 7 150 | 63 151 | 536 152 | 192 153 | 154 | 155 | 156 | 157 | 158 | 159 | 95 160 | 38 161 | 360 162 | 20 163 | 164 | 165 | 166 | Below are the details for the next new update for FrameGUI 167 | 168 | 169 | Qt::AlignCenter 170 | 171 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /New/src/io/videoinfo.cpp: -------------------------------------------------------------------------------- 1 | #include "videoinfo.hpp" 2 | 3 | int VideoInfo::_width; 4 | int VideoInfo::_height; 5 | QTime VideoInfo::_duration; 6 | QString VideoInfo::_videoCodec; 7 | QString VideoInfo::_durationStrng; 8 | QString VideoInfo::_colors; 9 | QString VideoInfo::_matrix; 10 | QString VideoInfo::_transfer; 11 | QString VideoInfo::_primaries; 12 | QString VideoInfo::_frameRate; 13 | 14 | /// 15 | /// Sets the video codec. 16 | /// 17 | /// The codec. 18 | void VideoInfo::setVideoCodec(QString videoCodec) { 19 | _videoCodec = videoCodec; 20 | } 21 | 22 | /// 23 | /// Sets the video duratiom in time. 24 | /// 25 | /// The duration. 26 | void VideoInfo::setDuration(QTime duration) { 27 | _duration = duration; 28 | } 29 | 30 | /// 31 | /// Sets the video duration in a string. 32 | /// 33 | /// The duration. 34 | void VideoInfo::setDurationStrng(QString duration) { 35 | _durationStrng = duration; 36 | } 37 | 38 | /// 39 | /// Sets the video width. 40 | /// 41 | /// The width. 42 | void VideoInfo::setWidth(int width) { 43 | _width = width; 44 | } 45 | 46 | /// 47 | /// Sets the video height. 48 | /// 49 | /// The height. 50 | void VideoInfo::setHeight(int height) { 51 | _height = height; 52 | } 53 | 54 | /// 55 | /// Sets the video colors. 56 | /// 57 | /// The colors. 58 | void VideoInfo::setColors(QString colors) { 59 | _colors = colors; 60 | } 61 | 62 | /// 63 | /// Sets the color matrix. 64 | /// 65 | /// The matrix. 66 | void VideoInfo::setMatrix(QString matrix) { 67 | _matrix = matrix; 68 | } 69 | 70 | /// 71 | /// Sets the color transfer. 72 | /// 73 | /// The transfer. 74 | void VideoInfo::setTransfer(QString transfer) { 75 | _transfer = transfer; 76 | } 77 | 78 | /// 79 | /// Sets the color primaries. 80 | /// 81 | /// The primaries. 82 | void VideoInfo::setPrimaries(QString primaries) { 83 | _primaries = primaries; 84 | } 85 | 86 | /// 87 | /// Sets the video frame rate. 88 | /// 89 | /// The frame rate. 90 | void VideoInfo::setFrameRate(QString frameRate) { 91 | _frameRate = frameRate; 92 | } 93 | 94 | /// 95 | /// Gets the video codec. 96 | /// 97 | /// The video codec. 98 | QString VideoInfo::getVideoCodec() { 99 | return(_videoCodec); 100 | } 101 | 102 | /// 103 | /// Gets the duration time. 104 | /// 105 | /// The duration. 106 | QTime VideoInfo::getDuration() { 107 | return(_duration); 108 | } 109 | 110 | /// 111 | /// Gets the duration string. 112 | /// 113 | /// The duration. 114 | QString VideoInfo::getDurationStrng() { 115 | return(_durationStrng); 116 | } 117 | 118 | /// 119 | /// Gets the video width. 120 | /// 121 | /// The width. 122 | int VideoInfo::getWidth() { 123 | return(_width); 124 | } 125 | 126 | /// 127 | /// Gets the video height. 128 | /// 129 | /// The height. 130 | int VideoInfo::getHeight() { 131 | return(_height); 132 | } 133 | 134 | /// 135 | /// Gets the video colors. 136 | /// 137 | /// The colors. 138 | QString VideoInfo::getColors() { 139 | return(_colors); 140 | } 141 | 142 | /// 143 | /// Gets the color matrix. 144 | /// 145 | /// The matrix. 146 | QString VideoInfo::getMatrix() { 147 | return(_matrix); 148 | } 149 | 150 | /// 151 | /// Gets the color transfer. 152 | /// 153 | /// The transfer. 154 | QString VideoInfo::getTransfer() { 155 | return(_transfer); 156 | } 157 | 158 | /// 159 | /// Gets the color primaries. 160 | /// 161 | /// The primaries. 162 | QString VideoInfo::getPrimaries() { 163 | return(_primaries); 164 | } 165 | 166 | /// 167 | /// Gets the video frame rate. 168 | /// 169 | /// The frame rate. 170 | QString VideoInfo::getFrameRate() { 171 | return(_frameRate); 172 | } 173 | 174 | /// 175 | /// Resets all private variables. 176 | /// 177 | void VideoInfo::clearAll() { 178 | _videoCodec = QString("?"); 179 | _duration = QTime(0, 0, 0, 0); 180 | _durationStrng = QString("?"); 181 | _width = 0; 182 | _height = 0; 183 | _colors = QString("?"); 184 | _matrix = QString("?"); 185 | _transfer = QString("?"); 186 | _primaries = QString("?"); 187 | _frameRate = QString("?"); 188 | } -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/FFEvents.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FFLoader 4 | { 5 | public partial class FFLoaderBase 6 | { 7 | /// 8 | /// Raises when conversion progress info is availible. 9 | /// 10 | public event EventHandler FFConversionProgress; 11 | 12 | /// 13 | /// Raises when video info is availible. 14 | /// 15 | public event EventHandler FFVideoInfo; 16 | 17 | /// 18 | /// Raises when a problem occurs within FFLoader. 19 | /// 20 | public event EventHandler FFLoaderException; 21 | 22 | /// 23 | /// Raises when a problem occurs within AviSynth+ 24 | /// 25 | public event EventHandler AviSynthError; 26 | 27 | /// 28 | /// Raises when a problem occures within FFMpeg. 29 | /// 30 | public event EventHandler FFMpegError; 31 | 32 | /// 33 | /// Raises when Regex finds the FPS of the input video in FFMpeg. 34 | /// 35 | public event EventHandler FPSHandler; 36 | 37 | /// 38 | /// Catches the FFLoader exception message and creates a new instance of FFExceptionHandler from it. 39 | /// 40 | /// The exception message. 41 | /// Instace of FFExceptionHandler. 42 | internal void CatchException(string message, out FFExceptionHandler handler) 43 | { 44 | handler = new FFExceptionHandler(message); 45 | } 46 | 47 | /// 48 | /// Catches the AviSynth+ error message and creates a new instance of AviSynthErrorHandler from it. 49 | /// 50 | /// The AviSynth+ error message. 51 | /// Instance of AviSynthErrorHandler. 52 | internal void CatchAvsError(string error, out AviSynthErrorHandler handler) 53 | { 54 | handler = new AviSynthErrorHandler(error); 55 | } 56 | 57 | /// 58 | /// Catches the FFMpeg error (if exists) and creates event arguments of it. 59 | /// 60 | /// The FFMpeg error message. 61 | /// Instance of FFMpegErrorHandler. 62 | internal void CatchFFMpegError(string error, out FFMpegErrorHandler handler) 63 | { 64 | handler = new FFMpegErrorHandler(error); 65 | } 66 | 67 | /// 68 | /// Provides a method to update the AviSynthError event from the AviSynthErrorHandler event handler. 69 | /// 70 | /// Instance of AviSynthErrorHandler. 71 | internal virtual void UpdateAvsError(AviSynthErrorHandler handler) 72 | { 73 | AviSynthError?.Invoke(this, handler); 74 | } 75 | 76 | /// 77 | /// Provides a method to update the FFMpegError event from the FFMpegErrorHandler event handler. 78 | /// 79 | /// Instance of FFMpegErrorHandler. 80 | internal virtual void UpdateFFMpegError(FFMpegErrorHandler handler) 81 | { 82 | FFMpegError?.Invoke(this, handler); 83 | } 84 | 85 | /// 86 | /// Provides a method to update the FFConversionProgress event from the ConversionProgress event handler. 87 | /// 88 | /// Instance of ConversionProgress. 89 | internal virtual void UpdateConversionProgress(ConversionProgress progress) 90 | { 91 | FFConversionProgress?.Invoke(this, progress); 92 | } 93 | 94 | /// 95 | /// Provides a method to update the FPSHandler event from the InfoFPSHandler event handler. 96 | /// 97 | /// Instance of InfoFPSHandler. 98 | internal virtual void UpdateInputVideoFPS(InfoFPSHandler handler) 99 | { 100 | FPSHandler?.Invoke(this, handler); 101 | } 102 | 103 | /// 104 | /// Provides a method to update the FFVideoInfo event from the VideoInfoHandler event handler. 105 | /// 106 | /// Instace of VideoInfoHandler. 107 | internal virtual void UpdateVideoInfo(VideoInfoHandler info) 108 | { 109 | FFVideoInfo?.Invoke(this, info); 110 | } 111 | 112 | /// 113 | /// Provides a method to update the FFLoaderException event from the FFExceptionHandler event handler. 114 | /// 115 | /// Instance of FFExceptionHandler. 116 | internal virtual void UpdateException(FFExceptionHandler handler) 117 | { 118 | FFLoaderException?.Invoke(this, handler); 119 | } 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Handlers/VideoInfoHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FFLoader 4 | { 5 | public class VideoInfoHandler : EventArgs 6 | { 7 | /// 8 | /// The framerate of the video. 9 | /// 10 | public float FrameRate { get; private set; } 11 | 12 | /// 13 | /// The total amount of frames in the video. 14 | /// 15 | public double TotalFrames { get; private set; } 16 | 17 | /// 18 | /// The bitrate of the video. 19 | /// 20 | public double VideoBitrate { get; private set; } 21 | 22 | /// 23 | /// The total duration of the video. 24 | /// 25 | public TimeSpan Duration { get; private set; } 26 | 27 | /// 28 | /// The video codec used to encode the video. 29 | /// 30 | public string VideoCodec { get; private set; } 31 | 32 | /// 33 | /// The scan type of the video. 34 | /// 35 | public string ScanType { get; internal set; } 36 | 37 | /// 38 | /// The video resolution. 39 | /// 40 | public string VideoResolution { get; internal set; } 41 | 42 | /// 43 | /// The aspect ratio of the video. 44 | /// 45 | public string VideoAspectRatio { get; internal set; } 46 | 47 | /// 48 | /// The luminance of the video 49 | /// 50 | public string Luminance { get; internal set; } 51 | 52 | /// 53 | /// The color profile of the video. 54 | /// 55 | public string PixelFormat { get; internal set; } 56 | 57 | /// 58 | /// The audio codec used while encoding the video. 59 | /// 60 | public string AudioCodec { get; internal set; } 61 | 62 | /// 63 | /// The audio sample rate in Hz. 64 | /// 65 | public double AudioSampleRate { get; internal set; } 66 | 67 | /// 68 | /// The channel count of the audio. 69 | /// 70 | public float AudioDownMix { get; internal set; } 71 | 72 | /// 73 | /// The audio bitrate. 74 | /// 75 | public double AudioBitrate { get; internal set; } 76 | 77 | /// 78 | /// The language that the audio file is in. 79 | /// 80 | public string AudioLanguage { get; internal set; } 81 | 82 | /// 83 | /// Language of the subtitle if exists. 84 | /// 85 | public string SubtitleLanguage { get; internal set; } 86 | 87 | /// 88 | /// Grabs all video info from the FFMpeg console and creates event arguments. 89 | /// 90 | /// The frames per second. 91 | /// The video bitrate. 92 | /// The total duration of the video. 93 | /// The video codec. 94 | /// The scan type of the video. 95 | /// The resolution of the video in pixels. 96 | /// The aspect ratio of the video. 97 | /// The luminance of the video. 98 | /// The pixel format of the video. 99 | /// The audio codec in the video. 100 | /// The audio sample rate in the video. 101 | /// The audio downmix (channels) in the video. 102 | /// The audio bitrate in the video. 103 | /// The language of the audio in the video. 104 | /// The language of the subtitles in the video. 105 | public VideoInfoHandler(float fps, double vBitrate, TimeSpan duration, string vCodec, string scanType, string videoResolution, 106 | string videoRatio, string luminance, string pixelFormat, string aCodec, double audioSR, float audioDM, 107 | double aBitrate, string audioLang, string subLang) 108 | { 109 | FrameRate = fps; 110 | TotalFrames = (int)fps * duration.TotalSeconds; 111 | VideoBitrate = vBitrate; 112 | Duration = duration; 113 | VideoCodec = vCodec; 114 | ScanType = scanType; 115 | VideoResolution = videoResolution; 116 | VideoAspectRatio = videoRatio; 117 | Luminance = luminance; 118 | PixelFormat = pixelFormat.ToUpper(); 119 | AudioCodec = aCodec; 120 | AudioSampleRate = audioSR; 121 | AudioDownMix = audioDM; 122 | AudioBitrate = aBitrate; 123 | AudioLanguage = audioLang; 124 | SubtitleLanguage = subLang; 125 | } 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /Old (DEPRECATED)/CHANGELOG: -------------------------------------------------------------------------------- 1 | =========================================================================================== 2 | [08/28/2021]: FrameGUI v1.0 3 | 4 | Initial release. 5 | =========================================================================================== 6 | 7 | =========================================================================================== 8 | [08/30/2021]: FrameGUI v1.0.2 9 | 10 | - Fixed an issue where an FFMpeg error would be thrown if a user quickly cancels the encoding process. A message box will show instead prompting the users to wait for the process to initialize before canceling the process. 11 | - Fixed an issue where the computer will go to sleep (if enabled) while an encoding process is running. While a process is running in FrameGUI, sleep mode will be temporarily disabled until that process is finished or canceled. 12 | - Extended the maximum output fps selection in the SVPFlow noob helper. The maximum output fps a user can select is 140fps. 13 | - Extended the maximum thread count for AviSynth+. The maximum thread count you can define for AviSynth+ is 25, this is for better performance with larger videos (i.e. 4K) 14 | =========================================================================================== 15 | 16 | =========================================================================================== 17 | [08/31/2021]: FrameGUI v1.0.3 18 | 19 | - Fixed an issue where an "AviSynth+ is missing" error would be thrown if the user didn't use AviSynth+ (i.e. when it's not required). 20 | - Added the option to open FrameGUI's log path on a button click so that the user doesn't have to use file explorer manually to navigate to the files. See the "Open Logs Path" button in Other Settings section. 21 | =========================================================================================== 22 | 23 | =========================================================================================== 24 | [09/01/2021]: FrameGUI v1.0.5 25 | 26 | - Fixed an issue where an FFMpeg error would be thrown if SVPFlow was used and there was no audio track in the video. 27 | - Added the option to mute the audio in the video. See the "Mute audio" checkbox in the "Audio" tab. 28 | =========================================================================================== 29 | 30 | =========================================================================================== 31 | [09/09/2021]: FrameGUI v1.1 32 | 33 | - Completely redesigned the conversion progress info and progress bar by implementing a custom progress bar control with text. The progress bar will change colors based on the process state (green: running, red: cancelled/error). 34 | - "Duration left" conversion progress info property was replaced with a "Time left" conversion progress info property. Accuracy is within 2% based on multiple tests. 35 | - "Time elapsed" conversion progress info property added. This property will also be displayed in the encoding complete message box. 36 | - The progress percentage in the conversion progress info will now display up to two decimal places. 37 | - FrameGUI now supports DPI-awareness. With this change, FRAMEGUI WILL NOW ONLY WORK ON WINDOWS 10 (CREATOR UPDATE) AND ABOVE. If you aren't using Windows 10 then don't update to v1.1! The DPI-awareness allows the controls to be clearer and appear as higher quality. 38 | 39 | Known issues: 40 | - When selecting "Mute audio" checkbox in the "Audio" tab and starting an encode, towards the end of the process, the conversion progress info will display as incomplete even though the process is truly complete. 41 | =========================================================================================== 42 | 43 | =========================================================================================== 44 | [9/13/2021]: FrameGUI v1.1.2 45 | 46 | - Fixed the conversion progress issue: When selecting "Mute audio" checkbox in the "Audio" tab and starting an encode, towards the end of the process, the conversion progress info will display as incomplete even though the process is truly complete. This issue was also present on normal processes. 47 | =========================================================================================== 48 | 49 | =========================================================================================== 50 | [10/10/2021]: FrameGUI v1.2 51 | 52 | - Added the all new One-click encoding method in FrameGUI. Users only have to define the input video path and the output and click `Start Encode`. 53 | - The input frame rate in the noob helper in the SVPFlow tab is now automatically detected. 54 | - Fixed an issue where the output fps of the video won't change even if the user uses SVPFlow. 55 | - Idiot protection for if the user doesn't use the SVPFlow method for frame interpolation but uses the regular frame rate adjustment option in the `Video (x264)` tab. 56 | =========================================================================================== 57 | 58 | =========================================================================================== 59 | [11/12/2021]: FrameGUI v1.2.3 60 | 61 | - Fixed the icon quality (initially blurry on high DPI profile) 62 | - Fixed an issue where a video recorded in portrait mode would automatically rotate to landscape 63 | - The progress bar is now animated in accordance with the native windows progress bar style 64 | - Removed the bold font on most controls 65 | - FrameGUI will now check for AviSynth+ installation on drives D, E, and F even if Windows is installed on a different drive other than C. 66 | =========================================================================================== 67 | -------------------------------------------------------------------------------- /New/include/framegui.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #include "scriptbuilder.hpp" 22 | #include "mediaconfig.hpp" 23 | #include "ffloader.hpp" 24 | #include "checks.hpp" 25 | #include "audioinfo.hpp" 26 | #include "subtitleinfo.hpp" 27 | 28 | #ifdef Q_OS_WINDOWS 29 | #include "windows/ui_framegui.hpp" 30 | #include "dxgi.h" 31 | #pragma comment(lib, "dxgi.lib") 32 | #endif 33 | #ifdef Q_OS_DARWIN 34 | #include "darwin/ui_framegui.hpp" 35 | #include 36 | #include 37 | #include 38 | #endif 39 | #include "update.hpp" 40 | 41 | #define FOR_EACH(total) for (int i = 0; i < total; i++) 42 | #define SET_ENABLED(control) (control->setEnabled(true)) 43 | #define SET_DISABLED(control) (control->setEnabled(false)) 44 | #define SET_VISIBLE(control) (control->setVisible(true)) 45 | #define SET_INVISIBLE(control) (control->setVisible(false)) 46 | #define CHECKED(control) (control->isChecked()) 47 | 48 | #define VERSION (QString("2.2.0")) 49 | #define VSPIPEPATH (QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + QString("\\vs\\vspipe.exe"))) 50 | #define TEMPPATH_DAR (QDir::toNativeSeparators(QDir::homePath() + QString("/Library/Caches/TemporaryItems"))) 51 | #define FFMPEGPATH_WIN (QDir::toNativeSeparators(QApplication::applicationDirPath() + QString("\\ffmpeg\\ffmpeg.exe"))) 52 | #define FFMPEGPATH_DAR (QDir::toNativeSeparators(QApplication::applicationDirPath() + QString("/lib/ffmpeg"))) 53 | #define LOGPATH_WIN (QDir::toNativeSeparators(QDir::homePath() + QString("\\AppData\\Local\\FrameGUI"))) 54 | #define LOGPATH_DAR (QDir::toNativeSeparators(TEMPPATH_DAR + QString("/FrameGUI"))) 55 | 56 | class FrameGUI : public QMainWindow { 57 | Q_OBJECT 58 | 59 | public: 60 | FrameGUI(QWidget *parent = Q_NULLPTR); 61 | ~FrameGUI(); 62 | 63 | private: 64 | Ui::FrameGUIClass *_ui; 65 | 66 | enum MessageType { 67 | Error = 0, 68 | Warning = 1, 69 | Info = 2, 70 | Question = 3 71 | }; 72 | 73 | QMessageBox::StandardButton msgBoxHelper(MessageType type, QString title, QString message, QMessageBox::StandardButton button1, QMessageBox::StandardButton button2, QMessageBox::StandardButton button3); 74 | 75 | int _selectedJob; 76 | bool _encodingAudio; 77 | 78 | QVariantList _audioArgs; 79 | QVariantList _arguments; 80 | QStringList *_gpuNames; 81 | QStringList *_job; 82 | QStringList *_inputList; 83 | QStringList *_outputList; 84 | QStringList *_tempList; 85 | QStringList *_state; 86 | 87 | QVariantList _sAudioArgs; 88 | QVariantList _sArguments; 89 | QVariantList _sJob; 90 | QVariantList _sInputList; 91 | QVariantList _sOutputList; 92 | QVariantList _sTempList; 93 | QVariantList _sState; 94 | QVariantList _sDuration; 95 | QVariantList _sFrameRate; 96 | 97 | #ifdef Q_OS_WINDOWS 98 | QVariantList _vapourScript; 99 | QVariantList _sVapourScript; 100 | #endif 101 | 102 | QStringList *_fileStream; 103 | QFile *_logFile; 104 | QString _version; 105 | 106 | FFLoader *_ffloader; 107 | Update *_update; 108 | 109 | QList *_inputBttn; 110 | QList *_outputBttn; 111 | QList *_logsBttn; 112 | 113 | void dragEnterEvent(QDragEnterEvent *d); 114 | void paletter(QLabel *label); 115 | void dropEvent(QDropEvent *d); 116 | void getVideoInfo(QString input, QString ffprobe); 117 | void loadSysSetting(); 118 | void saveSettings(); 119 | void setJobSetting(); 120 | void reIndexBttns(); 121 | void openLogs(); 122 | void setupQueue(); 123 | void bttns(); 124 | void newJob(); 125 | void newTask(); 126 | void gpuFinished(); 127 | void setState(); 128 | void updater(); 129 | 130 | #ifdef Q_OS_WINDOWS 131 | QStringList configureVS(QString id); 132 | #endif 133 | 134 | QString buildScript(int width, int height, QString jobID); 135 | QStringList configureAudioPT(int stream, QString id, QString container); 136 | QStringList configureArgs(QString container, QString id, QString vsScript); 137 | QString checkEnviornment(); 138 | 139 | int decimalCounter(QString value); 140 | 141 | private slots: 142 | void updaterFinished(); 143 | void inputBttn(); 144 | void donateDaGoose(); 145 | void cancelClick(); 146 | void pauseClick(); 147 | void createJob(); 148 | void cancelMain(); 149 | void clearFinished(); 150 | void licenseBttn(); 151 | void upscaleSet(); 152 | void convertSet(); 153 | void outBttn(); 154 | void youClick(); 155 | void disClick(); 156 | void igClick(); 157 | void removeJob(); 158 | void inputClick(); 159 | void outputClick(); 160 | void openOutput(); 161 | void openJobLogs(); 162 | void start(); 163 | void skip(); 164 | void goToUpdate(); 165 | void later(); 166 | void resetJob(); 167 | void jobBttn(); 168 | void jobBttn2(); 169 | void clearBttn(); 170 | void regexFinished(); 171 | void cancelAllClick(); 172 | void updateProgress(); 173 | void encodeFinished(); 174 | void writeFile(QString); 175 | void jobContext(QPoint); 176 | 177 | protected: 178 | void closeEvent(QCloseEvent *event); 179 | void showEvent(QShowEvent *event); 180 | }; -------------------------------------------------------------------------------- /Old (DEPRECATED)/FrameGUI/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /New/src/process/ffloader.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (C) 2023 DaGoose 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Affero General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. If not, see . 16 | ****************************************************************************/ 17 | 18 | #include "ffloader.hpp" 19 | 20 | void FFLoader::encode(QStringList args, QStringList vsArgs, QString ffmpeg, QString vsPipe) { 21 | _encode = new QProcess(); 22 | 23 | connector(_encode, ProcessType::Encode); 24 | connector(_encode, ProcessType::EncodeFinish); 25 | _pauseTime = new QTime(0, 0, 0); 26 | _timer = new QElapsedTimer(); 27 | _timer->restart(); 28 | 29 | #ifdef Q_OS_WINDOWS 30 | if (!vsArgs.isEmpty()) { 31 | _vs = new QProcess(); 32 | connector(_vs, ProcessType::VS); 33 | 34 | _vs->setStandardOutputProcess(_encode); 35 | newProcess(_vs, vsArgs, vsPipe); 36 | } 37 | #endif 38 | 39 | newProcess(_encode, args, ffmpeg); 40 | } 41 | 42 | void FFLoader::videoInfo(QStringList args, QString ffprobe) { 43 | _video = new QProcess(); 44 | 45 | connector(_video, ProcessType::VideoInfo); 46 | connector(_video, ProcessType::VideoFinish); 47 | newProcess(_video, args, ffprobe); 48 | } 49 | 50 | void FFLoader::outputDataVideo() { 51 | outputData(_video, ProcessType::VideoInfo); 52 | } 53 | 54 | void FFLoader::outputDataInfo() { 55 | outputData(_encode, ProcessType::Encode); 56 | } 57 | 58 | #ifdef Q_OS_WINDOWS 59 | void FFLoader::outputDataVS() { 60 | outputData(_vs, ProcessType::VS); 61 | } 62 | #endif 63 | 64 | void FFLoader::videoFinished() { 65 | finisher(_video, ProcessType::VideoFinish); 66 | } 67 | 68 | void FFLoader::encodeFinished() { 69 | finisher(_encode, ProcessType::EncodeFinish); 70 | } 71 | 72 | void FFLoader::outputData(QProcess *process, ProcessType type) { 73 | process->setReadChannel(QProcess::StandardError); 74 | 75 | QTextStream stream(process); 76 | QString output; 77 | 78 | while (!stream.atEnd()) { 79 | output = stream.readLine(0); 80 | 81 | if (type == ProcessType::Encode || type == ProcessType::VS) { 82 | ProcessErrorRegex::errorRegex(output); 83 | 84 | #ifdef Q_OS_WINDOWS 85 | if (type == ProcessType::VS && !output.contains(QString("Creating lwi index file"))) 86 | emit logs(output); 87 | #endif 88 | } 89 | 90 | switch (type) { 91 | case ProcessType::Encode: 92 | if (ProgressInfoRegex::progressRegex(output, VideoInfoList::getDuration(_currentJob), VideoInfoList::getFrameRate(_currentJob).trimmed().toDouble() 93 | * QTime(0, 0, 0, 0).secsTo(VideoInfoList::getDuration(_currentJob)), *_timer, *_pauseTime)) 94 | emit setProgress(); 95 | else 96 | emit logs(output); 97 | 98 | break; 99 | case ProcessType::VideoInfo: 100 | VideoInfoRegex::durationBitrateRegex(output); 101 | VideoInfoRegex::videoInfoerRegex(output); 102 | AudioSubInfoRegex::audioInfoRegex(output); 103 | AudioSubInfoRegex::subInfoRegex(output); 104 | break; 105 | } 106 | } 107 | } 108 | 109 | void FFLoader::finisher(QProcess *process, ProcessType type) { 110 | switch (type) { 111 | case ProcessType::EncodeFinish: 112 | disconnecter(process, ProcessType::EncodeFinish); 113 | disconnecter(process, ProcessType::Encode); 114 | 115 | #ifdef Q_OS_WINDOWS 116 | if (_vs) 117 | disconnecter(_vs, ProcessType::VS); 118 | #endif 119 | 120 | emit completed(); 121 | break; 122 | case ProcessType::VideoFinish: 123 | disconnecter(process, ProcessType::VideoFinish); 124 | disconnecter(process, ProcessType::VideoInfo); 125 | emit setVideoInfo(); 126 | break; 127 | } 128 | 129 | deconstruct(process); 130 | } 131 | 132 | void FFLoader::connector(QProcess *process, ProcessType type) { 133 | switch (type) { 134 | case ProcessType::Encode: 135 | process->connect(process, &QProcess::readyReadStandardError, this, &FFLoader::outputDataInfo); 136 | break; 137 | case ProcessType::VideoInfo: 138 | process->connect(process, &QProcess::readyReadStandardError, this, &FFLoader::outputDataVideo); 139 | break; 140 | 141 | #ifdef Q_OS_WINDOWS 142 | case ProcessType::VS: 143 | process->connect(process, &QProcess::readyReadStandardError, this, &FFLoader::outputDataVS); 144 | break; 145 | #endif 146 | 147 | case ProcessType::VideoFinish: 148 | process->connect(process, &QProcess::finished, this, &FFLoader::videoFinished); 149 | break; 150 | case ProcessType::EncodeFinish: 151 | process->connect(process, &QProcess::finished, this, &FFLoader::encodeFinished); 152 | break; 153 | } 154 | } 155 | 156 | void FFLoader::disconnecter(QProcess *process, ProcessType type) { 157 | switch (type) { 158 | case ProcessType::Encode: 159 | process->disconnect(process, &QProcess::readyReadStandardError, this, &FFLoader::outputDataInfo); 160 | break; 161 | case ProcessType::VideoInfo: 162 | process->disconnect(process, &QProcess::readyReadStandardError, this, &FFLoader::outputDataVideo); 163 | break; 164 | 165 | #ifdef Q_OS_WINDOWS 166 | case ProcessType::VS: 167 | process->disconnect(process, &QProcess::readyReadStandardError, this, &FFLoader::outputDataVS); 168 | break; 169 | #endif 170 | 171 | case ProcessType::VideoFinish: 172 | process->disconnect(process, &QProcess::finished, this, &FFLoader::videoFinished); 173 | break; 174 | case ProcessType::EncodeFinish: 175 | process->disconnect(process, &QProcess::finished, this, &FFLoader::encodeFinished); 176 | break; 177 | } 178 | 179 | process->closeReadChannel(QProcess::StandardError); 180 | } -------------------------------------------------------------------------------- /New/src/regex/videoinforegex.cpp: -------------------------------------------------------------------------------- 1 | #include "videoinforegex.hpp" 2 | 3 | QList VideoInfoRegex::_indexer; 4 | QString VideoInfoRegex::_durationLine; 5 | 6 | void VideoInfoRegex::setupPatterns() { 7 | _indexer << QRegularExpression(QString("(\\s*?Duration:\\s[0-9]*:[0-9]*:[^\\.]*\\.[^,]*,\\s?start:\\s?-?[0-9]*\\.[^,]*,\\s?bitrate:\\s?[0-9]*\\s?kb/s)")); // duration/bitrate 8 | _indexer << QRegularExpression(QString("Stream\\s#0:[0-9]*[^V]*Video:\\s*([^,]*)[^(]*\\(?([^)]*)\\)?,\\s?[^\\s]*[^,]*?,?\\s?[^\\s]*")); // video info line 9 | _indexer << QRegularExpression(QString("\\s?([0-9]*)\\s?kb/s")); // bitrate 10 | _indexer << QRegularExpression(QString("([0-9]*):([0-9]*):([0-9]*)\\.([^,]*)")); // duration 11 | _indexer << QRegularExpression(QString("([^,/]*),?([^,/]*),?/?([^/\\s]*)/?([^/\\s]*),?")); // colors 12 | _indexer << QRegularExpression(QString("(\\d*\\.?\\d*?)\\s?fps")); // fps 13 | _indexer << QRegularExpression(QString("(\\d*\\.?\\d*?)\\s?tbr")); // tbr 14 | _indexer << QRegularExpression(QString("\\s(\\d*[0-9]*)x(\\d*)\\s?,?")); // resolution 15 | _indexer << QRegularExpression(QString("\\)?,\\s([a-z]*)([0-9])([0-9])([0-9])p([0-9]*)\\w*,?\\(?")); // pixel format 16 | _indexer << QRegularExpression(QString("(Stream\\s#0:[0-9]*[^V]*Video:\\s*[^,]*)")); // video info (part) 17 | _indexer << QRegularExpression(QString("([^\\s]*)")); // codec 18 | _indexer << QRegularExpression(QString("\\[[0-9]\\s([^\\]]*)\\]\\s*queueC=")); // gpu 19 | } 20 | 21 | void VideoInfoRegex::durationBitrateRegex(QString output) { 22 | if (_indexer.isEmpty()) 23 | setupPatterns(); 24 | 25 | QRegularExpressionMatch matchDuration(_indexer.at(GetInfo::DurationBitrate).match(output)); 26 | 27 | if (!matchDuration.hasMatch()) 28 | return; 29 | else 30 | _durationLine = matchDuration.captured(1); 31 | } 32 | 33 | void VideoInfoRegex::videoInfoerRegex(QString output) { 34 | if (output.contains(QString("attached pic")) || output.contains(QString("mjpeg")) || output.contains(QString("png")) || output.contains(QString("gif")) || output.contains(QString("tiff")) || output.contains(QString("bmp")) || 35 | output.contains(QString("heic")) || output.contains(QString("tga")) || output.contains(QString("webp")) || output.contains(QString("avif"))) 36 | return; 37 | 38 | QRegularExpressionMatch matchVideoInfo(_indexer.at(GetInfo::VideoInfo).match(output)); 39 | 40 | QString durationStrng, colors, matrix, transfer, primaries, frameRate; 41 | QTime duration; 42 | int width, height; 43 | 44 | if (!matchVideoInfo.hasMatch()) 45 | return; 46 | else { 47 | QString remove(_indexer.at(GetInfo::VideoInfoPart).match(output).captured(1)); 48 | QString videoCodec(_indexer.at(GetInfo::Codec).match(matchVideoInfo.captured(1)).captured(1)); 49 | 50 | if (!_durationLine.isEmpty()) { 51 | durationStrng = QString("%1:%2:%3.%4").arg(_indexer.at(GetInfo::Duration).match(_durationLine).captured(1)).arg(_indexer.at(GetInfo::Duration).match(_durationLine).captured(2)). 52 | arg(_indexer.at(GetInfo::Duration).match(_durationLine).captured(3)).arg(_indexer.at(GetInfo::Duration).match(_durationLine).captured(4)); 53 | duration = QTime(_indexer.at(GetInfo::Duration).match(_durationLine).captured(1).toInt(), _indexer.at(GetInfo::Duration).match(_durationLine).captured(2).toInt(), 54 | _indexer.at(GetInfo::Duration).match(_durationLine).captured(3).toInt(), _indexer.at(GetInfo::Duration).match(_durationLine).captured(4).toInt()); 55 | } 56 | 57 | if (!_indexer.at(GetInfo::PixFormat).match(output).captured(2).isEmpty()) { 58 | colors = _indexer.at(GetInfo::PixFormat).match(output).captured(2) + QString(':') + _indexer.at(GetInfo::PixFormat).match(output).captured(3) + 59 | QString(':') + _indexer.at(GetInfo::PixFormat).match(output).captured(4) + QString('/'); 60 | 61 | if (_indexer.at(GetInfo::PixFormat).match(output).captured(5).isEmpty()) 62 | colors += QString("8-bit"); 63 | else 64 | colors += _indexer.at(GetInfo::PixFormat).match(output).captured(5) + QString("-bit"); 65 | } 66 | else 67 | colors = QString("?"); 68 | 69 | width = _indexer.at(GetInfo::Resolution).match(output.remove(remove)).captured(1).toInt(); 70 | height = _indexer.at(GetInfo::Resolution).match(output.remove(remove)).captured(2).toInt(); 71 | 72 | if (_indexer.at(GetInfo::Colors).match(matchVideoInfo.captured(2)).captured(2).isEmpty()) 73 | matrix = _indexer.at(GetInfo::Colors).match(matchVideoInfo.captured(2)).captured(1); 74 | else 75 | matrix = _indexer.at(GetInfo::Colors).match(matchVideoInfo.captured(2)).captured(2); 76 | 77 | transfer = _indexer.at(GetInfo::Colors).match(matchVideoInfo.captured(2)).captured(4); 78 | primaries = _indexer.at(GetInfo::Colors).match(matchVideoInfo.captured(2)).captured(3); 79 | 80 | if (!_indexer.at(GetInfo::Fps).match(output).hasMatch()) 81 | frameRate = _indexer.at(GetInfo::Tbr).match(output).captured(1); 82 | else 83 | frameRate = _indexer.at(GetInfo::Fps).match(output).captured(1); 84 | 85 | if (matrix.contains(QString("progressive")) || matrix.contains(QString("interlaced")) || matrix.contains(QString("tv")) || 86 | matrix.contains(QString("top first")) || matrix.contains(QString("full")) || matrix.isEmpty()) { 87 | 88 | matrix = QString("?"); 89 | } 90 | if (transfer.isEmpty()) 91 | transfer = QString("?"); 92 | if (primaries.isEmpty()) 93 | primaries = QString("?"); 94 | if (videoCodec.isEmpty()) 95 | videoCodec = QString("?"); 96 | 97 | transfer.remove(QString(',')); 98 | videoCodec.remove(QString(',')); 99 | 100 | if (videoCodec.contains(QString("h264"))) 101 | videoCodec = QString("AVC"); 102 | if (videoCodec.contains(QString("theora"))) 103 | videoCodec = QString("Theora"); 104 | else if (videoCodec.contains(QString("prores"))) 105 | videoCodec = QString("ProRes"); 106 | else if (videoCodec.contains(QString("video"))) 107 | videoCodec = videoCodec.remove(QString("video")).toUpper(); 108 | else if (videoCodec.contains(QString("huffyuv"))) 109 | videoCodec = QString("HuffYUV"); 110 | else 111 | videoCodec = videoCodec.toUpper(); 112 | 113 | if (frameRate.isEmpty()) 114 | frameRate = QString("?"); 115 | if (durationStrng.isEmpty()) 116 | durationStrng = QString("?"); 117 | 118 | if (frameRate.contains(QString("23.98"))) 119 | frameRate = QString("23.976"); // assume 120 | if (frameRate.contains(QString("47.96"))) 121 | frameRate = QString("47.952"); // assume 122 | if (frameRate.contains(QString("95.91"))) 123 | frameRate = QString("95.904"); // assume 124 | 125 | #ifdef VIDEOINFO_H 126 | VideoInfo::setVideoCodec(videoCodec); 127 | VideoInfo::setDuration(duration); 128 | VideoInfo::setDurationStrng(durationStrng); 129 | VideoInfo::setWidth(width); 130 | VideoInfo::setHeight(height); 131 | VideoInfo::setColors(colors); 132 | VideoInfo::setMatrix(matrix); 133 | VideoInfo::setTransfer(transfer); 134 | VideoInfo::setPrimaries(primaries); 135 | VideoInfo::setFrameRate(frameRate); 136 | #endif // PROGRESSINFO_H 137 | } 138 | } -------------------------------------------------------------------------------- /Old (DEPRECATED)/FFLoader/FFLoader/Arguments/ArgsBuilder.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using System.Text; 3 | 4 | namespace FFLoader.Arguments 5 | { 6 | internal class ArgsBuilder 7 | { 8 | internal static StringBuilder _args; 9 | 10 | /// 11 | /// Builds arguments that will be later passed to ffmpeg. 12 | /// 13 | /// The selected output video codec. 14 | /// The selected output video tune. 15 | /// The selected output video encoding mode. 16 | /// Video bitrate. 17 | /// CPU preset. 18 | /// Audio codec/format. 19 | /// Audio bitrate 20 | /// The frames per second. 21 | /// The number of b frames. 22 | /// The adjusted height of the video. 23 | /// The adjusted width of the video. 24 | /// The resize algorithm to use if resizing. 25 | /// The audio sample rate. 26 | /// The sharpening value. 27 | /// The verison of FrameGUI. 28 | /// Mutes the video audio. 29 | /// The arguments in one string. 30 | internal static string ArgumentBuilder(string inputVideo, string outputVideo, string avisynthScript, string vCodec, string tune, string mode, double vBitrate, double crf, string preset, string aCodec, 31 | string aBitrate, double fps, double bFrame, double vheight, double vWidth, string resizeAlgo, string sampleRate, float sharpen, string version, bool mute) 32 | { 33 | if (_args != null) 34 | { 35 | _args.Clear(); 36 | _args = null; 37 | } 38 | 39 | _args = new StringBuilder(); 40 | 41 | _args.Append(string.Format("-y -noautorotate", CultureInfo.InvariantCulture)); 42 | 43 | if (!string.IsNullOrEmpty(avisynthScript)) 44 | { 45 | _args.Append(string.Format($@" -i ""{avisynthScript}""", CultureInfo.InvariantCulture)); 46 | } 47 | 48 | _args.Append(string.Format($@" -i ""{inputVideo}""", CultureInfo.InvariantCulture)); 49 | 50 | if (!string.IsNullOrEmpty(avisynthScript)) 51 | { 52 | _args.Append(MapArgs.MapVideo()); 53 | } 54 | 55 | _args.Append(CodecArgs.VideoCodecs(vCodec)); 56 | _args.Append(PresetArgs.VideoPreset(preset)); 57 | 58 | if (tune != "none") 59 | { 60 | _args.Append(TuneArgs.VideoTunes(tune)); 61 | } 62 | 63 | if (vBitrate > 0 && mode.Contains("1 Pass")) 64 | { 65 | _args.Append(BitrateArgs.VideoBitrate(vBitrate)); 66 | } 67 | else if (vBitrate == 0 && mode.Contains("1 Pass")) 68 | { 69 | _args.Append(BitrateArgs.VideoBitrateCopy()); 70 | } 71 | else if (vBitrate == 0 && mode.Contains("Factor")) 72 | { 73 | _args.Append(BitrateArgs.RateFactor(crf)); 74 | } 75 | 76 | _args.Append(FrameArgs.BFrame(bFrame)); 77 | 78 | bool fpsEnabled, resEnabeled; 79 | 80 | if (fps != 0) 81 | { 82 | _args.Append(FrameArgs.Fps(fps)); 83 | fpsEnabled = true; 84 | } 85 | else 86 | { 87 | fpsEnabled = false; 88 | } 89 | 90 | if (vheight != 0 && vWidth != 0) 91 | { 92 | _args.Append(ResolutionArgs.VideoResolution(vheight, vWidth, fpsEnabled)); 93 | resEnabeled = true; 94 | } 95 | else 96 | { 97 | resEnabeled = false; 98 | } 99 | 100 | if (vheight != 0 && vWidth != 0 && resizeAlgo != "none") 101 | { 102 | _args.Append(ResolutionArgs.VideoResizeAlgo(resizeAlgo)); 103 | } 104 | 105 | if (sharpen != 0.0) 106 | { 107 | _args.Append(SharpenArgs.SharpenResEnabled(sharpen, resEnabeled, fpsEnabled)); 108 | } 109 | else if (fpsEnabled || resEnabeled) 110 | { 111 | _args.Append(string.Format(@"""", CultureInfo.InvariantCulture)); 112 | } 113 | 114 | if (mute) 115 | { 116 | _args.Append(string.Format(" -an", CultureInfo.InvariantCulture)); 117 | } 118 | else 119 | { 120 | _args.Append(CodecArgs.AudioCodecs(aCodec)); 121 | _args.Append(BitrateArgs.AudioBitrate(aBitrate)); 122 | _args.Append(SampleRateArgs.SampleRate(sampleRate)); 123 | } 124 | 125 | _args.Append(EncoderAppArgs.EncoderApp(version)); 126 | 127 | _args.Append(string.Format($@" ""{outputVideo}""", CultureInfo.InvariantCulture)); 128 | 129 | return _args.ToString(); 130 | } 131 | 132 | /// 133 | /// Arguments to be passed to the FFMpeg process for the one-click method. 134 | /// 135 | /// The input file path for the about-to-be encoded video. 136 | /// The output file path of the encoded video. 137 | /// The path to the AviSynth+ script. 138 | /// The video codec to use in a string format. 139 | /// The version of FrameGUI in a string format. 140 | /// The arguments in a string representation. 141 | internal static string OneCArguments(string input, string output, string avsScript, string vCodec, string version) 142 | { 143 | if (_args != null) 144 | { 145 | _args.Clear(); 146 | _args = null; 147 | } 148 | 149 | _args = new StringBuilder(); 150 | 151 | _args.Append(string.Format("-y -noautorotate", CultureInfo.InvariantCulture)); 152 | _args.Append(string.Format($@" -i ""{avsScript}""", CultureInfo.InvariantCulture)); 153 | _args.Append(string.Format($@" -i ""{input}""", CultureInfo.InvariantCulture)); 154 | _args.Append(MapArgs.MapVideo()); 155 | 156 | _args.Append(CodecArgs.VideoCodecs(vCodec)); 157 | 158 | _args.Append(string.Format(" -preset slow -bf 8 -crf 17 -b:a 320k", CultureInfo.InvariantCulture)); 159 | 160 | _args.Append(EncoderAppArgs.EncoderApp(version + " One-Click")); 161 | _args.Append(string.Format($@" ""{output}""", CultureInfo.InvariantCulture)); 162 | 163 | return _args.ToString(); 164 | } 165 | } 166 | } 167 | --------------------------------------------------------------------------------