使用pkmpi例程修改为录制视频保存本地后,什么方法可以在画面加入时间戳
Posted: 2024-06-06 9:50
// 获取当前时间
time_t now = time(0);
struct tm tstruct;
char timebuf[80];
tstruct = *localtime(&now);
strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S", &tstruct);
// 在帧上添加时间戳
cv::putText(frame, timebuf, cv::Point(10, 30), cv::FONT_HERSHEY_SIMPLEX, 1, cv::Scalar(0, 255, 0), 2);
尝试了这种方法但前五秒又时间戳 后面好像被画面覆盖了
time_t now = time(0);
struct tm tstruct;
char timebuf[80];
tstruct = *localtime(&now);
strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S", &tstruct);
// 在帧上添加时间戳
cv::putText(frame, timebuf, cv::Point(10, 30), cv::FONT_HERSHEY_SIMPLEX, 1, cv::Scalar(0, 255, 0), 2);
尝试了这种方法但前五秒又时间戳 后面好像被画面覆盖了