Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/src/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,8 @@ void Settings::init()
if (DataManager::instance()->encodeEnv() == FFmpeg_Env) {
if (DataManager::instance()->encExists()) {
GlobalUtils::loadCameraConf();
if (!GlobalUtils::isLowPerformanceBoard()) {
videoFormatList << tr("mp4") << tr("webm");
} else {
videoFormatList << tr("webm") << tr("mp4");
}

// webm 作为默认格式(索引0),mp4 作为备选(索引1)
videoFormatList << tr("webm") << tr("mp4");
} else {
videoFormatList << tr("webm");
m_settings->setOption("outsetting.outformat.vidformat", 0);
Expand Down
15 changes: 9 additions & 6 deletions src/src/videowidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,17 @@ videowidget::videowidget(DWidget *parent)
// 默认不显示网格线
setGridType(Grid_None);

if (DataManager::instance()->encodeEnv() != FFmpeg_Env || !DataManager::instance()->encExists() || GlobalUtils::isLowPerformanceBoard()) {
// 默认使用 webm 格式
if (DataManager::instance()->encodeEnv() != FFmpeg_Env || !DataManager::instance()->encExists()) {
m_videoFormat = "webm";
}
if (dc::Settings::get().getOption("outsetting.outformat.vidformat").toInt()) {
if (!GlobalUtils::isLowPerformanceBoard())
m_videoFormat = "webm";
else
} else {
// 根据配置选择格式:0=webm(默认), 1=mp4
int formatIndex = dc::Settings::get().getOption("outsetting.outformat.vidformat").toInt();
if (formatIndex == 1) {
Comment on lines +225 to +231
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Consider simplifying default format logic to reduce duplication and make future changes safer.

m_videoFormat = "webm" is assigned in both branches. Since webm is the default, you can set it once before the if, then only set `

m_videoFormat = "mp4";
} else {
m_videoFormat = "webm";
}
}
}

Expand Down
Loading