"400: Bad Request" response when requesting some audio files

Hi,

Some users of my app (Prologue) are encountering an issue when attempting to stream some mp4/m4a/m4b files.

If the metadata for the item looks like this:

{
    "ratingKey": "497476",
    "key": "/library/metadata/497476",
    "parentRatingKey": "497475",
    "grandparentRatingKey": "497474",
    "guid": "com.plexapp.agents.audiobooks://B00VN0Q8XY/-1?lang=en",
    "parentGuid": "com.plexapp.agents.audiobooks://B00VN0Q8XY?lang=en",
    "grandparentGuid": "local://497474",
    "parentStudio": "Random House Audio",
    "type": "track",
    "title": "Armada: A Novel",
    "grandparentKey": "/library/metadata/497474",
    "parentKey": "/library/metadata/497475",
    "grandparentTitle": "Ernest Cline",
    "parentTitle": "Armada",
    "originalTitle": "Ernest Cline",
    "summary": "",
    "skipCount": 1,
    "parentYear": 2015,
    "thumb": "/library/metadata/497475/thumb/1630915401",
    "parentThumb": "/library/metadata/497475/thumb/1630915401",
    "duration": 42658932,
    "addedAt": 1630915358,
    "updatedAt": 1630915407,
    "chapterSource": "media",
    "Media": [
        {
            "id": 853508,
            "duration": 42658932,
            "audioChannels": 2,
            "audioCodec": "aac",
            "container": "mp4",
            "optimizedForStreaming": 0,
            "audioProfile": "lc",
            "has64bitOffsets": false,
            "Part": [
                {
                    "id": 901659,
                    "key": "/library/parts/901659/1602180968/file.m4a",
                    "duration": 42658932,
                    "file": "/path/to/file.m4a",
                    "size": 338552226,
                    "audioProfile": "lc",
                    "container": "mp4",
                    "has64bitOffsets": false,
                    "hasThumbnail": "1",
                    "optimizedForStreaming": false
                }
            ]
        }
    ]
}

And I request the media file like this:

GET /library/parts/901659/1602180968/file.m4a?X-Plex-Token=XXXXXXXXXXX HTTP/1.1
Host: SERVER_URL:32400
Accept: */*
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15
Accept-Language: en-AU,en;q=0.9
Accept-Encoding: identity
Connection: keep-alive

I get a 400: Bad Request response.

A few other things I’ve noticed:

  • If I add a download=1 parameter to the request everything works correctly. I can’t use this across the board, however, as a user may not have download permissions for the server
  • This only happens with some files (all of them AAC-encoded in an mp4/m4a/m4b container, I think).
  • Plex Web transcodes these files (doesn’t attempt to stream them directly). Not sure what other clients do as I’m not able to intercept their requests
  • After downloading one of the “problem” files and sticking it in my library, it can be played in Prologue without issue. Implies no problems with the file itself. Both servers running same version (1.24.1.4931).

I’m probably missing something obvious, but this seems very strange to me :thinking:
Hoping someone here can point me in the right direction!

1 Like

I can confirm as a user of Prologue and Bookcamp that this is an issue I have run into. Plex server is not showing the correct bitrate metadata on any newly added M4B files (although it used to in previous versions), and will refuse to direct play. The only workaround (and this should really only be read as a workaround, not a fix) is to remove the internet upload speed limit in the Plex server settings.

I’m seeing this issue on Bookcamp and Chronicle, however I’ve got no workaround at all. None of my M4B based files are showing a bitrate for the overall media (they have one for the media part) and they just refuse to play.

I’ve tried removing the internet upload speed limit (in fact I never had it set), but it doesn’t resolve the issue.

This is caused by changes in recent PMS versions, but will be resolved in an upcoming beta PMS release.

1 Like

Great news, thanks for the info.

Brilliant -thanks for the clarification.

I’ve just found this forum post after posting about my own issues with Chronicle and Bookcamp :

([BUG] Plex no longer correctly analysing M4b files correctly - incorrect bit rate detected - prevents direct play)

Glad to hear a fix is in progress, and i’ve added a note for the mods to close my post.

I’m seeing this same behavior. I’m on Plex 1.24.5.5173.

Streaming Resource: Bandwidth exceeded: 2147483647 kbps > 8000 kbps
Streaming Resource: Cannot make a decision because either the file is unplayable or the client provided bad data

This unfortunately is stopping all of my Chronicle and Bookcamp clients from working. I’ve been testing Booksonic as a replacement to Plex (just the Audiobook library) with the family and it’s not going well. :frowning:

I also can’t set my remote stream limit to “Original” because I don’t have the fancy fiber internet…although, this does allow the clients to play but it destroys everyone else’s experience. I.e., bandwidth contention and neverending buffering, due to the lack of transcoding.

Any help is appreciated!

-Brian

@brian_phospher.com

Respond here please:

Allow this solved thread to close please.