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
Fixed audio chunk size support #405
Comments
This is probably a good encoder knob to have. As things stand today, this would really only be useful for Opus, right? Since the packet for most others are ~fixed. |
Opus is certainly what was at the top of my mind :). FLAC also supports different frame sizes, but Chrome doesn't even support FLAC encoding (booooo), so Opus is the most relevant. |
@tguilbert-google, FYI, putting TPAC labels on this and related bugs as these seem like great discussion topics for WebRTC : Media joint session (a chance to review the proposals you're working on). |
If I'm not mistaken, this was fixed for Opus in #551. I'm closing this issue for now. Please re-open if I'm missing something, or open a new issue for other codecs (e.g. FLAC, but there are no browsers supporting FLAC encoding for the moment). |
(Apologies if this has already been suggested. I couldn't find it.)
Some environments (muxers, protocols) require that each audio chunk contain some fixed number of samples, typically either 20ms worth or the same as some associated video framerate. In FFmpeg terms, this is the "frame size" of the encoder. It would be nice to, for such environments, be able to set a fixed chunk size in
AudioEncoder.configure
.I propose adding an optional
chunkSize
field toAudioEncoderConfig
that restricts the chunk sizes produced by the encoder. Ideally,chunkSize
could be aConstrainULong
, since it's a restriction on the output rather than a property of the input, and that way a maximum or minimum could be set instead of an exact value. SincesampleRate
is optional,chunkSize
may need to be in microseconds instead of samples, or alternatively it may be sensible to makechunkSize
only valid ifsampleRate
is provided. Naturally,isConfigSupported
should reject the configuration if the audio codec doesn't support the requested frame size.Alternatively, it could be encoded into the codec string, but it's not a standard part of codec strings in common MIME types (as far as I'm aware), so that would be a deviation from standards.
The text was updated successfully, but these errors were encountered: