修复云端录像seek不准确的问题
This commit is contained in:
@@ -72,7 +72,7 @@ public interface IMediaNodeServerService {
|
||||
|
||||
void loadMP4File(MediaServer mediaServer, String app, String stream, String datePath);
|
||||
|
||||
void seekRecordStamp(MediaServer mediaServer, String app, String stream, int stamp);
|
||||
void seekRecordStamp(MediaServer mediaServer, String app, String stream, Double stamp);
|
||||
|
||||
void setRecordSpeed(MediaServer mediaServer, String app, String stream, Integer speed);
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ public interface IMediaServerService {
|
||||
|
||||
StreamInfo loadMP4File(MediaServer mediaServer, String app, String stream, String datePath);
|
||||
|
||||
void seekRecordStamp(MediaServer mediaServer, String app, String stream, int stamp);
|
||||
void seekRecordStamp(MediaServer mediaServer, String app, String stream, Double stamp);
|
||||
|
||||
void setRecordSpeed(MediaServer mediaServer, String app, String stream, Integer speed);
|
||||
}
|
||||
|
||||
@@ -983,7 +983,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void seekRecordStamp(MediaServer mediaServer, String app, String stream, int stamp) {
|
||||
public void seekRecordStamp(MediaServer mediaServer, String app, String stream, Double stamp) {
|
||||
IMediaNodeServerService mediaNodeServerService = nodeServerServiceMap.get(mediaServer.getType());
|
||||
if (mediaNodeServerService == null) {
|
||||
log.info("[seekRecordStamp] 失败, mediaServer的类型: {},未找到对应的实现类", mediaServer.getType());
|
||||
|
||||
@@ -562,7 +562,7 @@ public class ZLMMediaNodeServerService implements IMediaNodeServerService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void seekRecordStamp(MediaServer mediaServer, String app, String stream, int stamp) {
|
||||
public void seekRecordStamp(MediaServer mediaServer, String app, String stream, Double stamp) {
|
||||
JSONObject jsonObject = zlmresTfulUtils.seekRecordStamp(mediaServer, app, stream, stamp, "ts");
|
||||
if (jsonObject == null) {
|
||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "请求失败");
|
||||
|
||||
@@ -438,7 +438,7 @@ public class ZLMRESTfulUtils {
|
||||
return sendPost(mediaServer, "setRecordSpeed",param, null);
|
||||
}
|
||||
|
||||
public JSONObject seekRecordStamp(MediaServer mediaServer, String app, String stream, long stamp, String schema) {
|
||||
public JSONObject seekRecordStamp(MediaServer mediaServer, String app, String stream, Double stamp, String schema) {
|
||||
Map<String, Object> param = new HashMap<>(1);
|
||||
param.put("vhost", "__defaultVhost__");
|
||||
param.put("app", app);
|
||||
|
||||
@@ -60,7 +60,7 @@ public interface ICloudRecordService {
|
||||
*/
|
||||
void loadRecord(String app, String stream, String date, ErrorCallback<StreamInfo> callback);
|
||||
|
||||
void seekRecord(String mediaServerId,String app, String stream, Integer seek);
|
||||
void seekRecord(String mediaServerId,String app, String stream, Double seek);
|
||||
|
||||
void setRecordSpeed(String mediaServerId, String app, String stream, Integer speed);
|
||||
|
||||
|
||||
@@ -15,52 +15,52 @@ public class CloudRecordItem {
|
||||
* 主键
|
||||
*/
|
||||
private int id;
|
||||
|
||||
|
||||
/**
|
||||
* 应用名
|
||||
*/
|
||||
private String app;
|
||||
|
||||
|
||||
/**
|
||||
* 流
|
||||
*/
|
||||
private String stream;
|
||||
|
||||
|
||||
/**
|
||||
* 健全ID
|
||||
*/
|
||||
private String callId;
|
||||
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private long startTime;
|
||||
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private long endTime;
|
||||
|
||||
|
||||
/**
|
||||
* ZLM Id
|
||||
*/
|
||||
private String mediaServerId;
|
||||
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String fileName;
|
||||
|
||||
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
private String filePath;
|
||||
|
||||
|
||||
/**
|
||||
* 文件夹
|
||||
*/
|
||||
private String folder;
|
||||
|
||||
|
||||
/**
|
||||
* 收藏,收藏的文件不移除
|
||||
*/
|
||||
@@ -70,16 +70,16 @@ public class CloudRecordItem {
|
||||
* 保留,收藏的文件不移除
|
||||
*/
|
||||
private Boolean reserve;
|
||||
|
||||
|
||||
/**
|
||||
* 文件大小
|
||||
*/
|
||||
private long fileSize;
|
||||
|
||||
|
||||
/**
|
||||
* 文件时长
|
||||
*/
|
||||
private long timeLen;
|
||||
private double timeLen;
|
||||
|
||||
/**
|
||||
* 所属服务ID
|
||||
@@ -96,7 +96,7 @@ public class CloudRecordItem {
|
||||
cloudRecordItem.setFileSize(param.getRecordInfo().getFileSize());
|
||||
cloudRecordItem.setFilePath(param.getRecordInfo().getFilePath());
|
||||
cloudRecordItem.setMediaServerId(param.getMediaServer().getId());
|
||||
cloudRecordItem.setTimeLen((long) param.getRecordInfo().getTimeLen() * 1000);
|
||||
cloudRecordItem.setTimeLen(param.getRecordInfo().getTimeLen() * 1000);
|
||||
cloudRecordItem.setEndTime((param.getRecordInfo().getStartTime() + (long)param.getRecordInfo().getTimeLen()) * 1000);
|
||||
Map<String, String> paramsMap = MediaServerUtils.urlParamToMap(param.getRecordInfo().getParams());
|
||||
if (paramsMap.get("callId") != null) {
|
||||
|
||||
@@ -321,7 +321,7 @@ public class CloudRecordServiceImpl implements ICloudRecordService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void seekRecord(String mediaServerId,String app, String stream, Integer seek) {
|
||||
public void seekRecord(String mediaServerId,String app, String stream, Double seek) {
|
||||
MediaServer mediaServer = mediaServerService.getOne(mediaServerId);
|
||||
if (mediaServer == null) {
|
||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "媒体节点不存在: " + mediaServerId);
|
||||
|
||||
@@ -317,7 +317,7 @@ public class CloudRecordController {
|
||||
@RequestParam(required = true) String mediaServerId,
|
||||
@RequestParam(required = true) String app,
|
||||
@RequestParam(required = true) String stream,
|
||||
@RequestParam(required = true) Integer seek
|
||||
@RequestParam(required = true) Double seek
|
||||
) {
|
||||
|
||||
cloudRecordService.seekRecord(mediaServerId, app, stream, seek);
|
||||
|
||||
@@ -365,7 +365,7 @@ create table IF NOT EXISTS wvp_cloud_record
|
||||
file_path character varying(500),
|
||||
collect bool default false,
|
||||
file_size bigint,
|
||||
time_len bigint
|
||||
time_len double precision
|
||||
);
|
||||
|
||||
drop table IF EXISTS wvp_user;
|
||||
|
||||
@@ -366,7 +366,7 @@ create table IF NOT EXISTS wvp_cloud_record
|
||||
file_path character varying(500),
|
||||
collect bool default false,
|
||||
file_size int8,
|
||||
time_len int8
|
||||
time_len double precision
|
||||
);
|
||||
|
||||
drop table IF EXISTS wvp_user;
|
||||
|
||||
@@ -426,3 +426,7 @@ call wvp_20250111();
|
||||
DROP PROCEDURE wvp_20250111;
|
||||
DELIMITER ;
|
||||
|
||||
/**
|
||||
* 20250414
|
||||
*/
|
||||
alter table wvp_cloud_record modify time_len double precision;
|
||||
|
||||
@@ -294,5 +294,10 @@ call wvp_20250402();
|
||||
DROP PROCEDURE wvp_20250402;
|
||||
DELIMITER ;
|
||||
|
||||
/**
|
||||
* 20250414
|
||||
*/
|
||||
alter table wvp_cloud_record modify time_len double precision;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -388,3 +388,7 @@ alter table wvp_cloud_record alter folder type varchar(500);
|
||||
alter table wvp_cloud_record alter file_path type varchar(500);
|
||||
update wvp_cloud_record set server_id = '你的服务ID';
|
||||
|
||||
/**
|
||||
* 20250414
|
||||
*/
|
||||
alter table wvp_cloud_record modify time_len double precision;
|
||||
|
||||
@@ -112,4 +112,8 @@ update wvp_record_plan_item set start = start * 30, stop = (stop + 1) * 30
|
||||
create index if not exists data_type on wvp_device_channel (data_type);
|
||||
create index if not exists data_device_id on wvp_device_channel (data_device_id);
|
||||
|
||||
/**
|
||||
* 20250414
|
||||
*/
|
||||
alter table wvp_cloud_record modify time_len double precision;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user