[Enhancement]: More fine grained encoding (m4b merge tool) #803

Closed
opened 2026-04-24 23:22:11 +02:00 by adam · 2 comments
Owner

Originally created by @ceramicwhite on GitHub (Dec 7, 2022).

Describe the feature/enhancement

Currently when using the encoder it automatically encodes for 64kbps and 2 channel but I find this to not always be the preferred encoding options. As an all around those settings are good especially for inputs that for example 128kbps the output is 50% reduced and almost lossless.
But for inputs 32kbps & 1 channel, it actually degrades quality from my testing and also increases file size considerably.

For example

Input:
32kbps, 2050 Hz, 1 channel
File Size: 223mb
input

Audiobookshelf output (-map 0:a -acodec aac -ac 2 -b:a 64k -f mp4 output.m4b):
64kpbs, 22050hz, 2 channels.
File Size: 386mb +60% increase

2-channel

Copy input codec (-codec copy):
8kbps, 22050 Hz, 1 channel
File Size: 240mb +3% increase

codec-copy

From testing the above with a nice pair of headphones the 1 channel -codec copy sounded better than audiobookshelf 2 channel encoding. Of course, that's just preference but in any case the 60% increase in file size alone is not worth mapping the audio as 2 channel.

A feature to ffprobe the input and encode based on that I think would be preferred, for example above for CD quality 320kbps, 44100Hz, 2 channel current encoding is great but for 32kbps, 1 channel, just doing a copy I think is preferential.

A potential feature would be to show the user info about the input tracks quality and then offer multiple options to choose from when concatenating into an m4b

Originally created by @ceramicwhite on GitHub (Dec 7, 2022). ### Describe the feature/enhancement Currently when using the encoder it automatically encodes for 64kbps and 2 channel but I find this to not always be the preferred encoding options. As an all around those settings are good especially for inputs that for example 128kbps the output is 50% reduced and almost lossless. But for inputs 32kbps & 1 channel, it actually degrades quality from my testing and also increases file size considerably. For example Input: 32kbps, 2050 Hz, 1 channel File Size: 223mb ![input](https://user-images.githubusercontent.com/7660824/206279729-1488e880-5282-419c-9c5d-fcb177ad5511.png) Audiobookshelf output (`-map 0:a -acodec aac -ac 2 -b:a 64k -f mp4 output.m4b`): 64kpbs, 22050hz, 2 channels. File Size: 386mb +60% increase ![2-channel](https://user-images.githubusercontent.com/7660824/206279832-fbeb163e-70cc-491f-9241-74b1d3728ff5.png) Copy input codec (`-codec copy`): 8kbps, 22050 Hz, 1 channel File Size: 240mb +3% increase ![codec-copy](https://user-images.githubusercontent.com/7660824/206279898-9fe7fb7d-1fa6-4048-92f8-e304a01b62ac.png) From testing the above with a nice pair of headphones the 1 channel `-codec copy` sounded better than audiobookshelf 2 channel encoding. Of course, that's just preference but in any case the 60% increase in file size alone is not worth mapping the audio as 2 channel. A feature to ffprobe the input and encode based on that I think would be preferred, for example above for CD quality 320kbps, 44100Hz, 2 channel current encoding is great but for 32kbps, 1 channel, just doing a copy I think is preferential. A potential feature would be to show the user info about the input tracks quality and then offer multiple options to choose from when concatenating into an m4b
adam added the enhancementencoding/embedding labels 2026-04-24 23:22:11 +02:00
adam closed this issue 2026-04-24 23:22:11 +02:00
Author
Owner

@advplyr commented on GitHub (Dec 20, 2022):

Updates were made in v2.2.11

Not all the way there, but some customization in the meantime. https://github.com/advplyr/audiobookshelf/issues/1029#issuecomment-1358645233

@advplyr commented on GitHub (Dec 20, 2022): Updates were made in [v2.2.11](https://github.com/advplyr/audiobookshelf/releases/tag/v2.2.11) Not all the way there, but some customization in the meantime. https://github.com/advplyr/audiobookshelf/issues/1029#issuecomment-1358645233
Author
Owner

@github-actions[bot] commented on GitHub (May 15, 2025):

Fixed in v2.22.0.

@github-actions[bot] commented on GitHub (May 15, 2025): Fixed in [v2.22.0](https://github.com/advplyr/audiobookshelf/releases/tag/v2.22.0).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#803