Устранить сжатие панели звонка и распараллелить HEVC внутри кадра
This commit is contained in:
1 parent
21e4821e22
commit
3ed9acb384
2 files changed
+14
-3
No files matched your search
@@ -10,6 +10,7 @@ extern "C" {
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavcodec/bsf.h>
|
||||
#include <libavutil/hwcontext.h>
|
||||
#include <libavutil/cpu.h>
|
||||
#include <libavutil/opt.h>
|
||||
#include <libswscale/swscale.h>
|
||||
#endif
|
||||
@@ -169,8 +170,12 @@ bool LiveVideoEncoder::open(const LiveVideoConfig& config, Backend backend) {
|
||||
if (name == "libx264" || name == "libx265") {
|
||||
av_dict_set(&options, "preset", "ultrafast", 0); av_dict_set(&options, "tune", "zerolatency", 0);
|
||||
av_dict_set(&options, "forced-idr", "1", 0);
|
||||
const int workers = std::clamp(av_cpu_count(), 1, 4);
|
||||
QByteArray params = name == "libx264" ? "scenecut=0:open-gop=0:repeat-headers=0"
|
||||
: "bframes=0:rc-lookahead=0:open-gop=0:pools=1:frame-threads=1:log-level=error";
|
||||
: "bframes=0:rc-lookahead=0:open-gop=0:frame-threads=1:wpp=1:log-level=error:pools=" + QByteArray::number(workers);
|
||||
if (name == "libx265")
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "live HEVC parallelism workers=%d frame_threads=1 wpp=1 cpu_count=%d",
|
||||
workers, av_cpu_count());
|
||||
if (constrained) {
|
||||
c->thread_count = 1;
|
||||
av_dict_set(&options, "profile", name == "libx264" ? "baseline" : "main", 0);
|
||||
|
||||
Reference in new issue
Block a user