Skip to content

Conversation

@slhck
Copy link
Owner

@slhck slhck commented Oct 18, 2025

Add support for selective audio stream normalization, addressing issue #285.

New CLI arguments:

  • -as/--audio-streams: Select specific audio streams by index (comma-separated)
  • --audio-default-only: Only normalize audio streams with 'default' disposition
  • --keep-other-audio: Keep non-selected streams as passthrough (unchanged)

Implementation details:

  • Added is_default flag to AudioStream to track disposition
  • Updated MediaFile.parse_streams() to parse "(default)" flag from FFmpeg output
  • Added _get_streams_to_normalize() method to filter streams based on selection
  • Updated first pass, filter generation, and second pass for selected + passthrough streams
  • Proper output stream index tracking for correct codec assignment

Validation:

  • Prevents using both -as and --audio-default-only together
  • Prevents using both --keep-other-audio and --keep-original-audio together

Tests:

  • Added 6 new test cases covering all scenarios
  • All 46 tests passing (40 original + 6 new)

Documentation:

  • Updated docs/usage/options.md with complete documentation for new options

Add support for selective audio stream normalization, addressing issue #285.

New CLI arguments:

- `-as/--audio-streams`: Select specific audio streams by index (comma-separated)
- `--audio-default-only`: Only normalize audio streams with 'default' disposition
- `--keep-other-audio`: Keep non-selected streams as passthrough (unchanged)

Implementation details:

- Added `is_default` flag to AudioStream to track disposition
- Updated MediaFile.parse_streams() to parse "(default)" flag from FFmpeg output
- Added _get_streams_to_normalize() method to filter streams based on selection
- Updated first pass, filter generation, and second pass for selected + passthrough streams
- Proper output stream index tracking for correct codec assignment

Validation:

- Prevents using both `-as` and `--audio-default-only` together
- Prevents using both `--keep-other-audio` and `--keep-original-audio` together

Tests:

- Added 6 new test cases covering all scenarios
- All 46 tests passing (40 original + 6 new)

Documentation:

- Updated docs/usage/options.md with complete documentation for new options
@slhck slhck merged commit 3721e19 into master Oct 21, 2025
5 checks passed
@slhck slhck deleted the feature/stream-selection branch October 21, 2025 07:34
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