视频保存

This commit is contained in:
duoaohui
2026-05-19 14:34:54 +08:00
parent 6d61bf2428
commit 624b38140d
3 changed files with 14 additions and 6 deletions

View File

@@ -255,7 +255,9 @@ func (s *MeetingRecordingService) StopRecording(ctx context.Context, userID int6
}
// 上传到 MinIO
objectKey := fmt.Sprintf("recordings/%s/%d-%s.mp4", strings.ToLower(code), rec.ID, rec.RemoteID)
// 后缀 .webm 与 media-server 实际产物保持一致
// VP8/Opus 不能装进 mp4media-server 直接出 webm后续如需 mp4 可异步转码)
objectKey := fmt.Sprintf("recordings/%s/%d-%s.webm", strings.ToLower(code), rec.ID, rec.RemoteID)
fileURL, sizeBytes, uploadErr := s.uploadRecording(ctx, outputPath, objectKey)
if uploadErr != nil {
logs.Error(ctx, funcName, "录制文件上传 MinIO 失败",

View File

@@ -154,7 +154,7 @@ func (c *OpenAICompatibleClient) Transcribe(ctx context.Context, cfg *dao.STTCon
// downloadAudio 从给定 URL 拉取音频内容,返回字节流 + 推断的文件名
//
// 文件名仅作为 multipart 的 filename 参数,主要决定 Content-Type 推断;
// 取 URL path 末段,无后缀则默认 recording.mp4
// 取 URL path 末段,无后缀则默认 recording.webm与 media-server 实际产物一致)
func (c *OpenAICompatibleClient) downloadAudio(ctx context.Context, fileURL string) ([]byte, string, error) {
req, err := http.NewRequestWithContext(ctx, http.MethodGet, fileURL, nil)
if err != nil {