Merge pull request #1441 from cg2121/auto-remux-refactor

UI: Add option to auto remux
This commit is contained in:
Jim
2018-09-21 15:47:46 -07:00
committed by GitHub
9 changed files with 395 additions and 281 deletions

View File

@@ -5018,6 +5018,23 @@ void OBSBasic::StreamingStop(int code, QString last_error)
}
}
void OBSBasic::AutoRemux()
{
const char *mode = config_get_string(basicConfig, "Output", "Mode");
const char *path = strcmp(mode, "Advanced") ?
config_get_string(basicConfig, "SimpleOutput", "FilePath") :
config_get_string(basicConfig, "AdvOut", "RecFilePath");
std::string s(path);
s += "/";
s += remuxFilename;
const QString &str = QString::fromStdString(s);
QString file = str.section(".", 0, 0);
OBSRemux *remux = new OBSRemux(path, this, true);
remux->show();
remux->AutoRemux(str, file + ".mp4");
}
void OBSBasic::StartRecording()
{
if (outputHandler->RecordingActive())
@@ -5116,6 +5133,9 @@ void OBSBasic::RecordingStop(int code)
if (api)
api->on_event(OBS_FRONTEND_EVENT_RECORDING_STOPPED);
if (remuxAfterRecord)
AutoRemux();
OnDeactivate();
}