From 761c3082c9cfbb56f2c6792785247301bd4ea23d Mon Sep 17 00:00:00 2001 From: lin <648540858@qq.com> Date: Sat, 9 May 2026 12:20:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0mp4=E6=9C=80=E5=A4=A7?= =?UTF-8?q?=E6=97=B6=E9=95=BF=E8=AE=BE=E7=BD=AE=E7=9A=84=E5=AE=B9=E9=94=99?= =?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=8C=E7=A1=AE=E4=BF=9D=E6=B5=81=E6=97=B6?= =?UTF-8?q?=E9=95=BF=E8=B6=85=E8=BF=87=E6=97=B6=E4=B8=8D=E4=BC=9A=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=96=87=E4=BB=B6=E5=88=87=E7=89=87=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/service/impl/RtpServerServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/RtpServerServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/RtpServerServiceImpl.java index 2ea1d0755..f14c70c84 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/RtpServerServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/RtpServerServiceImpl.java @@ -409,7 +409,10 @@ public class RtpServerServiceImpl implements IReceiveRtpServerService { hookResultForOnPublish.setStream_replace(streamReplace); hookResultForOnPublish.setEnable_audio(enableAudio); hookResultForOnPublish.setEnable_mp4(enableMp4); - hookResultForOnPublish.setMp4_max_second(mp4MaxSecond + 10); + if (mp4MaxSecond != null) { + // mp4MaxSecond 需要比实际的流时长略长一些,避免因为流时长超过mp4MaxSecond而生成文件切片 + hookResultForOnPublish.setMp4_max_second(mp4MaxSecond + 10); + } String key = String.format("%s:%s", VideoManagerConstants.RTP_AUTHENTICATE, streamId); // 存储认证信息,过期时间为60秒, 过期则无法通过认证