Skip to main content
GET
/
{transcodeType}
/
:
/
transcode
/
universal
/
start.
{extension}
PlexGO
package main

import(
	"context"
	"github.com/LukeHagar/plexgo/models/components"
	"github.com/LukeHagar/plexgo"
	"github.com/LukeHagar/plexgo/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := plexgo.New(
        plexgo.WithAccepts(components.AcceptsApplicationXML),
        plexgo.WithClientIdentifier("abc123"),
        plexgo.WithProduct("Plex for Roku"),
        plexgo.WithVersion("2.4.1"),
        plexgo.WithPlatform("Roku"),
        plexgo.WithPlatformVersion("4.3 build 1057"),
        plexgo.WithDevice("Roku 3"),
        plexgo.WithModel("4200X"),
        plexgo.WithDeviceVendor("Roku"),
        plexgo.WithDeviceName("Living Room TV"),
        plexgo.WithMarketplace("googlePlay"),
        plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
    )

    res, err := s.Transcoder.StartTranscodeSession(ctx, operations.StartTranscodeSessionRequest{
        TranscodeType: components.TranscodeTypeMusic,
        Extension: operations.ExtensionMpd,
        AdvancedSubtitles: components.AdvancedSubtitlesBurn.ToPointer(),
        AudioBoost: plexgo.Pointer[int64](50),
        AudioChannelCount: plexgo.Pointer[int64](5),
        AutoAdjustQuality: components.BoolIntOne.ToPointer(),
        AutoAdjustSubtitle: components.BoolIntOne.ToPointer(),
        DirectPlay: components.BoolIntOne.ToPointer(),
        DirectStream: components.BoolIntOne.ToPointer(),
        DirectStreamAudio: components.BoolIntOne.ToPointer(),
        DisableResolutionRotation: components.BoolIntOne.ToPointer(),
        HasMDE: components.BoolIntOne.ToPointer(),
        Location: operations.StartTranscodeSessionQueryParamLocationWan.ToPointer(),
        MediaBufferSize: plexgo.Pointer[int64](102400),
        MediaIndex: plexgo.Pointer[int64](0),
        MusicBitrate: plexgo.Pointer[int64](5000),
        Offset: plexgo.Pointer[float64](90.5),
        PartIndex: plexgo.Pointer[int64](0),
        Path: plexgo.Pointer("/library/metadata/151671"),
        PeakBitrate: plexgo.Pointer[int64](12000),
        PhotoResolution: plexgo.Pointer("1080x1080"),
        Protocol: operations.StartTranscodeSessionQueryParamProtocolDash.ToPointer(),
        SecondsPerSegment: plexgo.Pointer[int64](5),
        SubtitleSize: plexgo.Pointer[int64](50),
        VideoBitrate: plexgo.Pointer[int64](12000),
        VideoQuality: plexgo.Pointer[int64](50),
        VideoResolution: plexgo.Pointer("1080x1080"),
        XPlexClientProfileExtra: plexgo.Pointer("add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)"),
        XPlexClientProfileName: plexgo.Pointer("generic"),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.ResponseStream != nil {
        // handle response
    }
}
"#EXTM3U\n#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=3538000,RESOLUTION=1280x720,FRAME-RATE=60.000000\nsession/32635662-0d05-4acd-8f72-512cc64396d4/base/index.m3u8\n"

Authorizations

X-Plex-Token
string
header
required

Headers

accepts
enum<string>
default:application/xml
Available options:
application/json,
application/xml
X-Plex-Client-Identifier
string
required
X-Plex-Product
string
Example:
X-Plex-Version
string
Example:
X-Plex-Platform
string
X-Plex-Platform-Version
string
X-Plex-Device
string
X-Plex-Model
string
X-Plex-Device-Vendor
string
Example:
X-Plex-Device-Name
string
Example:
X-Plex-Marketplace
string
Example:
X-Plex-Client-Profile-Extra
string
X-Plex-Client-Profile-Name
string
X-Plex-Session-Identifier
string

Path Parameters

transcodeType
enum<string>
required
Available options:
video,
music,
audio,
subtitles
extension
enum<string>
required
Available options:
m3u8,
mpd

Query Parameters

transcodeSessionId
string
advancedSubtitles
enum<string>
Available options:
burn,
text,
unknown
audioBoost
integer
Required range: x >= 1
audioChannelCount
integer
Required range: 1 <= x <= 8
autoAdjustQuality
enum<integer>
Available options:
0,
1
autoAdjustSubtitle
enum<integer>
Available options:
0,
1
directPlay
enum<integer>
Available options:
0,
1
directStream
enum<integer>
Available options:
0,
1
directStreamAudio
enum<integer>
Available options:
0,
1
disableResolutionRotation
enum<integer>
Available options:
0,
1
hasMDE
enum<integer>
Available options:
0,
1
location
enum<string>
Available options:
lan,
wan,
cellular
mediaBufferSize
integer
mediaIndex
integer
musicBitrate
integer
Required range: x >= 0
offset
number
partIndex
integer
path
string
peakBitrate
integer
Required range: x >= 0
photoResolution
string
protocol
enum<string>
Available options:
http,
hls,
dash
secondsPerSegment
integer
subtitleSize
integer
Required range: x >= 1
subtitles
enum<string>
Available options:
auto,
burn,
none,
sidecar,
embedded,
segmented,
unknown
videoBitrate
integer
Required range: x >= 0
videoQuality
integer
Required range: 0 <= x <= 99
videoResolution
string

Response