From 0e3d7195c782d0f889a7646ec870458a115110eb Mon Sep 17 00:00:00 2001 From: shikong <919411476@qq.com> Date: Fri, 15 Sep 2023 11:57:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E6=B5=81=E9=80=9F=E7=8E=87=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gb28181/mocking/service/device/DeviceProxyService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java index 5ed7b11..5815243 100644 --- a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java +++ b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java @@ -55,7 +55,7 @@ public class DeviceProxyService { // FFmpeg 调试日志 // FFmpegLogCallback.set(); FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(fromUrl); - grabber.setFrameRate(30); + grabber.setOption("re",""); grabber.start(); FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(toUrl, grabber.getImageWidth(), grabber.getImageHeight(), grabber.getAudioChannels()); @@ -72,6 +72,7 @@ public class DeviceProxyService { recorder.setAudioBitrate(grabber.getAudioBitrate()); recorder.setAudioCodec(grabber.getAudioCodec()); } + recorder.setFrameRate(grabber.getVideoFrameRate()); recorder.setVideoBitrate(grabber.getVideoBitrate()); // recorder.setVideoCodec(grabber.getVideoCodec()); recorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);