From cbbad478f43677dcaaa9c0a6a3c7c7a8faed417b Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 16 Jan 2024 20:36:00 +0800 Subject: [PATCH] Camera: Support replace audio if enabled extra audio. v5.13.13 --- DEVELOPER.md | 1 + platform/camera-live-stream.go | 7 ++++++- ui/src/resources/locale.json | 10 +++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/DEVELOPER.md b/DEVELOPER.md index 4712209b..a9baa7bd 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -1092,6 +1092,7 @@ The following are the update records for the SRS Stack server. * LiveRoom: Support live room secret with stream URL. v5.13.11 * Camera: Support IP Camera streaming scenario. v5.13.12 * Camera: Support silent extra audio stream for video only device. v5.13.13 + * Camera: Support replace audio if enabled extra audio. v5.13.13 * v5.12 * Refine local variable name conf to config. v5.12.1 * Add forced exit on timeout for program termination. v5.12.1 diff --git a/platform/camera-live-stream.go b/platform/camera-live-stream.go index 4f486b3a..293a8576 100644 --- a/platform/camera-live-stream.go +++ b/platform/camera-live-stream.go @@ -847,7 +847,12 @@ func (v *CameraTask) doCameraStreaming(ctx context.Context, input *FFprobeSource } // Whether insert extra audio stream. if v.config.ExtraAudio == "silent" { - args = append(args, "-f", "lavfi", "-i", "anullsrc=channel_layout=stereo:sample_rate=44100", "-c:a", "aac", "-c:v", "copy") + args = append(args, + "-f", "lavfi", "-i", "anullsrc=channel_layout=stereo:sample_rate=44100", // Silent audio stream. + "-map", "0:v", "-map", "1:a", // Ignore the original audio stream. + "-c:a", "aac", "-ac", "2", "-ar", "44100", "-b:a", "20k", // Encode audio stream. + "-c:v", "copy", // Copy video stream. + ) } else { args = append(args, "-c", "copy") } diff --git a/ui/src/resources/locale.json b/ui/src/resources/locale.json index 9324dba8..16a2bd8a 100644 --- a/ui/src/resources/locale.json +++ b/ui/src/resources/locale.json @@ -34,9 +34,9 @@ "srt": "超清实时直播", "forward": "多平台转播", "transcode": "直播转码", - "record": "本地录制", - "dvr": "云录制", - "vod": "云点播", + "record": "录制", + "dvr": "腾讯云COS录制", + "vod": "腾讯云VoD录制", "code": "源代码", "other": "不推荐", "rmFileTip1": "删除文件,会造成", @@ -718,8 +718,8 @@ "forward": "Forward", "transcode": "Transcoding", "record": "Record", - "dvr": "DVR", - "vod": "VoD", + "dvr": "TencentCOS DVR", + "vod": "TecentVoD DVR", "code": "Source", "other": "Discouraged", "rmFileTip1": "It will cause",