You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Default audio bitrate comes from the last audio track instead of the first #128
When a video has more than one audio track, ff4d reads its default audio bitrate from the last track, not the first.
TwoPass._parse_streams() (twopass.py:340-342) sets audio_stream = stream["index"] for every audio stream it finds, so after the loop it holds the last one. Its docstring and the source_audio_br attribute docs both say it's the first track.
This matters for ShadowPlay and OBS clips, which often have game audio on track 0 and a microphone on track 1. The mic track usually has a lower bitrate, so ff4d picks a lower default audio bitrate than the game audio deserves.
The fix: _parse_streams() already collects every audio stream in self.audio_streams, in order. Read the bitrate from self.audio_streams[0] and remove the returned index and the self.probe["streams"][audio_stream] lookup. Add a test with two audio tracks that have different bitrates.
Fix this together with #127 (the MKV bit_rate crash), since both are in the same few lines.
Activity
zfleeman commentedon Oct 22, 2026
Fixed in #130.