Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Use better audio VBR settings #11492

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

gnattu
Copy link
Member

@gnattu gnattu commented May 5, 2024

LAME's VBR mode only has advantage over a certain bitrate range. For very low and very high bitrate, use the ABR mode instead.

aac_at's CVBR mode produces very good quality and is not worse than its TVBR mode in blind testing. Use this mode for convenience.

The ffmpeg native aac encoder will have quality regression with its VBR mode. Always use CBR mode for ffmpeg's native aac encoder.

This also adds EnableAudioVbrEncoding to TranscodingProfile, enables the client to selectively disable VBR transcoding when it causes playback problems.

Changes

  • Use ABR for libmp3lame when VBR mode has its limitation
  • Supports aac_at's CVBR mode
  • Adds EnableAudioVbrEncoding to TranscodingProfile

Issues

@gnattu gnattu changed the title Use better audio VBR settings [WIP] Use better audio VBR settings May 5, 2024
Copy link

github-actions bot commented May 6, 2024

Changes in OpenAPI specification found. Expand to see details.

What's Changed


GET /Audio/{itemId}/stream
Parameters:

Added: enableAudioVbrEncoding in query

Optional. Whether to enable Audio Encoding.

HEAD /Audio/{itemId}/stream
Parameters:

Added: enableAudioVbrEncoding in query

Optional. Whether to enable Audio Encoding.

GET /Audio/{itemId}/stream.{container}
Parameters:

Added: enableAudioVbrEncoding in query

Optional. Whether to enable Audio Encoding.

HEAD /Audio/{itemId}/stream.{container}
Parameters:

Added: enableAudioVbrEncoding in query

Optional. Whether to enable Audio Encoding.

GET /Audio/{itemId}/hls1/{playlistId}/{segmentId}.{container}
Parameters:

Added: enableAudioVbrEncoding in query

Optional. Whether to enable Audio Encoding.

GET /Audio/{itemId}/main.m3u8
Parameters:

Added: enableAudioVbrEncoding in query

Optional. Whether to enable Audio Encoding.

GET /Audio/{itemId}/master.m3u8
Parameters:

Added: enableAudioVbrEncoding in query

Optional. Whether to enable Audio Encoding.

HEAD /Audio/{itemId}/master.m3u8
Parameters:

Added: enableAudioVbrEncoding in query

Optional. Whether to enable Audio Encoding.

GET /Videos/{itemId}/hls1/{playlistId}/{segmentId}.{container}
Parameters:

Added: enableAudioVbrEncoding in query

Optional. Whether to enable Audio Encoding.

GET /Videos/{itemId}/live.m3u8
Parameters:

Added: enableAudioVbrEncoding in query

Optional. Whether to enable Audio Encoding.

GET /Videos/{itemId}/main.m3u8
Parameters:

Added: enableAudioVbrEncoding in query

Optional. Whether to enable Audio Encoding.

GET /Videos/{itemId}/master.m3u8
Parameters:

Added: enableAudioVbrEncoding in query

Whether to enable Audio Encoding.

HEAD /Videos/{itemId}/master.m3u8
Parameters:

Added: enableAudioVbrEncoding in query

Whether to enable Audio Encoding.

GET /Audio/{itemId}/universal
Parameters:

Added: enableAudioVbrEncoding in query

Optional. Whether to enable Audio Encoding.

HEAD /Audio/{itemId}/universal
Parameters:

Added: enableAudioVbrEncoding in query

Optional. Whether to enable Audio Encoding.

GET /Videos/{itemId}/stream
Parameters:

Added: enableAudioVbrEncoding in query

Optional. Whether to enable Audio Encoding.

HEAD /Videos/{itemId}/stream
Parameters:

Added: enableAudioVbrEncoding in query

Optional. Whether to enable Audio Encoding.

GET /Videos/{itemId}/stream.{container}
Parameters:

Added: enableAudioVbrEncoding in query

Optional. Whether to enable Audio Encoding.

HEAD /Videos/{itemId}/stream.{container}
Parameters:

Added: enableAudioVbrEncoding in query

Optional. Whether to enable Audio Encoding.

POST /Items/{itemId}/PlaybackInfo
Request:

Changed content type : application/json

Updated PlaybackInfoDto :

  • Changed property DeviceProfile (object)

Gets or sets the device profile.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

Changed content type : text/json

Updated PlaybackInfoDto :

  • Changed property DeviceProfile (object)

Gets or sets the device profile.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

Changed content type : application/*+json

Updated PlaybackInfoDto :

  • Changed property DeviceProfile (object)

Gets or sets the device profile.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

POST /LiveStreams/Open
Request:

Changed content type : application/json

Updated OpenLiveStreamDto :

  • Changed property DeviceProfile (object)

Gets or sets the device profile.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

Changed content type : text/json

Updated OpenLiveStreamDto :

  • Changed property DeviceProfile (object)

Gets or sets the device profile.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

Changed content type : application/*+json

Updated OpenLiveStreamDto :

  • Changed property DeviceProfile (object)

Gets or sets the device profile.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

POST /Sessions/Capabilities/Full
Request:

Changed content type : application/json

Updated ClientCapabilitiesDto :

  • Changed property DeviceProfile (object)

Gets or sets the device profile.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

Changed content type : text/json

Updated ClientCapabilitiesDto :

  • Changed property DeviceProfile (object)

Gets or sets the device profile.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

Changed content type : application/*+json

Updated ClientCapabilitiesDto :

  • Changed property DeviceProfile (object)

Gets or sets the device profile.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

GET /Devices/Info
Return Type:

Changed response : 200 OK

Device info retrieved.

  • Changed content type : application/json

openapi-base openapi-changes.md openapi-head Changed property Capabilities (object)

Gets or sets the capabilities.

Updated ClientCapabilities :
openapi-base openapi-changes.md openapi-head Changed property DeviceProfile (object)

A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.


Specifically, it defines the supported containers and
codecs (video and/or audio, including codec profiles and levels)
the device is able to direct play (without transcoding or remuxing),
as well as which containers/codecs to transcode to in case it isn't.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

  • Changed content type : application/json; profile="CamelCase"

openapi-base openapi-changes.md openapi-head Changed property Capabilities (object)

Gets or sets the capabilities.

Updated ClientCapabilities :
openapi-base openapi-changes.md openapi-head Changed property DeviceProfile (object)

A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.


Specifically, it defines the supported containers and
codecs (video and/or audio, including codec profiles and levels)
the device is able to direct play (without transcoding or remuxing),
as well as which containers/codecs to transcode to in case it isn't.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

  • Changed content type : application/json; profile="PascalCase"

openapi-base openapi-changes.md openapi-head Changed property Capabilities (object)

Gets or sets the capabilities.

Updated ClientCapabilities :
openapi-base openapi-changes.md openapi-head Changed property DeviceProfile (object)

A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.


Specifically, it defines the supported containers and
codecs (video and/or audio, including codec profiles and levels)
the device is able to direct play (without transcoding or remuxing),
as well as which containers/codecs to transcode to in case it isn't.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

GET /Sessions
Return Type:

Changed response : 200 OK

List of sessions returned.

  • Changed content type : application/json

Changed items (object):

Class SessionInfo.

openapi-base openapi-changes.md openapi-head Changed property Capabilities (object)

Updated ClientCapabilities :
openapi-base openapi-changes.md openapi-head Changed property DeviceProfile (object)

A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.


Specifically, it defines the supported containers and
codecs (video and/or audio, including codec profiles and levels)
the device is able to direct play (without transcoding or remuxing),
as well as which containers/codecs to transcode to in case it isn't.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

  • Changed content type : application/json; profile="CamelCase"

Changed items (object):

Class SessionInfo.

openapi-base openapi-changes.md openapi-head Changed property Capabilities (object)

Updated ClientCapabilities :
openapi-base openapi-changes.md openapi-head Changed property DeviceProfile (object)

A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.


Specifically, it defines the supported containers and
codecs (video and/or audio, including codec profiles and levels)
the device is able to direct play (without transcoding or remuxing),
as well as which containers/codecs to transcode to in case it isn't.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

  • Changed content type : application/json; profile="PascalCase"

Changed items (object):

Class SessionInfo.

openapi-base openapi-changes.md openapi-head Changed property Capabilities (object)

Updated ClientCapabilities :
openapi-base openapi-changes.md openapi-head Changed property DeviceProfile (object)

A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.


Specifically, it defines the supported containers and
codecs (video and/or audio, including codec profiles and levels)
the device is able to direct play (without transcoding or remuxing),
as well as which containers/codecs to transcode to in case it isn't.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

GET /Devices
Return Type:

Changed response : 200 OK

Devices retrieved.

  • Changed content type : application/json

openapi-base openapi-changes.md openapi-head Changed property Items (array)

Gets or sets the items.

Changed items (object):

openapi-base openapi-changes.md openapi-head Changed property Capabilities (object)

Gets or sets the capabilities.

Updated ClientCapabilities :
openapi-base openapi-changes.md openapi-head Changed property DeviceProfile (object)

A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.


Specifically, it defines the supported containers and
codecs (video and/or audio, including codec profiles and levels)
the device is able to direct play (without transcoding or remuxing),
as well as which containers/codecs to transcode to in case it isn't.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

  • Changed content type : application/json; profile="CamelCase"

openapi-base openapi-changes.md openapi-head Changed property Items (array)

Gets or sets the items.

Changed items (object):

openapi-base openapi-changes.md openapi-head Changed property Capabilities (object)

Gets or sets the capabilities.

Updated ClientCapabilities :
openapi-base openapi-changes.md openapi-head Changed property DeviceProfile (object)

A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.


Specifically, it defines the supported containers and
codecs (video and/or audio, including codec profiles and levels)
the device is able to direct play (without transcoding or remuxing),
as well as which containers/codecs to transcode to in case it isn't.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

  • Changed content type : application/json; profile="PascalCase"

openapi-base openapi-changes.md openapi-head Changed property Items (array)

Gets or sets the items.

Changed items (object):

openapi-base openapi-changes.md openapi-head Changed property Capabilities (object)

Gets or sets the capabilities.

Updated ClientCapabilities :
openapi-base openapi-changes.md openapi-head Changed property DeviceProfile (object)

A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.


Specifically, it defines the supported containers and
codecs (video and/or audio, including codec profiles and levels)
the device is able to direct play (without transcoding or remuxing),
as well as which containers/codecs to transcode to in case it isn't.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

POST /Users/AuthenticateByName
Return Type:

Changed response : 200 OK

User authenticated.

  • Changed content type : application/json

openapi-base openapi-changes.md openapi-head Changed property SessionInfo (object)

Class SessionInfo.

Updated SessionInfo :
openapi-base openapi-changes.md openapi-head Changed property Capabilities (object)

Updated ClientCapabilities :
openapi-base openapi-changes.md openapi-head Changed property DeviceProfile (object)

A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.


Specifically, it defines the supported containers and
codecs (video and/or audio, including codec profiles and levels)
the device is able to direct play (without transcoding or remuxing),
as well as which containers/codecs to transcode to in case it isn't.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

  • Changed content type : application/json; profile="CamelCase"

openapi-base openapi-changes.md openapi-head Changed property SessionInfo (object)

Class SessionInfo.

Updated SessionInfo :
openapi-base openapi-changes.md openapi-head Changed property Capabilities (object)

Updated ClientCapabilities :
openapi-base openapi-changes.md openapi-head Changed property DeviceProfile (object)

A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.


Specifically, it defines the supported containers and
codecs (video and/or audio, including codec profiles and levels)
the device is able to direct play (without transcoding or remuxing),
as well as which containers/codecs to transcode to in case it isn't.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

  • Changed content type : application/json; profile="PascalCase"

openapi-base openapi-changes.md openapi-head Changed property SessionInfo (object)

Class SessionInfo.

Updated SessionInfo :
openapi-base openapi-changes.md openapi-head Changed property Capabilities (object)

Updated ClientCapabilities :
openapi-base openapi-changes.md openapi-head Changed property DeviceProfile (object)

A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.


Specifically, it defines the supported containers and
codecs (video and/or audio, including codec profiles and levels)
the device is able to direct play (without transcoding or remuxing),
as well as which containers/codecs to transcode to in case it isn't.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

POST /Users/AuthenticateWithQuickConnect
Return Type:

Changed response : 200 OK

User authenticated.

  • Changed content type : application/json

openapi-base openapi-changes.md openapi-head Changed property SessionInfo (object)

Class SessionInfo.

Updated SessionInfo :
openapi-base openapi-changes.md openapi-head Changed property Capabilities (object)

Updated ClientCapabilities :
openapi-base openapi-changes.md openapi-head Changed property DeviceProfile (object)

A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.


Specifically, it defines the supported containers and
codecs (video and/or audio, including codec profiles and levels)
the device is able to direct play (without transcoding or remuxing),
as well as which containers/codecs to transcode to in case it isn't.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

  • Changed content type : application/json; profile="CamelCase"

openapi-base openapi-changes.md openapi-head Changed property SessionInfo (object)

Class SessionInfo.

Updated SessionInfo :
openapi-base openapi-changes.md openapi-head Changed property Capabilities (object)

Updated ClientCapabilities :
openapi-base openapi-changes.md openapi-head Changed property DeviceProfile (object)

A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.


Specifically, it defines the supported containers and
codecs (video and/or audio, including codec profiles and levels)
the device is able to direct play (without transcoding or remuxing),
as well as which containers/codecs to transcode to in case it isn't.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

  • Changed content type : application/json; profile="PascalCase"

openapi-base openapi-changes.md openapi-head Changed property SessionInfo (object)

Class SessionInfo.

Updated SessionInfo :
openapi-base openapi-changes.md openapi-head Changed property Capabilities (object)

Updated ClientCapabilities :
openapi-base openapi-changes.md openapi-head Changed property DeviceProfile (object)

A MediaBrowser.Model.Dlna.DeviceProfile represents a set of metadata which determines which content a certain device is able to play.


Specifically, it defines the supported containers and
codecs (video and/or audio, including codec profiles and levels)
the device is able to direct play (without transcoding or remuxing),
as well as which containers/codecs to transcode to in case it isn't.

Updated DeviceProfile :
openapi-base openapi-changes.md openapi-head Changed property TranscodingProfiles (array)

Gets or sets the transcoding profiles.

Changed items (object):

openapi-base openapi-changes.md openapi-head Added property EnableAudioVbrEncoding (boolean)

@gnattu gnattu added the enhancement Improving an existing function, or small fixes label May 8, 2024
@jellyfin-bot jellyfin-bot added the merge conflict Merge conflicts should be resolved before a merge label May 15, 2024
@jellyfin-bot
Copy link
Contributor

This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.

LAME's VBR mode only has advantage over a certain bitrate range. For very low and very high bitrate, use the ABR mode instead.

aac_at's CVBR mode produces very good quality and is not worse than its TVBR mode in blind testing. Use this mode for convenience.

The ffmpeg native aac encoder will have quality regression with its VBR mode. Always use CBR mode for ffmpeg's native aac encoder.

Signed-off-by: gnattu <gnattuoc@me.com>
This will allow the client selectively disable VBR audio when it causes problems.

Signed-off-by: gnattu <gnattuoc@me.com>
This will match the old behavior when user takes no action for clients

Signed-off-by: gnattu <gnattuoc@me.com>
Signed-off-by: gnattu <gnattuoc@me.com>
@jellyfin-bot jellyfin-bot removed the merge conflict Merge conflicts should be resolved before a merge label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving an existing function, or small fixes
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

None yet

2 participants