mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
UI: Add FLV file output (sharing encoders)
Implement the 'file path' in output settings, and implement the 'start recording' button, though for the time being I'm just going to make it use a directory rather than allow custom file names. This file output will actually share the video and audio encoder with the stream. I don't really know what to do about MP4 -- I don't really like the idea of saving directly in the program, if you do and the program crashes, that MP4 file is lost. I'm contemplating making some sort of mp4 output process stub. So no MP4 file output for the time being. If you need MP4, just remux it with FFmpeg: ffmpeg -i flv_file.flv -acodec copy -vcodec copy mp4_file.mp4
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include <QLineEdit>
|
||||
#include <QMessageBox>
|
||||
#include <QCloseEvent>
|
||||
#include <QFileDialog>
|
||||
|
||||
#include "obs-app.hpp"
|
||||
#include "platform.hpp"
|
||||
@@ -372,7 +373,7 @@ void OBSBasicSettings::LoadVideoSettings()
|
||||
void OBSBasicSettings::LoadSimpleOutputSettings()
|
||||
{
|
||||
const char *path = config_get_string(main->Config(), "SimpleOutput",
|
||||
"path");
|
||||
"FilePath");
|
||||
int videoBitrate = config_get_uint(main->Config(), "SimpleOutput",
|
||||
"VBitrate");
|
||||
int audioBitrate = config_get_uint(main->Config(), "SimpleOutput",
|
||||
@@ -557,7 +558,7 @@ void OBSBasicSettings::SaveOutputSettings()
|
||||
videoBitrate);
|
||||
config_set_string(main->Config(), "SimpleOutput", "ABitrate",
|
||||
QT_TO_UTF8(audioBitrate));
|
||||
config_set_string(main->Config(), "SimpleOutput", "path",
|
||||
config_set_string(main->Config(), "SimpleOutput", "FilePath",
|
||||
QT_TO_UTF8(path));
|
||||
}
|
||||
|
||||
@@ -693,6 +694,19 @@ void OBSBasicSettings::on_streamType_currentIndexChanged(int idx)
|
||||
LoadServiceInfo();
|
||||
}
|
||||
|
||||
void OBSBasicSettings::on_simpleOutputBrowse_clicked()
|
||||
{
|
||||
QString dir = QFileDialog::getExistingDirectory(this,
|
||||
QTStr("OpenDirectory"),
|
||||
ui->simpleOutputPath->text(),
|
||||
QFileDialog::ShowDirsOnly |
|
||||
QFileDialog::DontResolveSymlinks);
|
||||
if (dir.isEmpty())
|
||||
return;
|
||||
|
||||
ui->simpleOutputPath->setText(dir);
|
||||
}
|
||||
|
||||
static inline bool StreamExists(const char *name)
|
||||
{
|
||||
return obs_get_service_by_name(name) != nullptr;
|
||||
|
||||
Reference in New Issue
Block a user