Plex is appending ?transcode to transcoder url

Hello,
I noticed that Plex is appending ?transcode= to the transcoder URL. This causes problems when there are existing query string parameters used in the url.

Can you provide an example?

@“MovieFan.Plex” [Transcoder] http://domain.com/play/1211.ts?token=xxxxxxxxxxxx==?transcode=none: Server returned 403 Forbidden (access denied)

It should probably detect if an existing parameter exist and append with & vs ?.

Same issue and looks like this start happening after the latest update on my case…

I’m having problems with something similar but not sure if is the exact issue:

It seems Plex is adding “?transcode=none” but I can use this stream link (with the transcode parameter) in VLC and it works perfectly but Plex is now showing anything and after a while shows a message saying that there was an error.
Plex should be able to play ts right?

The log output below:

Mar 27, 2018 16:29:43.774 [0x7f2ad13fe700] DEBUG - Completed: [172.17.0.5:59626] 200 GET /status/sessions (11 live) 3ms 8874 bytes (pipelined: 1)
Mar 27, 2018 16:29:44.509 [0x7f2a387ff700] DEBUG - Activity: updated activity 725cf4a4-9085-46ec-acf6-e53920ff082f - completed 10% - Recording
Mar 27, 2018 16:29:44.540 [0x7f2a407fb700] DEBUG - Using default transcode duration of 120 minutes
Mar 27, 2018 16:29:44.540 [0x7f2a407fb700] DEBUG - Started session successfully: 7aaec506-87f9-40a6-9783-97448b594cec
Mar 27, 2018 16:29:44.541 [0x7f2a407fb700] DEBUG - DVR:Recorder: It took 30.0 sec to start the session for NameBright - Coming Soon
Mar 27, 2018 16:29:44.541 [0x7f2ac33ff700] DEBUG - Jobs: ‘/usr/lib/plexmediaserver/Plex Transcoder’ exit code for process 10342 is 1
Mar 27, 2018 16:29:44.541 [0x7f2a407fb700] DEBUG - DVR:Grabber: Merging EPG item with live item.
Mar 27, 2018 16:29:44.541 [0x7f2a407fb700] ERROR - DVR:Recorder: No part because session isn’t reporting one.
Mar 27, 2018 16:29:44.542 [0x7f2ac33ff700] DEBUG - Jobs: ‘/usr/lib/plexmediaserver/Plex Transcoder’ exit code for process 10342 is 1
Mar 27, 2018 16:29:44.542 [0x7f2a407fb700] DEBUG - DVR:Grabber: Operation for Live TV - Session completed with status error (Could not start recording)
Mar 27, 2018 16:29:44.542 [0x7f2a407fb700] DEBUG - Activity: Ended activity 725cf4a4-9085-46ec-acf6-e53920ff082f.
Mar 27, 2018 16:29:44.543 [0x7f2a407fb700] DEBUG - DVR:Grabber: Cleaning up rolling grab for channel 1202.
Mar 27, 2018 16:29:44.543 [0x7f2a407fb700] DEBUG - DVR:Recorder: Asked to stop recording ‘Live TV - Session’.
Mar 27, 2018 16:29:44.543 [0x7f2a407fb700] DEBUG - DVR:Recorder: Stopping transcode session.
Mar 27, 2018 16:29:44.543 [0x7f2a407fb700] DEBUG - Killing job.
Mar 27, 2018 16:29:44.543 [0x7f2a407fb700] DEBUG - Signalling job ID 10342 with 9
Mar 27, 2018 16:29:44.543 [0x7f2a407fb700] DEBUG - Job was already killed, not killing again.

@DTrace said:
@“MovieFan.Plex” [Transcoder] http://domain.com/play/1211.ts?token=xxxxxxxxxxxx==?transcode=none: Server returned 403 Forbidden (access denied)

It should probably detect if an existing parameter exist and append with & vs ?.

That looks wrong. Can you provide me the actual log file so I can see the actual lines?

@cesalo said:
The log output below:

Mar 27, 2018 16:29:44.541 [0x7f2a407fb700] DEBUG - DVR:Recorder: It took 30.0 sec to start the session for NameBright - Coming Soon

That line is normal. I need to see more of the log to understand what is going on. Please provide the entire log.

@“MovieFan.Plex” Thanks for the response. The other messages are like this:
Mar 27, 2018 16:29:44.542 [0x7f2ac33ff700] DEBUG - Jobs: ‘/usr/lib/plexmediaserver/Plex Transcoder’ exit code for process 10342 is 1
Mar 27, 2018 16:29:44.542 [0x7f2a407fb700] DEBUG - DVR:Grabber: Operation for Live TV - Session completed with status error (Could not start recording)

but no clear indication of what is the issue. This was working fine up to the last version I think, difficult to pinpoint the exact time when started failing.

@“MovieFan.Plex” I DM you the complete log.
Thanks again.

@“MovieFan.Plex” I changed the domain and the token information. Sent the entire log file via DM/PM.

Mar 27, 2018 13:11:23.541 [0x7f1fa1ffa700] VERBOSE - Jobs: Starting child process with pid 4761
Mar 27, 2018 13:11:23.641 [0x7f1fc43ff700] ERROR - [Transcoder] http://domain.com/play/1211.ts?token=xxxxxxxxxxxx==?transcode=none: Server returned 403 Forbidden (access denied)
Mar 27, 2018 13:11:23.642 [0x7f1fc2bff700] VERBOSE - JobManager: child process with PID 4761 exited Mar 27, 2018 13:11:23.642 [0x7f1fc2bff700] ERROR - JobManager: child process returned: 1 (Operation not permitted)

@cesalo said:
@“MovieFan.Plex” I DM you the complete log.
Thanks again.

Got the log. Those are correct parameters. You have a HD HomeRun Extend which has an internal transcoder. That parameter controls how that transcoder works.

Your log indicates that the transcoder could not identify the codecs used in the video stream so it is failing to transcode it, which is expected. Why it can’t identify the streams is unknown. Are you able to record the same thing that won’t play?

I’m using a IPTV service that is supposed to stream TS (mpgts) files then using a proxy app I have configured Plex DVR so there is no transcoding happening. I even changed in Plex the transcode setting to none and the same, Plex won’t play anything.
This has been working with no issues until this week when I applied the last update to the server.

That is not a scenario I am not familiar with and something we don’t test for. Frankly, I have no idea how that would behave or how to look into what the problem is.

@“MovieFan.Plex” I DM/PM you the entire log file.

@DTrace said:
@“MovieFan.Plex” I DM/PM you the entire log file.

Got the file. Are you using a reverse proxy?

@“MovieFan.Plex” I am currently using github.com/tombowditch/telly . Which is emulating a hdhomerun device and proxies it to Plex. Similar to tvheadend/{tvhproxy/antennas} set ups. The provider utilized parameters to authenticate and in this case uses ?token=.

I know it is probably not a “supported” method but would be great if it would detect if an existing parameter is used and appends appropriately.

Ok. We do not support proxying the HDHR. I spoke to some of the devs and they believe the proxy is adding the wrong information. I would suggest contacting the developer of that tool.

@“MovieFan.Plex” Thanks for getting back and checking with devs.
For my understanding and others, Plex will always append ?transcode= to any request ?
If a request coming in has an existing parameter it will not append a proper query string parameter such as &transcode=. It will just blindly append ?transcode= no matter if the request had an existing parameter or not ?

No that is not correct, Plex does not append ?transcode unless needed.

Request from one set of user logs I have looked through recently:
Mar 20, 2018 19:04:07.003 [0x80cc73000] DEBUG - DVR:Grabber: Going to record for 3414 seconds, final URL is http://192.168.1.4:5004/auto/v1203

Log entry from one of my servers:
Mar 28, 2018 21:01:00.568 [8336] DEBUG - DVR:Grabber: Going to record for 3540 seconds, final URL is http://10.0.1.22:5004/auto/v19.1

Log from another of my servers with a HDHR Extend that is set to transcode:
Mar 28, 2018 21:00:00.221 [9419] DEBUG - DVR:Grabber: Going to record for 3660 seconds, final URL is http://10.0.1.20:5004/auto/v19.1?transcode=heavy

As you can see the only server that has a ?transcode on the URL sent to the HDHR device is the Extend .

I’m not sure on the exact details of how this works but from what I see it looks like the proxy is adding in a Plex token that isn’t needed. Its also ending it with 2 equal signs, which is wrong. Without this token, the transcode parameter would but cause an issue.