Commit c76f3927edaf8e852e92d8cdd5f315fd2bcb7aff
合并分支
Showing
5 changed files
with
16 additions
and
9 deletions
.gitignore
src/ai_platform/MultiSourceProcess.cpp
@@ -1418,8 +1418,12 @@ void CMultiSourceProcess::manned_snapshot(vector<string>& vpt_interest_task_id, | @@ -1418,8 +1418,12 @@ void CMultiSourceProcess::manned_snapshot(vector<string>& vpt_interest_task_id, | ||
1418 | RecoderInfo recoderInfo; | 1418 | RecoderInfo recoderInfo; |
1419 | recoderInfo.task_id = task_id; | 1419 | recoderInfo.task_id = task_id; |
1420 | recoderInfo.object_id = std::to_string(j); | 1420 | recoderInfo.object_id = std::to_string(j); |
1421 | +<<<<<<< HEAD | ||
1421 | recoderInfo.recoderDir = video_folder; | 1422 | recoderInfo.recoderDir = video_folder; |
1422 | // recoderInfo.recoderDir = video_file_name; | 1423 | // recoderInfo.recoderDir = video_file_name; |
1424 | +======= | ||
1425 | + recoderInfo.recoderPath = "./res/recode"; | ||
1426 | +>>>>>>> c4e50858604d927a3467ae4d0c3b3c63b4a35afb | ||
1423 | recoderInfo.frame_nb = mem->getFrameNb(); | 1427 | recoderInfo.frame_nb = mem->getFrameNb(); |
1424 | recoderInfo.mq_info = json_str; | 1428 | recoderInfo.mq_info = json_str; |
1425 | 1429 |
src/ai_platform/common_header.h
@@ -32,7 +32,7 @@ struct box_t { | @@ -32,7 +32,7 @@ struct box_t { | ||
32 | }; | 32 | }; |
33 | 33 | ||
34 | struct RecoderInfo { | 34 | struct RecoderInfo { |
35 | - std::string recoderDir; | 35 | + std::string recoderPath; |
36 | std::string task_id; | 36 | std::string task_id; |
37 | std::string object_id; | 37 | std::string object_id; |
38 | unsigned long long frame_nb; | 38 | unsigned long long frame_nb; |
src/decoder/dvpp/FFRecoderTaskManager.cpp
@@ -300,7 +300,7 @@ void FFRecoderTaskManager::recode_thread(RecodeParam recodeParam){ | @@ -300,7 +300,7 @@ void FFRecoderTaskManager::recode_thread(RecodeParam recodeParam){ | ||
300 | RecoderInfo recoderInfo; | 300 | RecoderInfo recoderInfo; |
301 | recoderInfo = recodeParam.recoderInfo; | 301 | recoderInfo = recodeParam.recoderInfo; |
302 | std::string id = recoderInfo.task_id + "_" + recoderInfo.object_id + "_" + std::to_string(recoderInfo.frame_nb); | 302 | std::string id = recoderInfo.task_id + "_" + recoderInfo.object_id + "_" + std::to_string(recoderInfo.frame_nb); |
303 | - string file_name = recoderInfo.recoderDir + "/recoder_" + id + "_" + std::to_string(get_cur_time()) + ".mp4"; | 303 | + string file_name = recoderInfo.recoderPath; |
304 | FFRecoder ffrecoder; | 304 | FFRecoder ffrecoder; |
305 | bool bInit = ffrecoder.init(m_inStream, recodeParam.avctx, file_name.c_str()); | 305 | bool bInit = ffrecoder.init(m_inStream, recodeParam.avctx, file_name.c_str()); |
306 | if (!bInit) { | 306 | if (!bInit) { |
@@ -369,7 +369,7 @@ void FFRecoderTaskManager::recode_thread2() { | @@ -369,7 +369,7 @@ void FFRecoderTaskManager::recode_thread2() { | ||
369 | m_pkt_list_mtx.unlock(); | 369 | m_pkt_list_mtx.unlock(); |
370 | 370 | ||
371 | std::string id = recoderinfo.task_id + "_" + recoderinfo.object_id + "_" + std::to_string(recoderinfo.frame_nb); | 371 | std::string id = recoderinfo.task_id + "_" + recoderinfo.object_id + "_" + std::to_string(recoderinfo.frame_nb); |
372 | - string file_name = recoderinfo.recoderDir + "/recoder_" + id + "_" + std::to_string(get_cur_time()) + ".mp4"; | 372 | + string file_name = recoderinfo.recoderPath; |
373 | FFRecoder ffrecoder; | 373 | FFRecoder ffrecoder; |
374 | bool bInit = ffrecoder.init(m_inStream, m_avctx, file_name.c_str()); | 374 | bool bInit = ffrecoder.init(m_inStream, m_avctx, file_name.c_str()); |
375 | if (!bInit) { | 375 | if (!bInit) { |
@@ -377,7 +377,7 @@ void FFRecoderTaskManager::recode_thread2() { | @@ -377,7 +377,7 @@ void FFRecoderTaskManager::recode_thread2() { | ||
377 | ffrecoder.uninit(); | 377 | ffrecoder.uninit(); |
378 | continue; | 378 | continue; |
379 | } | 379 | } |
380 | - LOG_DEBUG("record start, pkt_list size: {} id: {}", m_pkt_list.size(), id); | 380 | + LOG_DEBUG("record start, pkt_list size: {} task_id: {} object_id:{} frame_nb: {}", m_pkt_list.size(), recoderinfo.task_id, recoderinfo.object_id, recoderinfo.frame_nb); |
381 | 381 | ||
382 | int count = 0; | 382 | int count = 0; |
383 | auto it_save = it_data; | 383 | auto it_save = it_data; |
@@ -448,7 +448,7 @@ void FFRecoderTaskManager::recode_thread3() { | @@ -448,7 +448,7 @@ void FFRecoderTaskManager::recode_thread3() { | ||
448 | m_frame_list_mtx.unlock(); | 448 | m_frame_list_mtx.unlock(); |
449 | 449 | ||
450 | std::string id = recoderinfo.task_id + "_" + recoderinfo.object_id + "_" + std::to_string(recoderinfo.frame_nb); | 450 | std::string id = recoderinfo.task_id + "_" + recoderinfo.object_id + "_" + std::to_string(recoderinfo.frame_nb); |
451 | - string file_name = recoderinfo.recoderDir + "/recoder_" + id + "_" + std::to_string(get_cur_time()) + ".mp4"; | 451 | + string file_name = recoderinfo.recoderPath; |
452 | FFRecoder ffrecoder; | 452 | FFRecoder ffrecoder; |
453 | bool bInit = ffrecoder.init(m_avctx->width, m_avctx->height, m_time_base, m_avctx, file_name.c_str()); | 453 | bool bInit = ffrecoder.init(m_avctx->width, m_avctx->height, m_time_base, m_avctx, file_name.c_str()); |
454 | if (!bInit) { | 454 | if (!bInit) { |
@@ -523,7 +523,7 @@ void FFRecoderTaskManager::recode_thread4() { | @@ -523,7 +523,7 @@ void FFRecoderTaskManager::recode_thread4() { | ||
523 | m_pkt_list_mtx.unlock(); | 523 | m_pkt_list_mtx.unlock(); |
524 | 524 | ||
525 | std::string id = recoderinfo.task_id + "_" + recoderinfo.object_id + "_" + std::to_string(recoderinfo.frame_nb); | 525 | std::string id = recoderinfo.task_id + "_" + recoderinfo.object_id + "_" + std::to_string(recoderinfo.frame_nb); |
526 | - string file_name = recoderinfo.recoderDir + "/recoder_" + id + "_" + std::to_string(get_cur_time()) + ".mp4"; | 526 | + string file_name = recoderinfo.recoderPath; |
527 | FFRecoder ffrecoder; | 527 | FFRecoder ffrecoder; |
528 | bool bInit = ffrecoder.init(m_inStream, m_avctx, file_name.c_str()); | 528 | bool bInit = ffrecoder.init(m_inStream, m_avctx, file_name.c_str()); |
529 | if (!bInit) { | 529 | if (!bInit) { |
@@ -578,4 +578,4 @@ void FFRecoderTaskManager::close() { | @@ -578,4 +578,4 @@ void FFRecoderTaskManager::close() { | ||
578 | 578 | ||
579 | void FFRecoderTaskManager::set_mq_callback(mq_callback_t cb) { | 579 | void FFRecoderTaskManager::set_mq_callback(mq_callback_t cb) { |
580 | mq_publish_func = cb; | 580 | mq_publish_func = cb; |
581 | -} | ||
582 | \ No newline at end of file | 581 | \ No newline at end of file |
582 | +} |
src/decoder/test_recoder.cpp
@@ -179,7 +179,7 @@ void algorthim_face_detect(vector<DeviceMemory*> vec_gpuMem) { | @@ -179,7 +179,7 @@ void algorthim_face_detect(vector<DeviceMemory*> vec_gpuMem) { | ||
179 | RecoderInfo recoderInfo; | 179 | RecoderInfo recoderInfo; |
180 | recoderInfo.task_id = task_id; | 180 | recoderInfo.task_id = task_id; |
181 | recoderInfo.object_id = std::to_string(obj_id); | 181 | recoderInfo.object_id = std::to_string(obj_id); |
182 | - recoderInfo.recoderDir = "./res/recode"; | 182 | + recoderInfo.recoderPath = "./res/recode"; |
183 | recoderInfo.frame_nb = mem->getFrameNb(); | 183 | recoderInfo.frame_nb = mem->getFrameNb(); |
184 | 184 | ||
185 | m_recoderinfo_queue_mtx.lock(); | 185 | m_recoderinfo_queue_mtx.lock(); |
@@ -211,7 +211,7 @@ void test_recode_thread() { | @@ -211,7 +211,7 @@ void test_recode_thread() { | ||
211 | RecoderInfo recoderInfo; | 211 | RecoderInfo recoderInfo; |
212 | recoderInfo.task_id = gpuMem->getId(); | 212 | recoderInfo.task_id = gpuMem->getId(); |
213 | recoderInfo.object_id = std::to_string(obj_id); | 213 | recoderInfo.object_id = std::to_string(obj_id); |
214 | - recoderInfo.recoderDir = "./res/recode"; | 214 | + recoderInfo.recoderPath = "./res/recode"; |
215 | recoderInfo.frame_nb = gpuMem->getFrameNb(); | 215 | recoderInfo.frame_nb = gpuMem->getFrameNb(); |
216 | 216 | ||
217 | DecoderManager* pDecManager = DecoderManager::getInstance(); | 217 | DecoderManager* pDecManager = DecoderManager::getInstance(); |