Skip to content

Conversation

@morgant
Copy link
Contributor

@morgant morgant commented Nov 24, 2025

NOTE: This is applied ontop of PR #13, which fixes audio/video desync. I'll rebase this as that PR is updated and merged (hopefully.)

As noted in issue #11, I had found that while my now-merged implementation of CBR (constant bit rate) in issue #6 has been working well, I was seeing fluctuations in the audio bit rate.

While our use of the AAC encoder implies it should be generating CBR, I found that ffmpeg supports the -minrate, -maxrate, and -bufsize options for all encoders. So, this splits our buffer size variables into audio & video versions and sets -minrate, -maxrate, and -bufsize appropriately to produce a CBR for both audio & video.

It has been working correctly in my testing, but I'll want to re-test after #13 is merged.

…nc as my understanding is that will let ffmpeg drop packets it couldn't process fast enough instead of forcing them to be queued and processed in order, regardless of timing. Issue rfht#5
…512', plus only on the video & audio input when encoding, not on the raw audio inputs being merged). Also introduces the use of the filter on the individual audio streams being merged/mixed-down _and_ when merging the video and audio. The latter required moving the audio encoding to the ffmpeg process which is encoding the video. By using the 'async=1' option, the 'aresample' filter will fill and/or trim audio to keep it synced, but will not perform the more advanced stretch and/or sqeezing (I think this makes sense for our uses and _should_ be more efficient). Issue rfht#5
…; if line is too long, break with additional indentation) and tabs for indentation
…ched '*_bufsize' & 'gop' calculations from using 'expr' to arithmetic expansion expressions. Sets '-minrate', '-maxrate', and '-bufsize' for the audio track, in addition to '-b:a', when assembling AUDIO_CONV. Issue rfht#11
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.

1 participant