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=1parameter 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 
Hoping someone here can point me in the right direction!
