fix: 修复视频识别不支持中文路径的问题

This commit is contained in:
MistEO
2023-04-05 23:36:36 +08:00
parent c07298860c
commit 6c09fba96b
2 changed files with 3 additions and 3 deletions

View File

@@ -43,8 +43,8 @@ bool asst::CombatRecordRecognitionTask::_run()
video->release();
}
};
auto u8_path = utils::path_to_utf8_string(m_video_path);
m_video_ptr = std::shared_ptr<cv::VideoCapture>(new cv::VideoCapture(u8_path), release_video);
auto crt_path = utils::path_to_crt_string(m_video_path);
m_video_ptr = std::shared_ptr<cv::VideoCapture>(new cv::VideoCapture(crt_path), release_video);
if (!m_video_ptr->isOpened()) {
Log.error(__FUNCTION__, "video_io open failed", m_video_path);

View File

@@ -26,7 +26,7 @@ bool asst::VideoRecognitionTask::set_params(const json::value& params)
auto export_task_ptr = std::make_shared<CombatRecordRecognitionTask>(m_callback, m_inst, TaskType);
export_task_ptr->set_retry_times(0);
bool ret = export_task_ptr->set_video_path(*filename_opt);
bool ret = export_task_ptr->set_video_path(utils::path(*filename_opt));
ret &= export_task_ptr->set_stage_name(stage_name);
if (!ret) {
return false;