FLAC file bitrate not calculated when file imported to library

Server Version#: 1.25.3.5409
Player Version#: Sonos

Reproduction steps

  • Add a FLAC file to file store
  • Update Plex library using ‘Scan Library Files’
  • File appears in Plex and can be played without issues
  • Locate file in Sonos - can be discovered and queued without issue
  • Attempt to play file in Sonos
  • Get error message in Sonos: ‘Connection to Plex was lost’ and file does not play

Expected behaviour

  • File plays in Sonos

Problem analysis

When attempting to play ‘faulty’ files, the Plex console includes the error:

[Transcode] Streaming Resource: Bandwidth exceeded: 2147483647 kbps > 8000 kbps 

I noticed that some files I had problems with on upload started working when I tried them at a later date. This lead me to believe that some of the overnight scheduled task actions were changing file metadata and correcting this issue. I tried using the ‘analyse’ options against the album and tracks but this had no effect on this issue.

Attached are ‘before’ and ‘after’ XML files from the ‘Get Info…’ option on a problem file. The ‘before’ is immediately following ingest into the library, and the ‘after’ file is after the scheduled tasks have run. Note the presence of the MediaContainer/Track/Part/Stream/@bitrate attribute in the ‘after’ (in addition to some other new metadata).

It appears that some analysis is not being run on ingest (or ‘Analyze’) that needs to be performed to allow the Sonos integration to work correctly.

I have not tried this with other file types, but the problem is occurring consistently with files in FLAC format.

Would be grateful if this could be resolved!

Thanks.

Before

<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="1"
                librarySectionTitle="Music (NAS)" librarySectionUUID="02206008-f518-4cee-905d-452fac03e66e"
                mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1642012480">
    <Track ratingKey="26817" key="/library/metadata/26817" parentRatingKey="26816" grandparentRatingKey="25999"
           guid="plex://track/5d08094c403c6402904ea4a6" parentGuid="plex://album/5d07ccec403c640290ec2364"
           grandparentGuid="plex://artist/5d07bea0403c6402906b8334" parentStudio="Metal Blade Records" type="track"
           title="Overture" grandparentKey="/library/metadata/25999" parentKey="/library/metadata/26816"
           librarySectionTitle="Music (NAS)" librarySectionID="1" librarySectionKey="/library/sections/1"
           grandparentTitle="The Neal Morse Band" parentTitle="The Great Adventure" summary="" index="1" parentIndex="1"
           ratingCount="1297" skipCount="1" parentYear="2019" thumb="/library/metadata/26816/thumb/1643203889"
           parentThumb="/library/metadata/26816/thumb/1643203889"
           grandparentThumb="/library/metadata/25999/thumb/1642994237" duration="606013" addedAt="1643203846"
           updatedAt="1643203889">
        <Media id="23190" duration="606013" audioChannels="2" audioCodec="flac" container="flac">
            <Part accessible="1" exists="1" id="34238" key="/library/parts/34238/1643203698/file.flac" duration="606013"
                  file="/data/music/The Neal Morse Band/The Great Adventure/1-01 Overture.flac" size="73213890"
                  container="flac" hasThumbnail="1">
                <Stream id="61896" streamType="2" selected="1" codec="flac" index="0" channels="2" bitrate="966"
                        audioChannelLayout="stereo" bitDepth="16" samplingRate="44100" displayTitle="FLAC (Stereo)"
                        extendedDisplayTitle="FLAC (Stereo)"></Stream>
            </Part>
        </Media>
        <Extras size="0"></Extras>
        <Related></Related>
    </Track>
</MediaContainer>

After

<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="1"
                librarySectionTitle="Music (NAS)" librarySectionUUID="02206008-f518-4cee-905d-452fac03e66e"
                mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1642012480">
    <Track ratingKey="26817" key="/library/metadata/26817" parentRatingKey="26816" grandparentRatingKey="25999"
           guid="plex://track/5d08094c403c6402904ea4a6" parentGuid="plex://album/5d07ccec403c640290ec2364"
           grandparentGuid="plex://artist/5d07bea0403c6402906b8334" parentStudio="Metal Blade Records" type="track"
           title="Overture" grandparentKey="/library/metadata/25999" parentKey="/library/metadata/26816"
           librarySectionTitle="Music (NAS)" librarySectionID="1" librarySectionKey="/library/sections/1"
           grandparentTitle="The Neal Morse Band" parentTitle="The Great Adventure" summary="" index="1" parentIndex="1"
           ratingCount="1297" skipCount="1" parentYear="2019" thumb="/library/metadata/26816/thumb/1643203889"
           parentThumb="/library/metadata/26816/thumb/1643203889"
           grandparentThumb="/library/metadata/25999/thumb/1642994237" duration="606013" addedAt="1643203846"
           updatedAt="1643203889">
        <Media id="23190" duration="606013" bitrate="957" audioChannels="2" audioCodec="flac" container="flac">
            <Part accessible="1" exists="1" id="34238" key="/library/parts/34238/1643203698/file.flac" duration="606013"
                  file="/data/music/The Neal Morse Band/The Great Adventure/1-01 Overture.flac" size="73213890"
                  container="flac" deepAnalysisVersion="6" hasThumbnail="1"
                  requiredBandwidths="1091,1091,1091,1091,1091,1091,1091,1091">
                <Stream id="61896" streamType="2" selected="1" codec="flac" index="0" channels="2" bitrate="957"
                        albumGain="-8.92" albumPeak="1.000000" albumRange="11.112029" audioChannelLayout="stereo"
                        bitDepth="16" endRamp="-6.00 0.11;-2.19 1.21;0.58 4.01;3.19 7.71;6.27 10.21;" gain="-8.92"
                        loudness="-10.95" lra="9.11" peak="1.000000"
                        requiredBandwidths="954,954,954,954,954,954,954,954" samplingRate="44100"
                        startRamp="-51.00 0.00;-39.96 1.60;-29.80 4.00;-22.79 6.20;-21.00 7.70;-17.72 14.20;-14.62 14.60;-11.87 16.70;-8.25 19.20;-4.97 20.30;-2.45 20.70;0.08 46.50;3.34 134.50;6.27 134.70;"
                        displayTitle="FLAC (Stereo)" extendedDisplayTitle="FLAC (Stereo)"></Stream>
            </Part>
        </Media>
        <Extras size="0"></Extras>
        <Related></Related>
    </Track>
</MediaContainer>
1 Like

This also happens with the app Prism.

1 Like

I have this issue, as well. Only for newly added tracks to my library when trying to play via Sonos. Is resolved the following day, but looking for away to be able to play the same day they are added. Note, I don’t have the same issue via PlexAmp or Roku, just with Sonos. Help!

A non-ideal workaround is to change your scheduled tasks to run just after you’ve added a file. e.g. add a file at 13:45, set it to run at 14:00. As I say, far from ideal, but at least you only have to wait <1 hour rather than overnight!

This is definitely a bodge workaround and not a solution - needs fixing properly in Plex.

1 Like

Basically any client app that relies on the MediaContainer/Track/Part/Stream/@bitrate field.

1 Like

Can confirm this is still an issue in version 1.26.0.5715.

Please can someone at Plex provide an update on this - there are some other posts where this is the probable cause of issues too.

I’ve highlighted the problem and what needs fixing and multiple people have confirmed the error. The scheduled tasks fix the problem so the code obviously exists within Plex already - it just needs triggering on FLAC import. Surely can’t be that hard to resolve?

Can confirm, still an issue in version 1.26.2.5797.

Still an issue in version 1.27.0.5897 :sob:

That’s weird. The issue seems solved for me in 1.27.0.5897.

Sure it didn’t just coincidentally coincide with your scheduled tasks running and updating the metadata? I’m still seeing the issue even in 1.27.1.5916.

Not 100% sure, no.

I stumbled upon this thread after trying to figure out why I was running into the same behavior. I added some new FLAC’s to my library today and started getting playback errors through sonos. It’s due to the improper calculation of the bitrate and it exceeding my “external” bandwidth limit. Moving the scheduled task to run at the next hour (rather than overnight as I usually do) fixed it.

This still exists in Version 1.28.2.6151

1 Like

And still a problem in 1.29.1.6316.

still a problem in latest server verision (1.30.3.6509).

Please report in the Forum Preview thread as this code is pre-beta

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.