[1078] 兼容abl流媒体

This commit is contained in:
lin
2025-07-03 17:30:59 +08:00
parent 1bfb51c90e
commit a424f270e8
3 changed files with 7 additions and 8 deletions

View File

@@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.jt1078.proc.response.Rs;
import com.genersoft.iot.vmp.jt1078.service.Ijt1078Service;
import com.genersoft.iot.vmp.jt1078.session.Session;
import io.netty.buffer.ByteBuf;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationEvent;
import java.nio.charset.Charset;
@@ -19,6 +20,7 @@ import java.nio.charset.Charset;
* @date 2023/4/27 18:06
* @email qingtaij@163.com
*/
@Slf4j
@MsgId(id = "0102")
public class J0102 extends Re {
@@ -30,7 +32,7 @@ public class J0102 extends Re {
byte[] authenticationCodeBytes = new byte[lenCode];
// ByteBuf byteBuf = buf.readBytes(authenticationCodeBytes);
authenticationCode = buf.readCharSequence(lenCode, Charset.forName("GBK")).toString();
System.out.println("设备鉴权: authenticationCode " + authenticationCode);
log.info("设备鉴权: authenticationCode " + authenticationCode);
// if 2019 to decode next
return null;
}

View File

@@ -218,17 +218,11 @@ public class jt1078PlayServiceImpl implements Ijt1078PlayService {
subscribe.removeSubscribe(hook);
redisTemplate.opsForValue().set(playKey, info);
// 截图
String streamUrl;
if (mediaServer.getRtspPort() != 0) {
streamUrl = String.format("rtsp://127.0.0.1:%s/%s/%s", mediaServer.getRtspPort(), "rtp", stream);
} else {
streamUrl = String.format("http://127.0.0.1:%s/%s/%s.live.mp4", mediaServer.getHttpPort(), "rtp", stream);
}
String path = "snap";
String fileName = phoneNumber + "_" + channelId + ".jpg";
// 请求截图
log.info("[请求截图]: " + fileName);
mediaServerService.getSnap(mediaServer, streamUrl, 15, 1, path, fileName);
mediaServerService.getSnap(mediaServer, "rtp", stream, 15, 1, path, fileName);
});
// 开启收流端口
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServer, stream, "000", false, false, 0, false, !channel.isHasAudio(), false, 1);

View File

@@ -313,12 +313,15 @@ public class ABLRESTfulUtils {
}
public Integer openRtpServer(MediaServer mediaServer, String app, String stream, int payload, Integer port, Integer tcpMode, Integer disableAudio, Boolean record) {
Map<String, Object> param = new HashMap<>();
param.put("vhost", "_defaultVhost_");
param.put("app", app);
param.put("stream_id", stream);
param.put("payload", payload);
param.put("jtt1078_version", "2016");
param.put("RtpPayloadDataType", 4);
if (port != null) {
param.put("port", port);
}