| | |
| | | String timestampStr = null; |
| | | // camera2的文件名格式:h264_camera2_1234567890123.h264 |
| | | if (fileName.startsWith("h264_camera2_") && fileName.endsWith(".h264")) { |
| | | timestampStr = fileName.substring(14, fileName.length() - 5); // 去掉 "h264_camera2_" 和 ".h264" |
| | | timestampStr = fileName.substring(13, fileName.length() - 5); // 去掉 "h264_camera2_" 和 ".h264" |
| | | } |
| | | |
| | | if (timestampStr == null || timestampStr.trim().isEmpty()) { |
| | |
| | | if (fileName.startsWith("h264_camera2_") && fileName.endsWith(".h264")) { |
| | | try { |
| | | // 提取文件名中的时间戳 |
| | | String timestampStr = fileName.substring(14, fileName.length() - 5); // 去掉 "h264_camera2_" 和 ".h264" |
| | | String timestampStr = fileName.substring(13, fileName.length() - 5); // 去掉 "h264_camera2_" 和 ".h264" |
| | | long timestamp = Long.parseLong(timestampStr); |
| | | startTimeFromFileName = new Date(timestamp); |
| | | } catch (NumberFormatException e) { |