Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Obs Studio
提交
2fedcab9
O
Obs Studio
项目概览
小白菜888
/
Obs Studio
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Obs Studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2fedcab9
编写于
5月 08, 2017
作者:
C
cg2121
提交者:
Clayton Groeneveld
9月 18, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
UI: Add option to auto remux
上级
14ae6351
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
365 addition
and
251 deletion
+365
-251
UI/data/locale/en-US.ini
UI/data/locale/en-US.ini
+2
-0
UI/forms/OBSBasicSettings.ui
UI/forms/OBSBasicSettings.ui
+263
-243
UI/obs-app.cpp
UI/obs-app.cpp
+13
-0
UI/obs-app.hpp
UI/obs-app.hpp
+4
-0
UI/window-basic-main.cpp
UI/window-basic-main.cpp
+20
-0
UI/window-basic-main.hpp
UI/window-basic-main.hpp
+2
-0
UI/window-basic-settings.cpp
UI/window-basic-settings.cpp
+19
-0
UI/window-remux.cpp
UI/window-remux.cpp
+35
-7
UI/window-remux.hpp
UI/window-remux.hpp
+7
-1
未找到文件。
UI/data/locale/en-US.ini
浏览文件 @
2fedcab9
...
...
@@ -760,6 +760,8 @@ Basic.Settings.Advanced.Network.BindToIP="Bind to IP"
Basic.Settings.Advanced.Network.EnableNewSocketLoop
=
"Enable new networking code"
Basic.Settings.Advanced.Network.EnableLowLatencyMode
=
"Low latency mode"
Basic.Settings.Advanced.Hotkeys.DisableHotkeysInFocus
=
"Disable hotkeys when main window is in focus"
Basic.Settings.Advanced.AutoRemux
=
"Automatically remux to mp4"
Basic.Settings.Advanced.AutoRemux.MP4
=
"(record as mkv)"
# advanced audio properties
Basic.AdvAudio
=
"Advanced Audio Properties"
...
...
UI/forms/OBSBasicSettings.ui
浏览文件 @
2fedcab9
此差异已折叠。
点击以展开。
UI/obs-app.cpp
浏览文件 @
2fedcab9
...
...
@@ -77,6 +77,9 @@ string opt_starting_collection;
string
opt_starting_profile
;
string
opt_starting_scene
;
bool
remuxAfterRecord
=
false
;
string
remuxFilename
;
// GPU hint exports for AMD/NVIDIA laptops
#ifdef _MSC_VER
extern
"C"
__declspec
(
dllexport
)
DWORD
NvOptimusEnablement
=
1
;
...
...
@@ -1493,8 +1496,18 @@ string GenerateTimeDateFilename(const char *extension, bool noSpace)
string
GenerateSpecifiedFilename
(
const
char
*
extension
,
bool
noSpace
,
const
char
*
format
)
{
OBSBasic
*
main
=
reinterpret_cast
<
OBSBasic
*>
(
App
()
->
GetMainWindow
());
bool
autoRemux
=
config_get_bool
(
main
->
Config
(),
"Video"
,
"AutoRemux"
);
if
((
strcmp
(
extension
,
"mp4"
)
==
0
)
&&
autoRemux
)
extension
=
"mkv"
;
BPtr
<
char
>
filename
=
os_generate_formatted_filename
(
extension
,
!
noSpace
,
format
);
remuxFilename
=
string
(
filename
);
remuxAfterRecord
=
autoRemux
;
return
string
(
filename
);
}
...
...
UI/obs-app.hpp
浏览文件 @
2fedcab9
...
...
@@ -197,6 +197,10 @@ static inline int GetProfilePath(char *path, size_t size, const char *file)
}
extern
bool
portable_mode
;
extern
bool
remuxAfterRecord
;
extern
std
::
string
remuxFilename
;
extern
bool
opt_start_streaming
;
extern
bool
opt_start_recording
;
extern
bool
opt_start_replaybuffer
;
...
...
UI/window-basic-main.cpp
浏览文件 @
2fedcab9
...
...
@@ -5003,6 +5003,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
())
...
...
@@ -5101,6 +5118,9 @@ void OBSBasic::RecordingStop(int code)
if
(
api
)
api
->
on_event
(
OBS_FRONTEND_EVENT_RECORDING_STOPPED
);
if
(
remuxAfterRecord
)
AutoRemux
();
OnDeactivate
();
}
...
...
UI/window-basic-main.hpp
浏览文件 @
2fedcab9
...
...
@@ -507,6 +507,8 @@ private:
static
void
HotkeyTriggered
(
void
*
data
,
obs_hotkey_id
id
,
bool
pressed
);
void
AutoRemux
();
public:
OBSSource
GetProgramSource
();
OBSScene
GetCurrentScene
();
...
...
UI/window-basic-settings.cpp
浏览文件 @
2fedcab9
...
...
@@ -448,6 +448,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
HookWidget
(
ui
->
enableNewSocketLoop
,
CHECK_CHANGED
,
ADV_CHANGED
);
HookWidget
(
ui
->
enableLowLatencyMode
,
CHECK_CHANGED
,
ADV_CHANGED
);
HookWidget
(
ui
->
disableFocusHotkeys
,
CHECK_CHANGED
,
ADV_CHANGED
);
HookWidget
(
ui
->
autoRemux
,
CHECK_CHANGED
,
ADV_CHANGED
);
#if !defined(_WIN32) && !defined(__APPLE__)
delete
ui
->
enableAutoUpdates
;
...
...
@@ -2236,6 +2237,8 @@ void OBSBasicSettings::LoadAdvancedSettings()
"RecRBTime"
);
int
rbSize
=
config_get_int
(
main
->
Config
(),
"AdvOut"
,
"RecRBSize"
);
bool
autoRemux
=
config_get_bool
(
main
->
Config
(),
"Video"
,
"AutoRemux"
);
loading
=
true
;
...
...
@@ -2262,6 +2265,7 @@ void OBSBasicSettings::LoadAdvancedSettings()
ui
->
streamDelaySec
->
setValue
(
delaySec
);
ui
->
streamDelayPreserve
->
setChecked
(
preserveDelay
);
ui
->
streamDelayEnable
->
setChecked
(
enableDelay
);
ui
->
autoRemux
->
setChecked
(
autoRemux
);
SetComboByName
(
ui
->
colorFormat
,
videoColorFormat
);
...
...
@@ -2935,6 +2939,7 @@ void OBSBasicSettings::SaveAdvancedSettings()
SaveSpinBox
(
ui
->
reconnectRetryDelay
,
"Output"
,
"RetryDelay"
);
SaveSpinBox
(
ui
->
reconnectMaxRetries
,
"Output"
,
"MaxRetries"
);
SaveComboData
(
ui
->
bindToIP
,
"Output"
,
"BindIP"
);
SaveCheckBox
(
ui
->
autoRemux
,
"Video"
,
"AutoRemux"
);
#if defined(_WIN32) || defined(__APPLE__) || HAVE_PULSEAUDIO
QString
newDevice
=
ui
->
monitoringDevice
->
currentData
().
toString
();
...
...
@@ -3914,6 +3919,13 @@ void OBSBasicSettings::AdvOutRecCheckWarnings()
if
(
!
warningMsg
.
isEmpty
())
warningMsg
+=
"
\n\n
"
;
warningMsg
+=
QTStr
(
"OutputWarnings.MP4Recording"
);
ui
->
autoRemux
->
setText
(
QTStr
(
"Basic.Settings.Advanced.AutoRemux"
)
+
" "
+
QTStr
(
"Basic.Settings.Advanced.AutoRemux.MP4"
));
}
else
{
ui
->
autoRemux
->
setText
(
QTStr
(
"Basic.Settings.Advanced.AutoRemux"
));
}
delete
advOutRecWarning
;
...
...
@@ -4370,6 +4382,13 @@ void OBSBasicSettings::SimpleRecordingEncoderChanged()
if
(
!
warning
.
isEmpty
())
warning
+=
"
\n\n
"
;
warning
+=
QTStr
(
"OutputWarnings.MP4Recording"
);
ui
->
autoRemux
->
setText
(
QTStr
(
"Basic.Settings.Advanced.AutoRemux"
)
+
" "
+
QTStr
(
"Basic.Settings.Advanced.AutoRemux.MP4"
));
}
else
{
ui
->
autoRemux
->
setText
(
QTStr
(
"Basic.Settings.Advanced.AutoRemux"
));
}
if
(
warning
.
isEmpty
())
...
...
UI/window-remux.cpp
浏览文件 @
2fedcab9
...
...
@@ -31,6 +31,7 @@
#include <QStandardItemModel>
#include <QStyledItemDelegate>
#include <QToolButton>
#include <QTimer>
#include "qt-wrappers.hpp"
...
...
@@ -632,12 +633,13 @@ void RemuxQueueModel::finishEntry(bool success)
The actual remux window implementation
**********************************************************/
OBSRemux
::
OBSRemux
(
const
char
*
path
,
QWidget
*
parent
)
OBSRemux
::
OBSRemux
(
const
char
*
path
,
QWidget
*
parent
,
bool
autoRemux_
)
:
QDialog
(
parent
),
queueModel
(
new
RemuxQueueModel
),
worker
(
new
RemuxWorker
()),
ui
(
new
Ui
::
OBSRemux
),
recPath
(
path
)
recPath
(
path
),
autoRemux
(
autoRemux_
)
{
setAcceptDrops
(
true
);
...
...
@@ -649,6 +651,13 @@ OBSRemux::OBSRemux(const char *path, QWidget *parent)
ui
->
buttonBox
->
button
(
QDialogButtonBox
::
RestoreDefaults
)
->
setEnabled
(
false
);
if
(
autoRemux
)
{
resize
(
280
,
40
);
ui
->
tableView
->
hide
();
ui
->
buttonBox
->
hide
();
ui
->
label
->
hide
();
}
ui
->
progressBar
->
setMinimum
(
0
);
ui
->
progressBar
->
setMaximum
(
1000
);
ui
->
progressBar
->
setValue
(
0
);
...
...
@@ -860,7 +869,14 @@ void OBSRemux::beginRemux()
setAcceptDrops
(
false
);
remuxNextEntry
();
}
void
OBSRemux
::
AutoRemux
(
QString
inFile
,
QString
outFile
)
{
if
(
inFile
!=
""
&&
outFile
!=
""
&&
autoRemux
)
{
emit
remux
(
inFile
,
outFile
);
autoRemuxFile
=
inFile
;
}
}
void
OBSRemux
::
remuxNextEntry
()
...
...
@@ -873,12 +889,15 @@ void OBSRemux::remuxNextEntry()
}
else
{
queueModel
->
endProcessing
();
OBSMessageBox
::
information
(
this
,
QTStr
(
"Remux.FinishedTitle"
),
queueModel
->
checkForErrors
()
?
QTStr
(
"Remux.FinishedError"
)
:
QTStr
(
"Remux.Finished"
));
if
(
!
autoRemux
)
{
OBSMessageBox
::
information
(
this
,
QTStr
(
"Remux.FinishedTitle"
),
queueModel
->
checkForErrors
()
?
QTStr
(
"Remux.FinishedError"
)
:
QTStr
(
"Remux.Finished"
));
}
ui
->
progressBar
->
setVisible
(
false
);
ui
->
progressBar
->
setVisible
(
autoRemux
);
ui
->
buttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setText
(
QTStr
(
"Remux.Remux"
));
ui
->
buttonBox
->
button
(
QDialogButtonBox
::
RestoreDefaults
)
->
...
...
@@ -912,7 +931,16 @@ void OBSRemux::updateProgress(float percent)
void
OBSRemux
::
remuxFinished
(
bool
success
)
{
ui
->
buttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setEnabled
(
true
);
queueModel
->
finishEntry
(
success
);
if
(
autoRemux
&&
autoRemuxFile
!=
""
)
{
QFile
::
remove
(
autoRemuxFile
);
QTimer
::
singleShot
(
3000
,
this
,
SLOT
(
close
()));
}
remuxNextEntry
();
}
...
...
UI/window-remux.hpp
浏览文件 @
2fedcab9
...
...
@@ -56,12 +56,18 @@ class OBSRemux : public QDialog {
virtual
void
closeEvent
(
QCloseEvent
*
event
)
override
;
virtual
void
reject
()
override
;
bool
autoRemux
;
QString
autoRemuxFile
;
public:
explicit
OBSRemux
(
const
char
*
recPath
,
QWidget
*
parent
=
nullptr
);
explicit
OBSRemux
(
const
char
*
recPath
,
QWidget
*
parent
=
nullptr
,
bool
autoRemux
=
false
);
virtual
~
OBSRemux
()
override
;
using
job_t
=
std
::
shared_ptr
<
struct
media_remux_job
>
;
void
AutoRemux
(
QString
inFile
,
QString
outFile
);
protected:
void
dropEvent
(
QDropEvent
*
ev
);
void
dragEnterEvent
(
QDragEnterEvent
*
ev
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录