Skip to content

Fix concatenated file size inflation by preserving source bitrate#204

Merged
dir01 merged 1 commit intomasterfrom
claude/fix-concat-file-size-lQX4s
Mar 5, 2026
Merged

Fix concatenated file size inflation by preserving source bitrate#204
dir01 merged 1 commit intomasterfrom
claude/fix-concat-file-size-lQX4s

Conversation

@dir01
Copy link
Copy Markdown
Owner

@dir01 dir01 commented Mar 5, 2026

No description provided.

When re-encoding (audioCodec != "copy"), ffmpeg defaults to 128kbps which
inflates output when source files use lower bitrates (e.g. 32k for audiobooks).
Now probes the first input file's bitrate via ffprobe and passes -b:a to match.

https://claude.ai/code/session_01V69UAXC51BGJok9wBP1xmN
@dir01 dir01 merged commit 63761fc into master Mar 5, 2026
2 of 3 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f861e091c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// getAudioBitrate probes the audio bitrate of the given file using ffprobe.
// Returns bitrate as a string like "128000" (bits per second).
func (conv *FFMpegMediaProcessor) getAudioBitrate(filepath string) (string, error) {
cmd := exec.Command(
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use caller context when running bitrate probe

Concatenate is context-aware, but getAudioBitrate launches ffprobe with exec.Command instead of exec.CommandContext, so cancellation/timeouts are ignored during the new probe step. If ffprobe stalls (for example on problematic media on slow storage), the job can run past the flow timeout before it even starts ffmpeg, which is a regression introduced by this commit’s preflight probe.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants