Jump to content

[Sonos] FLAC transcoding


ssenart

Recommended Posts

Great job on Emby. I plan to move in from Plex.

 

I have a Sonos player : bit depth: 16 bits, 24 bits;  sample rate: 16khz, 22.05khz, 24khz,32khz,44.1khz,48khz.

I have FLAC music library with files in the sample rates : 44.1khz, 88khz, 96khz, 192khz.

I would like :

- Direct play all files with sample rate below or equals 48khz.

- Down sample (and keep FLAC format) all files with samples rate greater than 48khz down to 48khz : Best quality Sonos can play.

 

In Emby, I have 2 options:

1) Sonos Plugin seems to send FLAC stream directly to the player without transcoding.

Only my FLAC 44.1khz can be played.
Is there a way to configure transcoding rules (such as profile in DLNA) or is it possible to implement transcoding to Sonos supported format (described here https://support.sonos.com/s/article/79?language=en_US).

Typically, in my use case, it would consist in down sample all sample rate greater than 48khz down to 48khz.

 

2) Currently, a better alternative is using DLNA with the profile :
 

  <DirectPlayProfiles>
	<DirectPlayProfile container="mp3,flac,m4a,wma" type="Audio" />
  </DirectPlayProfiles>
  <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>	
  <ContainerProfiles />
  <CodecProfiles>
    <CodecProfile type="Audio" container="flac">
      <Conditions>
        <ProfileCondition condition="LessThanEqual" property="AudioSampleRate" value="48000" isRequired="true" />
      </Conditions>
      <ApplyConditions />
    </CodecProfile>	
  </CodecProfiles> 

It permits to direct play all FLAC format with sample rate below 48khz, and transcode to MP3 for sample rate greater than 48khz.

But, all my Hi Res FLAC are degraded to MP3 ☹️.

Would it be possible to set the output audio sample rate (during transcoding) according to the ProfileCondition rule (here 48khz).

In that case, the following profile will down sample my Hi Res FLAC to the best sample rate supported by Sonos :

  <DirectPlayProfiles>
	<DirectPlayProfile container="mp3,flac,m4a,wma" type="Audio" />
  </DirectPlayProfiles>
  <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>

Same question for AudioBitrate : perhaps it is already done (I did not test it).

I know DLNA change is feasible in Jellyfin. I even suggested a pull request (https://github.com/jellyfin/jellyfin/pull/4361) to integrate that feature.

It would be great having the same feature in Emby.

Thanks a lot for your work,

Stephane

Link to comment
Share on other sites

  • 7 months later...
vdatanet
10 hours ago, embyeros said:

I happen the same all my audio in flac transcoding them to mp3 😭 on my appletv 

 

Please, send your transcoding log in your thread on the Apple TV forum, because I direct play my FLAC files. Apple TV supports FLAC audio.

Link to comment
Share on other sites

  • 1 year later...
embixer1

Is there any update on this? Also, is there a link where I can find what formats/bitrates are supported by current emby Sonos controller?

Link to comment
Share on other sites

50 minutes ago, embixer1 said:

Is there any update on this? Also, is there a link where I can find what formats/bitrates are supported by current emby Sonos controller?

HI, what exactly are you asking for? You can send any Emby-supported content to Sonos for playback. If it's not supported by the Sonos then the server will transcode it to a compatible format.

Link to comment
Share on other sites

embixer1
On 1/3/2023 at 11:30 PM, Luke said:

HI, what exactly are you asking for? You can send any Emby-supported content to Sonos for playback. If it's not supported by the Sonos then the server will transcode it to a compatible format.

Looks like my transcoding is broken then. Going in the server setting, I see transcoding is enabled. Yet, I can only play pure mp3. Anything else, if I connect to a Sonos speaker, the play button just does not work. Clicking it does not even respond. I am on 4.7.11.0 server version on a Synology DS 920+ NAS with DSM 7.0 OS. All my Sonos speakers are Sonos One V2.

Edited by embixer1
Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...