Skip to content

Option to select bitrate based on quality #92

Open
@abbrev

Description

@abbrev

I added a --quality N option to opusenc.c which automatically selects the bitrate depending on the number of channels in the input file. The quality scale is the same as Vorbis; that is, -2 to 10, with 3 being nearly transparent. With a bit of testing of levels -1 through 2 (I tested with a stock oggenc which doesn't support below -1), I get roughly the same audio quality output as oggenc (of course, Opus requires somewhat lower bitrate than Vorbis for the same quality). At quality level 3 and above I have a hard time distinguishing them from lossless, so there may be room for tuning the bitrates for quality 3 and above.

With this option you can do, for example:

opusenc --quality 3 mono.flac
opusenc --quality 3 stereo.flac
opusenc --quality 3 5.1.flac
opusenc --quality 3 7.1.flac

and get approximately the same audio quality from mono, stereo, and 5.1 or 7.1 surround.

Before I put in more effort to test and polish up my changes, how much real interest is there in this option? I saw some interest at https://hydrogenaud.io/index.php/topic,116997.0.html (and some discussion of bitrate vs quality at https://hydrogenaud.io/index.php/topic,120007.75.html). And I personally like the concept of having one knob to control the quality rather than having to set the bitrate depending on how many channels the input file has (having used Ogg Vorbis a lot in the past, it feels almost natural to me). And how likely is this feature to be merged?

I added this option based on the v0.2 tag, but I noticed that the master branch has changes related to handling channel configurations that affect mine. So I'd have to rebase to master if that's where it needs to go, assuming this gets enough interest.

Edit to add: there's more discussion about bitrate vs quality at https://hydrogenaud.io/index.php/topic,120007.75.html.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions