Get All Transcode Sessions

When Plex can't direct play a media item it will decide to transcode the media so it can be streamed to the client. This API command will return all active transcode sessions on the Plex server.

URL

GET http://[IP address]:32400/transcode/sessions/?X-Plex-Token=[PlexToken]

Parameters

NameDescription
IP addressThe IP address of the Plex Media server.
PlexTokenThe authentication Plex token.

Return Status

HTTP CodeDescription
200Success - The request was successful.
401Unauthorized - The Plex token provided was not valid.

Response

XML string value that lists all the currently active transcode sessions on the server. An example of the XML returned from the request is shown below:

<?xml version="1.0" encoding="UTF-8"?>
  <MediaContainer size="1">
      <TranscodeSession key="ac99lf8sr9h9i7jfahvge6un" throttled="0" complete="0" progress="50" size="-22" speed="2.4000000953674316" error="0" duration="10000" remaining="2" context="streaming" sourceVideoCodec="hevc" videoDecision="transcode" protocol="http" container="mkv" videoCodec="h264" transcodeHwRequested="1" timeStamp="1676047584.4802699" maxOffsetAvailable="0" minOffsetAvailable="0" />
  </MediaContainer>

The XML returned provides a list of the all the active transcode sessions on the Plex server. The root is the MediaContainer element. This element contains a single attribute that indicates the number of active transcode sessions.

MediaContainer Attributes
AttributeDescription
sizeThe number of transcode sessions.

The MediaContainer element will still be returned if no transcode session is active. The size attribute will be 0, and there will be no TranscodeSession child elements.

Within the MediaContainer there are one or more TranscodeSession child elements. Each TranscodeSession element represents one transcode session that is active on the Plex server.

Transcode Session Attributes
AttributeDescription
keyThe unique key for the transcode session.
throttledTranscode session is throttled, meaning the server is able to transcode than necessary, so the server is throttled down.
0 - the server is not throttled, 1- the server is throttled.
completeFlag indicating if transcode session is complete.
0 - transcode session is not complete, 1 - transcode session is complete.
progressThe progress, as a percentage, of the transcode session.
sizeUnknown.
speedThe speed of the transcode. A value of 1.0 or greater means the transcode is sufficient for streaming the media.
errorFlag indicating there is an error.
0 - no error, 1 - an error occurred.
durationThe duration, in milliseconds, of the media.
remainingThe remaining amount of media to be transcoded.
contextThe context of the transcode session.
sourceVideoCodecThe video codec of the source media item.
videoDecisionThe type of stream that Plex decided to use.
protocolThe protocol of the streaming session.
containerThe container of the media item.
videoCodecThe video codec used for the transcode.
transcodeHwRequestedThe server requested the transcode use hardware transcoding.
timeStampThe current date and time, in epoch time, of the transcode.
maxOffsetAvailableThe maximum time offset.
minOffsetAvailableThe minimum time offset.

Examples

curl -X GET http://[IP address]:32400/transcode/sessions/?X-Plex-Token=[PlexToken]
import requests
plex_url = http://[IP address]:32400/transcode/sessions/?X-Plex-Token=[PlexToken]
response = requests.get(plex_url)
print(response.text)
$response = Invoke-RestMethod 'http://[IP address]:32400/transcode/sessions/?X-Plex-Token=[PlexToken]' -Method 'GET'
Write-Output $response
Subscribe
Display