stefanf
September 4, 2026, 6:50am
1
I want to be able to upload and use HiFi audio in music video’s - 24 bit 48kH and higher file rates.
Is this possible in PT and or can I set the quality I want (FFMPEG settings).
NOTE; the amount of space needed for better audio is neglectable compared to HD vs 4K video and although basic settings are OK (ish) trend is higher (CD quality) audio for music video’s.
Information is limited. FFmpeg settings are now for something like 128 kbit aac ?
stefanf
September 5, 2026, 8:10am
2
I found the PPMpeg over ride plug-in and testing it now. It provides options for increasing the standard ffmpeg settings sed by Peertube.
learning by doing… Now see it I can get to max CD quality uploads (but only needed for music video’s so See how I can toggle this…)
https://www.npmjs.com/package/peertube-plugin-ultimate-transcoding
ambar
September 16, 2026, 7:51am
3
Hi @stefanf
Did you find a way to toggle this feature ?
stefanf
September 16, 2026, 8:06am
4
Hi @ambar
Yeah - I contacted the maker of the plug-in and he did some tweaking and released a new version.
I have now been able to publish about 320kbps (378 effectively) and we would like to go higher (CD quality 16-44.1 or even 24-48/96 flac)
And I am dreaming of AC3 multichannel dolby surround… (like Netflix has…)
but at the moment PT does only allow AAC.
I think this could be a game changer for PT for music lovers…
Anyway - let me know what you think.
ambar
September 16, 2026, 8:09am
5
Hey that sounds great ! Smart move to contact the dev directly.
I can notify @Chocobozzz that you’d love AAC on PT.
Do you think We can mark this topic as resolved ?
stefanf
September 16, 2026, 9:27am
6
we already have AAC and can enable higher bitrates. But now we would like to have other (ffMpeg facilitated) codecs to be supported.
see here:
opened 12:36AM - 10 Sep 26 UTC
Disclaimer: the issue was AI generated, but I support it to enable FLAC audio st… reaming in the web player.
## Describe the current behavior
`getAudioStreamCodec()` in `server/core/helpers/ffmpeg/codecs.ts` maps an audio
codec name to the `CODECS` attribute written into the HLS master playlist. It
knows four codecs and falls back to AAC for everything else:
```ts
if (audioCodecName === 'opus') return 'opus'
if (audioCodecName === 'vorbis') return 'vorbis'
if (audioCodecName === 'aac') return 'mp4a.40.2'
if (audioCodecName === 'mp3') return 'mp4a.40.34'
logger.warn('Cannot get audio codec of %s.', path, { audioStream })
return 'mp4a.40.2' // Fallback
```
That value is written verbatim into `#EXT-X-STREAM-INF:...,CODECS="..."` in
`server/core/lib/hls.ts`. When an audio rendition holds any other codec, the
manifest tells the player the audio is AAC when it is not. hls.js creates a
`SourceBuffer` for `mp4a.40.2`, appending the real segments fails, and playback
stops.
With a FLAC audio rendition, the file on disk is correct:
```
$ ffprobe -select_streams a:0 -show_entries stream=codec_name,channels,bit_rate ...-0-fragmented.mp4
codec_name=flac
channels=2
bit_rate=194386
```
while the manifest describes it as AAC:
```
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="Audio",AUTOSELECT=YES,DEFAULT=YES,URI="....m3u8"
#EXT-X-STREAM-INF:BANDWIDTH=923594,RESOLUTION=1280x720,FRAME-RATE=30,CODECS="avc1.64001f,mp4a.40.2",AUDIO="audio"
```
and the player fails:
```
HLS.js error: mediaError - fatal: false - bufferAppendingError
HLS.js error: mediaError - fatal: false - bufferAppendError
VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) The media could not be loaded,
either because the server or network failed or because the format is not supported.
```
Everything else in the chain works: ffmpeg muxes FLAC into fMP4 without complaint,
the transcoding job completes, the video is published, and the video renditions are
unaffected. Only the codec string is wrong, and the fallback is silent apart from a
`logger.warn`, so the failure surfaces only in the browser.
Note that stock PeerTube cannot currently produce a non-AAC HLS audio rendition:
the audio encoders are `libfdk_aac` and `aac`, and `canDoQuickAudioTranscode()`
requires the source to be AAC. Today this is reached through a transcoding plugin
whose audio builder returns `copy: true` for a non-AAC stream, which the plugin
API explicitly allows. The same silent breakage would apply to any codec added
later.
## Steps to reproduce
1. Register a transcoding plugin whose audio builder returns `{ copy: true }` for a non-AAC source.
2. Upload a video whose audio track is FLAC, stereo, 44.1 kHz, with HLS enabled.
3. Open the video once transcoding finishes.
## Describe the expected behavior
The manifest describes the codec the rendition actually contains, and the browser
plays it. Chromium supports FLAC in MP4, including through Media Source
Extensions, which is what hls.js uses:
```js
document.createElement('video').canPlayType('audio/mp4; codecs="flac"') // "probably"
MediaSource.isTypeSupported('audio/mp4; codecs="flac"') // true
MediaSource.isTypeSupported('audio/mp4; codecs="fLaC"') // true
```
Adding the mapping would be enough for this case:
```ts
if (audioCodecName === 'flac') return 'fLaC'
```
`fLaC` is the ISO BMFF sample entry name for FLAC; Chromium accepts either
spelling.
Separately, and independent of FLAC: returning a *wrong* codec string as a
fallback guarantees an unplayable stream, whereas `CODECS` is an optional
attribute in the HLS specification. Returning `''` for an unknown codec — which
`hls.ts` already filters out of the joined list — would let the player work it out
instead of being told something false, so any unrecognised codec would fail softly
rather than fatally.
## Additional information
* PeerTube instance:
* URL: local test instance, not publicly reachable
* Version: 8.2.4
* NodeJS version: v22.23.2
* Ffmpeg version: 7.1.5-0+deb13u1 (as shipped in `chocobozzz/peertube:v8.2.4-trixie`)
* Browser name, version and platforms on which you could reproduce the bug: Chromium 151.0.7922.173, Linux
* Link to browser console log if relevant: quoted above — `bufferAppendError` from hls.js, followed by `MEDIA_ERR_SRC_NOT_SUPPORTED` from video.js
* Link to server log if relevant: the transcoding job logs no error; it completes normally and publishes the video
Configuration: HLS enabled with split audio and video.
ambar
September 16, 2026, 10:00am
7
Oh yeah, sorry for the confusion, and thank you for the suggestion that would be great !