关闭录像功能和mqtt功能

This commit is contained in:
cxh 2025-12-23 09:25:52 +08:00
parent a9c236d5f2
commit 3676e38a89
2 changed files with 24 additions and 37 deletions

View File

@ -37,7 +37,7 @@ int main()
LOG_INFO("[MAIN] ===== Vehicle Video Service Starting =====");
// 创建全局 RecordManager 实例
g_record_manager = std::make_shared<RecordManager>("/home/aiec/srs/conf/kun_record.conf");
// g_record_manager = std::make_shared<RecordManager>("/home/aiec/srs/conf/kun_record.conf");
try
{
@ -59,20 +59,20 @@ int main()
RTMPManager::start_all();
// 启动 MQTT 线程
std::thread mqtt_thread(
[]
{
try
{
LOG_INFO("[MAIN] MQTT thread started.");
mqtt_client_thread_func(); // 在回调里执行推流控制
}
catch (const std::exception& e)
{
LOG_ERROR(std::string("[MAIN] MQTT thread crashed: ") + e.what());
}
LOG_INFO("[MAIN] MQTT thread exiting...");
});
// std::thread mqtt_thread(
// []
// {
// try
// {
// LOG_INFO("[MAIN] MQTT thread started.");
// mqtt_client_thread_func(); // 在回调里执行推流控制
// }
// catch (const std::exception& e)
// {
// LOG_ERROR(std::string("[MAIN] MQTT thread crashed: ") + e.what());
// }
// LOG_INFO("[MAIN] MQTT thread exiting...");
// });
// 主循环,仅等待退出信号
while (g_running.load(std::memory_order_relaxed)) std::this_thread::sleep_for(std::chrono::milliseconds(200));
@ -85,11 +85,11 @@ int main()
RTMPManager::stop_all();
if (mqtt_thread.joinable())
{
mqtt_thread.join();
LOG_INFO("[MAIN] MQTT thread joined.");
}
// if (mqtt_thread.joinable())
// {
// mqtt_thread.join();
// LOG_INFO("[MAIN] MQTT thread joined.");
// }
LOG_INFO("[MAIN] ===== Vehicle Video Service Exited Cleanly =====");
return 0;

View File

@ -114,24 +114,11 @@ GstElement* RTMPManager::create_pipeline(const Camera& cam)
" ! mpph264enc bps=" +
std::to_string(bitrate) + " gop=" + std::to_string(fps) +
" rc-mode=cbr "
" ! h264parse ! tee name=t "
// ------ 分支1live ------
"t. ! queue max-size-buffers=5 leaky=downstream "
" ! flvmux streamable=true name=mux_live "
" ! h264parse "
" ! queue max-size-buffers=5 leaky=downstream "
" ! flvmux streamable=true "
" ! rtmpsink location=\"" +
live_rtmp +
"\" sync=false async=false "
// ------ 分支2record ------
"t. ! queue max-size-buffers=5 leaky=downstream "
" ! flvmux streamable=true name=mux_record "
" ! rtmpsink location=\"" +
record_rtmp +
"\" sync=false async=false "
// ------ 分支3AI ------
"t. ! queue ! fakesink sync=false";
live_rtmp + "\" sync=false async=false";
GError* error = nullptr;
GstElement* pipeline = gst_parse_launch(pipeline_str.c_str(), &error);