mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2025-01-23 15:11:10 +01:00
lime_qt: Added -d
option for dumping video
This commit is contained in:
parent
0d8c6cdfb0
commit
60a7697982
@ -296,6 +296,21 @@ GMainWindow::GMainWindow(Core::System& system_)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Dump video
|
||||||
|
if (args[i] == QStringLiteral("-d")) {
|
||||||
|
if (i >= args.size() - 1 || args[i + 1].startsWith(QChar::fromLatin1('-'))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!DynamicLibrary::FFmpeg::LoadFFmpeg()) {
|
||||||
|
ShowFFmpegErrorMessage();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
video_dumping_path = args[++i];
|
||||||
|
video_dumping_on_start = true;
|
||||||
|
ui->action_Dump_Video->setChecked(true);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Launch game in fullscreen mode
|
// Launch game in fullscreen mode
|
||||||
if (args[i] == QStringLiteral("-f")) {
|
if (args[i] == QStringLiteral("-f")) {
|
||||||
ui->action_Fullscreen->setChecked(true);
|
ui->action_Fullscreen->setChecked(true);
|
||||||
@ -2797,6 +2812,32 @@ void GMainWindow::OnCaptureScreenshot() {
|
|||||||
OnStartGame();
|
OnStartGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GMainWindow::ShowFFmpegErrorMessage() {
|
||||||
|
QMessageBox message_box;
|
||||||
|
message_box.setWindowTitle(tr("Could not load video dumper"));
|
||||||
|
message_box.setText(
|
||||||
|
tr("FFmpeg could not be loaded. Make sure you have a compatible version installed."
|
||||||
|
#ifdef _WIN32
|
||||||
|
"\n\nTo install FFmpeg to Lime, press Open and select your FFmpeg directory."
|
||||||
|
#endif
|
||||||
|
"\n\nTo view a guide on how to install FFmpeg, press Help."));
|
||||||
|
message_box.setStandardButtons(QMessageBox::Ok | QMessageBox::Help
|
||||||
|
#ifdef _WIN32
|
||||||
|
| QMessageBox::Open
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
auto result = message_box.exec();
|
||||||
|
if (result == QMessageBox::Help) {
|
||||||
|
QDesktopServices::openUrl(
|
||||||
|
QUrl(QStringLiteral("https://web.archive.org/web/20240301121456/https://"
|
||||||
|
"citra-emu.org/wiki/installing-ffmpeg-for-the-video-dumper/")));
|
||||||
|
#ifdef _WIN32
|
||||||
|
} else if (result == QMessageBox::Open) {
|
||||||
|
OnOpenFFmpeg();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GMainWindow::OnDumpVideo() {
|
void GMainWindow::OnDumpVideo() {
|
||||||
if (DynamicLibrary::FFmpeg::LoadFFmpeg()) {
|
if (DynamicLibrary::FFmpeg::LoadFFmpeg()) {
|
||||||
if (ui->action_Dump_Video->isChecked()) {
|
if (ui->action_Dump_Video->isChecked()) {
|
||||||
@ -2806,30 +2847,7 @@ void GMainWindow::OnDumpVideo() {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ui->action_Dump_Video->setChecked(false);
|
ui->action_Dump_Video->setChecked(false);
|
||||||
|
ShowFFmpegErrorMessage();
|
||||||
QMessageBox message_box;
|
|
||||||
message_box.setWindowTitle(tr("Could not load video dumper"));
|
|
||||||
message_box.setText(
|
|
||||||
tr("FFmpeg could not be loaded. Make sure you have a compatible version installed."
|
|
||||||
#ifdef _WIN32
|
|
||||||
"\n\nTo install FFmpeg to Lime, press Open and select your FFmpeg directory."
|
|
||||||
#endif
|
|
||||||
"\n\nTo view a guide on how to install FFmpeg, press Help."));
|
|
||||||
message_box.setStandardButtons(QMessageBox::Ok | QMessageBox::Help
|
|
||||||
#ifdef _WIN32
|
|
||||||
| QMessageBox::Open
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
auto result = message_box.exec();
|
|
||||||
if (result == QMessageBox::Help) {
|
|
||||||
QDesktopServices::openUrl(
|
|
||||||
QUrl(QStringLiteral("https://web.archive.org/web/20240301121456/https://"
|
|
||||||
"citra-emu.org/wiki/installing-ffmpeg-for-the-video-dumper/")));
|
|
||||||
#ifdef _WIN32
|
|
||||||
} else if (result == QMessageBox::Open) {
|
|
||||||
OnOpenFFmpeg();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2914,7 +2932,8 @@ void GMainWindow::StartVideoDumping(const QString& path) {
|
|||||||
} else {
|
} else {
|
||||||
QMessageBox::critical(
|
QMessageBox::critical(
|
||||||
this, tr("Lime3DS"),
|
this, tr("Lime3DS"),
|
||||||
tr("Could not start video dumping.<br>Refer to the log for details."));
|
tr("Could not start video dumping.<br>Please ensure that the video encoder is "
|
||||||
|
"configured correctly.<br>Refer to the log for details."));
|
||||||
ui->action_Dump_Video->setChecked(false);
|
ui->action_Dump_Video->setChecked(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3629,6 +3648,7 @@ static Qt::HighDpiScaleFactorRoundingPolicy GetHighDpiRoundingPolicy() {
|
|||||||
static void PrintHelp(const char* argv0) {
|
static void PrintHelp(const char* argv0) {
|
||||||
std::cout << "Usage: " << argv0
|
std::cout << "Usage: " << argv0
|
||||||
<< " [options] <filename>\n"
|
<< " [options] <filename>\n"
|
||||||
|
"-d [path] Dump video recording of emulator playback to the given file path\n"
|
||||||
"-f Start in fullscreen mode\n"
|
"-f Start in fullscreen mode\n"
|
||||||
"-g [path] Start a game file located at the given path\n"
|
"-g [path] Start a game file located at the given path\n"
|
||||||
"-h Display this help and exit\n"
|
"-h Display this help and exit\n"
|
||||||
@ -3644,7 +3664,7 @@ static void PrintVersion() {
|
|||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
while (optind < argc) {
|
while (optind < argc) {
|
||||||
int arg = getopt(argc, argv, "fg:hi:r:v");
|
int arg = getopt(argc, argv, "d:fg:hi:p:r:v");
|
||||||
if (arg != -1) {
|
if (arg != -1) {
|
||||||
switch (static_cast<char>(arg)) {
|
switch (static_cast<char>(arg)) {
|
||||||
case 'h':
|
case 'h':
|
||||||
|
@ -222,6 +222,8 @@ private:
|
|||||||
const std::string& keywords, const std::string& name,
|
const std::string& keywords, const std::string& name,
|
||||||
const bool& skip_tryexec);
|
const bool& skip_tryexec);
|
||||||
|
|
||||||
|
void ShowFFmpegErrorMessage();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void OnStartGame();
|
void OnStartGame();
|
||||||
void OnRestartGame();
|
void OnRestartGame();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user