From 341534ab785582ce9ef93959e4a225e319f23e06 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sat, 19 Sep 2026 19:08:47 +0200 Subject: [PATCH] Added the used Opus bitrate to the media pipeline logs --- .../Tools/Services/MediaTranscriptionService.cs | 8 ++++++++ runtime/src/media.rs | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/MindWork AI Studio/Tools/Services/MediaTranscriptionService.cs b/app/MindWork AI Studio/Tools/Services/MediaTranscriptionService.cs index b89dcb29..cd137f07 100644 --- a/app/MindWork AI Studio/Tools/Services/MediaTranscriptionService.cs +++ b/app/MindWork AI Studio/Tools/Services/MediaTranscriptionService.cs @@ -653,6 +653,14 @@ public sealed class MediaTranscriptionService( // re-encoding it could only take quality away, never add any. var opusBitrateBps = settingsManager.ConfigurationData.App.OpusBitrate.GetBitsPerSecond(); + // Which quality an upload was produced with is the first question to ask when a transcript + // comes back missing something, so it has to be in the log of the job it belongs to: + logger.LogInformation( + "Normalizing media for operation {OperationId}; re-encoding uses the Opus bitrate {OpusBitrate} ({OpusBitrateBps} bps).", + operation.Id, + settingsManager.ConfigurationData.App.OpusBitrate, + opusBitrateBps); + // The quick POST is intentionally not cancelled: losing its response could orphan a job // whose ID the client never received. Cancellation is applied immediately after ownership. var jobId = await rustService.StartMediaJobAsync(mediaPath, normalizedPath, opusBitrateBps, CancellationToken.None); diff --git a/runtime/src/media.rs b/runtime/src/media.rs index 1378fe7d..ce7490a4 100644 --- a/runtime/src/media.rs +++ b/runtime/src/media.rs @@ -632,7 +632,10 @@ fn normalize_media(input_path: &FilePath, output_path: &FilePath, max_pass_throu && params.sample_rate == Some(OUTPUT_SAMPLE_RATE) && channels == 1 && input_path.metadata().map(|metadata| metadata.len() <= max_pass_through_bytes).unwrap_or(false); - log::info!("media normalization decision: track_id={track_id}, pass_through={pass_through}, codec={detected_codec}, channels={channels}"); + // A pass-through never reaches the encoder, so no bitrate is applied to it. Logging the one we + // would have used anyway would send support looking for an encoding which never happened: + let applied_opus_bitrate_bps = (!pass_through).then_some(opus_bitrate_bps); + log::info!("media normalization decision: track_id={track_id}, pass_through={pass_through}, codec={detected_codec}, channels={channels}, opus_bitrate_bps={applied_opus_bitrate_bps:?}"); let partial_path = partial_path(output_path); if let Some(parent) = partial_path.parent() {