[PR #4361] [MERGED] Add FLAC and define the corresponding target sample rate #10037

Closed
opened 2026-02-07 06:12:59 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/4361
Author: @ssenart
Created: 10/22/2020
Status: Merged
Merged: 11/17/2020
Merged by: @joshuaboniface

Base: masterHead: feature/4360-transcoding_flac_downsampling


📝 Commits (4)

  • 28ee4f0 [AudioTranscoding] Add FLAC as supported target audio format and be able to define the corresponding target sample rate
  • 5979151 [AudioTranscoding] Add FLAC as supported target audio format and be able to define the corresponding target sample rate
  • 95ecedb [AudioTranscoding] Add FLAC as supported target audio format and be able to define the corresponding target sample rate
  • 08279e9 Update MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs

📊 Changes

6 files changed (+43 additions, -4 deletions)

View changed files

📝 CONTRIBUTORS.md (+1 -0)
📝 Emby.Dlna/PlayTo/PlayToController.cs (+4 -1)
📝 MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs (+1 -1)
📝 MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs (+2 -0)
📝 MediaBrowser.Model/Dlna/StreamBuilder.cs (+26 -0)
📝 MediaBrowser.Model/Dlna/StreamInfo.cs (+9 -2)

📄 Description

Changes
Currently, if a target DLNA player does not support High Definition FLAC (24 bits and >= 96khz), then the best choice for converting audio stream is choosing MP3 format by using the transcoding profile:

<TranscodingProfiles>
    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" minSegments="0" segmentLength="0" breakOnNonKeyFrames="false" />
</TranscodingProfiles>

However, if we have a player accepting FLAC with a sample rate at 48khz, the best choice would be something like:

<TranscodingProfiles>
    <TranscodingProfile container="flac" type="Audio" audioCodec="flac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" minSegments="0" segmentLength="0" breakOnNonKeyFrames="false" />
</TranscodingProfiles>
<ContainerProfiles />
<CodecProfiles>
    <CodecProfile type="Audio" codec="flac">
        <Conditions>
            <ProfileCondition condition="LessThanEqual" property="AudioSampleRate" value="48000" isRequired="true" />
        </Conditions>
        <ApplyConditions />
    </CodecProfile>
</CodecProfiles>

It means keeping FLAC as target format but down sampling the sample rate from 96khz to 48khz.

It is the case for all Sonos family hardware.

I suggest here to extend the target transcoding format to FLAC and be able to define the maximum accepted sample rate.

Issues
Fixes #4360


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/4361 **Author:** [@ssenart](https://github.com/ssenart) **Created:** 10/22/2020 **Status:** ✅ Merged **Merged:** 11/17/2020 **Merged by:** [@joshuaboniface](https://github.com/joshuaboniface) **Base:** `master` ← **Head:** `feature/4360-transcoding_flac_downsampling` --- ### 📝 Commits (4) - [`28ee4f0`](https://github.com/jellyfin/jellyfin/commit/28ee4f0a7f7b7be954ac2dccc374bf72b1eb4f40) [AudioTranscoding] Add FLAC as supported target audio format and be able to define the corresponding target sample rate - [`5979151`](https://github.com/jellyfin/jellyfin/commit/5979151f118ef48a966368530b5db68f2c72991a) [AudioTranscoding] Add FLAC as supported target audio format and be able to define the corresponding target sample rate - [`95ecedb`](https://github.com/jellyfin/jellyfin/commit/95ecedbce7281e215b7c3c7403e648b0f66622e2) [AudioTranscoding] Add FLAC as supported target audio format and be able to define the corresponding target sample rate - [`08279e9`](https://github.com/jellyfin/jellyfin/commit/08279e91badebf34e34735b8f512ba585fb336d6) Update MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs ### 📊 Changes **6 files changed** (+43 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `CONTRIBUTORS.md` (+1 -0) 📝 `Emby.Dlna/PlayTo/PlayToController.cs` (+4 -1) 📝 `MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs` (+1 -1) 📝 `MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs` (+2 -0) 📝 `MediaBrowser.Model/Dlna/StreamBuilder.cs` (+26 -0) 📝 `MediaBrowser.Model/Dlna/StreamInfo.cs` (+9 -2) </details> ### 📄 Description **Changes** Currently, if a target DLNA player does not support High Definition FLAC (24 bits and >= 96khz), then the best choice for converting audio stream is choosing MP3 format by using the transcoding profile: ```xml <TranscodingProfiles> <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" minSegments="0" segmentLength="0" breakOnNonKeyFrames="false" /> </TranscodingProfiles> ``` However, if we have a player accepting FLAC with a sample rate at 48khz, the best choice would be something like: ```xml <TranscodingProfiles> <TranscodingProfile container="flac" type="Audio" audioCodec="flac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" minSegments="0" segmentLength="0" breakOnNonKeyFrames="false" /> </TranscodingProfiles> <ContainerProfiles /> <CodecProfiles> <CodecProfile type="Audio" codec="flac"> <Conditions> <ProfileCondition condition="LessThanEqual" property="AudioSampleRate" value="48000" isRequired="true" /> </Conditions> <ApplyConditions /> </CodecProfile> </CodecProfiles> ``` It means keeping FLAC as target format but down sampling the sample rate from 96khz to 48khz. It is the case for all Sonos family hardware. I suggest here to extend the target transcoding format to FLAC and be able to define the maximum accepted sample rate. **Issues** Fixes #4360 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 06:12:59 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#10037