mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-27 09:33:37 +00:00
Added the used Opus bitrate to the media pipeline logs
This commit is contained in:
parent
8049067fb3
commit
341534ab78
@ -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);
|
||||
|
||||
@ -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() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user