diff --git a/build/bytetrack-counter b/build/bytetrack-counter index 5d9f9c5..79dc1e2 100755 Binary files a/build/bytetrack-counter and b/build/bytetrack-counter differ diff --git a/build/version.hpp b/build/version.hpp index b757c10..d00ff13 100644 --- a/build/version.hpp +++ b/build/version.hpp @@ -4,11 +4,11 @@ namespace version { -const std::string GIT_COMMIT = "a94c3dff"; +const std::string GIT_COMMIT = "37f98f24"; const std::string GIT_BRANCH = "main"; const std::string GIT_TAG = ""; -const std::string BUILD_DATE = "2026-08-04"; -const std::string BUILD_TIME = "23:55:47"; +const std::string BUILD_DATE = "2026-08-05"; +const std::string BUILD_TIME = "00:25:19"; const int BUILD_YEAR = 2026; const bool BUILD_RKNN = 1; diff --git a/src/video_writer.cpp b/src/video_writer.cpp index efb0467..db3aa45 100644 --- a/src/video_writer.cpp +++ b/src/video_writer.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -65,11 +66,15 @@ static std::string today_str() { return ss.str(); } -static std::string timestamp_str() { +static std::string build_mp4_name(int batch_number, const std::string& counting_date) { + std::string date_part = counting_date; + date_part.erase(std::remove(date_part.begin(), date_part.end(), '-'), date_part.end()); auto t = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()); - std::ostringstream ss; - ss << std::put_time(std::localtime(&t), "%H%M%S"); - return ss.str(); + std::ostringstream name; + name << "batch_" << batch_number << "_" + << date_part << "_" + << std::put_time(std::localtime(&t), "%H%M%S") << ".mp4"; + return name.str(); } void VideoBatchWriter::note_motion() { @@ -179,9 +184,7 @@ void VideoBatchWriter::stop_and_move(int batch_number) { std::string day_dir = output_dir_ + "/" + (current_date_.empty() ? today_str() : current_date_); ensure_dir(day_dir); - std::ostringstream name; - name << "batch_" << batch_number << "_" << timestamp_str() << ".mp4"; - std::string dst = day_dir + "/" + name.str(); + std::string dst = day_dir + "/" + build_mp4_name(batch_number, current_date_); pid_t pid = fork(); if (pid == 0) { @@ -208,8 +211,7 @@ void VideoBatchWriter::shutdown() { if (prev_state == CONFIRMED || prev_state == STOPPING) { std::string day_dir = output_dir_ + "/" + (current_date_.empty() ? today_str() : current_date_); ensure_dir(day_dir); - std::string dst = day_dir + "/" + - fs::path(src).filename().string(); + std::string dst = day_dir + "/" + build_mp4_name(current_batch_, current_date_); pid_t pid = fork(); if (pid == 0) {