From f77a83140bd9f613ce9a590ba6424a6b1391f35a Mon Sep 17 00:00:00 2001 From: shikong <919411476@qq.com> Date: Wed, 17 Jan 2024 11:05:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E6=94=BE=E8=A7=86=E9=A2=91=E6=8B=89?= =?UTF-8?q?=E5=8F=96=E5=8F=82=E6=95=B0/=E9=85=8D=E7=BD=AE=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../docking/gb28181/mocking/config/sip/FfmpegConfig.java | 2 +- .../docking/gb28181/mocking/config/sip/ZlmHookConfig.java | 2 +- .../mocking/service/ffmpeg/FfmpegSupportService.java | 4 ++-- .../src/main/resources/application-local.yml | 2 +- .../src/main/resources/application.yml | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/config/sip/FfmpegConfig.java b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/config/sip/FfmpegConfig.java index 5593f64..e482809 100644 --- a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/config/sip/FfmpegConfig.java +++ b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/config/sip/FfmpegConfig.java @@ -21,7 +21,7 @@ public class FfmpegConfig { private String download = "-i"; private String input = "-re -i"; private String output = "-vcodec h264 -acodec aac -f rtp_mpegts"; - private String logLevel = "fatal"; + private String logLevel = "error"; } diff --git a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/config/sip/ZlmHookConfig.java b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/config/sip/ZlmHookConfig.java index 003b7e3..2c6891d 100644 --- a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/config/sip/ZlmHookConfig.java +++ b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/config/sip/ZlmHookConfig.java @@ -12,5 +12,5 @@ import java.time.Duration; public class ZlmHookConfig { private String hook; private Duration delay = Duration.ofMillis(100); - private Duration fixed = Duration.ofSeconds(30); + private Duration fixed = Duration.ofSeconds(0); } diff --git a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/ffmpeg/FfmpegSupportService.java b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/ffmpeg/FfmpegSupportService.java index 2697a4f..4ca0df7 100644 --- a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/ffmpeg/FfmpegSupportService.java +++ b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/ffmpeg/FfmpegSupportService.java @@ -21,10 +21,10 @@ public class FfmpegSupportService { public Executor pushToRtp(String input, String output, long time, TimeUnit unit,ExecuteResultHandler resultHandler){ FfmpegConfig.Rtp rtp = ffmpegConfig.getRtp(); FfmpegConfig.Debug debug = ffmpegConfig.getDebug(); - String inputParam = debug.getInput() ? rtp.getInput() : StringUtils.joinWith(" ", rtp.getInput(), input); + String inputParam = debug.getInput() ? rtp.getInput() : StringUtils.joinWith(" ", rtp.getInput(), "\"" + input + "\""); log.info("视频输入参数 {}", inputParam); - String outputParam = debug.getOutput()? rtp.getOutput() : StringUtils.joinWith(" ", rtp.getOutput(), output); + String outputParam = debug.getOutput()? rtp.getOutput() : StringUtils.joinWith(" ", rtp.getOutput(), "\"" + output + "\""); log.info("视频输出参数 {}", outputParam); return ffmpegExecutor(inputParam, outputParam, time, unit, resultHandler); diff --git a/gb28181-mocking-starter/src/main/resources/application-local.yml b/gb28181-mocking-starter/src/main/resources/application-local.yml index dc6fc74..09fee04 100644 --- a/gb28181-mocking-starter/src/main/resources/application-local.yml +++ b/gb28181-mocking-starter/src/main/resources/application-local.yml @@ -69,7 +69,7 @@ media: local: hook: http://10.10.10.20:18182/zlm/hook delay: 100ms - fixed: 30s + fixed: 0s ip: 10.10.10.200 url: 'http://10.10.10.200:5081' # url: 'http://10.10.10.200:12580/anything/' diff --git a/gb28181-mocking-starter/src/main/resources/application.yml b/gb28181-mocking-starter/src/main/resources/application.yml index 304f74b..26b87bf 100644 --- a/gb28181-mocking-starter/src/main/resources/application.yml +++ b/gb28181-mocking-starter/src/main/resources/application.yml @@ -77,8 +77,8 @@ proxy: # 代理的视频接口地址, 用于获取历史视频 # 参数 device_id, begin_time, end_time #url: http://192.168.2.3:18183 -# url: http://10.10.10.20:18183 - url: http://192.168.1.241:28181 + url: http://10.10.10.20:18183 + #url: http://192.168.1.241:28181 ffmpeg-support: task: # 最大同时推流任务数, <= 0 时不做限制 @@ -98,14 +98,14 @@ ffmpeg-support: rtp: #input: -thread_queue_size 128 -re -i http://192.168.3.12:5081/live/test.live.flv #input: -re -i - input: -re -i + input: -rw_timeout 60000000 -re -i #output: -tune zerolatency -vcodec libx264 -acodec aac -preset ultrafast -vf scale=640:-1 -f flv #rtp_mpegts #output: -vcodec libx264 -acodec aac -vf scale=640:-1 -f rtp_mpegts # -rtsp_transport tcp # 拉取4倍速流文件 还原速率 #output: -filter:v "setpts=4.0*PTS" -tune zerolatency -vcodec libx264 -acodec aac -preset ultrafast -vf scale=640:-1 -f flv # 下载 正常速率 #output: -r 30 -tune zerolatency -vcodec libx264 -acodec aac -preset ultrafast -vf scale=640:-1 -f flv - output: -r 30 -vcodec libx264 -acodec aac -filter:v "setpts=1*PTS" -preset ultrafast -flvflags no_duration_filesize -f flv + output: -r 30 -vcodec libx264 -acodec aac -filter:v "setpts=1*PTS" -preset ultrafast -flvflags no_duration_filesize -bf 0 -max_interleave_delta 0 -f flv #download: -i E:\Repository\other\happytime-gb28181-device-x64\666.mp4 -filter:v "setpts=4.0*PTS" download: -i download-speed: 4.0