Transcode: Target MB per video, whatever its length [skip ci] #1
Loading…
Reference in a new issue
No description provided.
Delete branch "transcode/target-per-video"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Moved from GitHub: https://github.com/bugz8unny69/AniKeepOrNot/pull/332
Why
In AniKeepOrNot's Settings → Transcode, "Target MB per 24 minutes" assumed episodes are 24 minutes long, and read as "another 500 MB every 24 minutes". The owner wants one size per video.
What changes
target_bytes(mb)no longer takes the duration.video_kbpsspreads the whole target over the video's length, so a longer video gets a lower bitrate. Audio is still budgeted first, with 1% reserved for the container.adm transcode staged(including--dry-runestimates) and the batch skip check all use the per-video target.docs/TRANSCODE_AGENT.mdand the dashboard audit are updated.Compatibility
The stored key
transcode.target_mband its default of 500 are unchanged, so no settings migration or schema bump is needed. An existing value now means "per video".Trade-off
Because the size is fixed, video quality now drops as length grows. A 48-minute episode gets about half the bitrate of a 24-minute one at the same target. For a long video (a movie) with several audio tracks, the target can be too small to fit the audio at all. In that case the encode fails with the existing "Target size is too small for the audio tracks" error, and the original is kept.
Validation
target_bytes(500)= 500,000,000 bytes, independent of length.python -m src.anime.tests.run_batches: 41/41 batches passed.node --test src/anime/tests/dashboard_browser.test.cjs: 44 passed.🤖 Generated with Claude Code
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.