zhuizhu 6 tháng trước cách đây
mục cha
commit
72a1752442

+ 1 - 1
libs/Recorder/sws_helper.cpp

@@ -36,7 +36,7 @@ int sws_helper::init(AVPixelFormat src_fmt,
                           dst_width,
                           dst_height,
                           dst_fmt,
-                          SWS_BICUBIC,
+                          SWS_FAST_BILINEAR, // 更快的缩放算法以降低延迟
                           NULL,
                           NULL,
                           NULL);

+ 1 - 1
libs/Recorder/system_error.cpp

@@ -3,7 +3,7 @@
 #include <Windows.h>
 
 namespace am {
-const std::string& system_error::error2str(unsigned long error)
+std::string system_error::error2str(unsigned long error)
 {
     DWORD system_locale = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL);
 

+ 1 - 1
libs/Recorder/system_error.h

@@ -6,6 +6,6 @@ namespace am {
 class system_error
 {
 public:
-    static const std::string& error2str(unsigned long error);
+    static std::string error2str(unsigned long error);
 };
 } // namespace am

+ 8 - 2
main.cpp

@@ -13,6 +13,7 @@
 
 
 #include "AVPlayer/vframe.h"
+#include "MainPanel.h"
 #include "mainwindow.h"
 #include "thememanager.h"
 #include "themesettingswidget.h"
@@ -105,8 +106,13 @@ docker run -itd  --name zlmediakit --restart=always
 -v /data/zlmediakit/media/conf:/opt/media/conf
 zlmediakit/zlmediakit:master
 */
-    MainWindow w;
-    w.show();
+    // MainWindow w;
+    // w.show();
+
+    MainPanel MainPanel;
+    MainPanel.show();
+
+    MainPanel.startStreamingTest();
 
     // RecorderWidget testRecorder;
     // testRecorder.show();

+ 6 - 0
widgets/recorderwidget.cpp

@@ -362,6 +362,9 @@ bool RecorderWidget::startRecording()
         // 重置环形缓冲区丢帧计数
         recorder_reset_video_rb_dropped();
         recorder_reset_audio_rb_dropped();
+        // 限制环形缓冲区最大帧数(降低积压与延迟):视频2帧、音频3帧
+        recorder_set_video_rb_max(2);
+        recorder_set_audio_rb_max(3);
         
         // 开始录制
         result = recorder_start();
@@ -478,6 +481,9 @@ bool RecorderWidget::startStreaming()
         // 重置环形缓冲区丢帧计数
         recorder_reset_video_rb_dropped();
         recorder_reset_audio_rb_dropped();
+        // 限制环形缓冲区最大帧数(降低积压与延迟):视频2帧、音频3帧
+        recorder_set_video_rb_max(2);
+        recorder_set_audio_rb_max(3);
         
         // 开始推流
         result = recorder_start();