[SOLVED] Problem with Transcoding with kubernetes deployment

I just finished migrating plex (latest version, 1.13.4.5271) to my home kubernetes cluster, and all works great with direct play, but when anything tries to transcode, it just spins and spins.

I found this linkhttps://forums.plex.tv/t/transcoder-fails-when-transcode-is-on-a-network-share/186681/38 that seems similar but that was fixed a while back.

Basically, I have the following set up:

NAS:\ssd store ->plex data mount
local kubernetes node:\tmp\transcode -> /transcode

Plex data is stored on an NFS mount on an SSD datastore, while /transcode comes from the local kubernetes node.

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: pms
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: pms
    spec:
      volumes:
      - name: nas-rabbit-pms
        persistentVolumeClaim:
          claimName: nas-rabbit-pms
      - name: localhost
        hostPath:
          path: /tmp
      - name: media
        persistentVolumeClaim:
          claimName: nas-media
      containers:
      - name: pms
        image: plexinc/pms-docker:1.13.4.5271-200287a06
        volumeMounts:
        - name: nas-rabbit-pms
          mountPath: /config
        - name: localhost
          subPath: transcode
          mountPath: /transcode
        - name: media
          mountPath: /nfs/media
          readOnly: true
        env:
        - name: CHANGE_CONFIG_DIR_OWNERSHIP
          value: 'false'
        - name: PLEX_UID
          value: '1001'
        - name: PLEX_GID
          value: '1001'
        - name: TZ
          value: 'America/Los_Angeles'
        ports:
        - name: pms
          containerPort: 32400
        - name: webtools
          containerPort: 33400
        readinessProbe:
          tcpSocket:
            port: pms
          initialDelaySeconds: 5
          periodSeconds: 10
        livenessProbe:
          tcpSocket:
            port: pms
          initialDelaySeconds: 15
          periodSeconds: 20
        lifecycle:
          postStart:
            exec:
              command: ["/bin/rm", "-f", "/usr/lib/plexmediaserver/Plex Relay"]

I’ve tried making the /transcode folder 777 thinking it was a permissions issue, but that didn’t fix it. When a transcode starts, nothing logs except the following:

<SessionReport version="2" startTime="0" startTimestamp="Jul 25, 2018 11:24:31.211" key="/library/metadata/51436" session="5ee99426-7ea7-41f6-8842-006aa352c6b5" transcode="446f1284-34c6-4635-86f7-c4c4c973ca1e">
<User id="1" thumb="https://plex.tv/users/<removed>/avatar?c=<removed>" title="<removed>" />
<Player address="10.32.0.1" device="x64" machineIdentifier="5ee99426-7ea7-41f6-8842-006aa352c6b5" model="" platform="Windows" platformVersion="10.0.17134.165" product="Plex for Windows" remotePublicAddress="69.222.xxx.yyy" state="" title="Gaming Desktop" vendor="" version="3.2.20.0" local="1" userID="1" />
<Variants>
<Variant id="c59cb63d-fc50-416a-88cd-bdc1f125cede" targetBitrate="1071" context="streaming" sourceVideoCodec="hevc" sourceAudioCodec="aac" videoDecision="transcode" audioDecision="copy" protocol="hls" container="mpegts" videoCodec="h264" audioCodec="aac" audioChannels="2" transcodeHwRequested="0" transcodeHwFullPipeline="0">
<Media audioProfile="lc" id="186824" videoProfile="main" audioChannels="2" audioCodec="aac" bitrate="890" container="mpegts" duration="2555021" height="360" protocol="hls" videoCodec="h264" videoFrameRate="PAL" videoResolution="SD" width="720" selected="1">
<Part audioProfile="lc" deepAnalysisVersion="2" id="202898" indexes="sd" requiredBandwidths="2422,2008,1742,1742,1742,1742,1742,1742" videoProfile="main" bitrate="890" container="mpegts" duration="2555021" height="360" protocol="hls" width="720" decision="transcode" selected="1">
<Stream bitrate="890" codec="h264" default="1" displayTitle="Unknown (HEVC Main)" frameRate="25" height="360" id="452853" requiredBandwidths="2292,1878,1613,1613,1613,1613,1613,1613" streamType="1" width="720" decision="transcode" location="segments-av" />
<Stream bitrateMode="cbr" channels="2" codec="aac" displayTitle="English (AAC Stereo)" id="452854" language="English" languageCode="eng" requiredBandwidths="130,130,130,130,130,130,130,130" selected="1" streamType="2" decision="copy" location="segments-av" />
</Part>
</Media>
</Variant>
</Variants>
<SegmentList />
<PlaybackReports />
<StateReports />
<StateReports />
</SessionReport>

I can see the transcode temp folder being created:

root@pms-646bd6cdb4-xtqm4:/transcode/Transcode/Sessions# ls -la
total 12
drwxrwxrwx 3 plex plex 4096 Jul 25 11:36 .
drwxr-xr-x 3 plex plex 4096 Jul 25 10:39 ..
drwxr-xr-x 2 plex plex 4096 Jul 25 11:36 plex-transcode-m43xxmmvgmlmyrkzzisdlcs6-25794ae4-b919-4189-9a61-3227a7c66d4b

and i can even see the thumbnail preview updating in “current activity” but nothing ever plays on the player. any thoughts?

If this is a kubuntu base as I suspect, that’s the source of your problem. Too many folks have tried kubuntu without success. Officially, it’s not supported.

Its your official docker image: https://hub.docker.com/r/plexinc/pms-docker/~/dockerfile/

FROM ubuntu:16.04

ENV DEBIAN_FRONTEND="noninteractive" \
    TERM="xterm"

# Install required packages
ADD ["https://github.com/just-containers/s6-overlay/releases/download/v1.17.2.0/s6-overlay-amd64.tar.gz", \
     "/tmp/"]

ENTRYPOINT ["/init"]

RUN \
# Extract S6 overlay
    tar xzf /tmp/s6-overlay-amd64.tar.gz -C / && \

# Update and get dependencies
    apt-get update && \
    apt-get install -y \
      curl \
      sudo \
      wget \
      xmlstarlet \
      uuid-runtime \
    && \

# Add user
    useradd -U -d /config -s /bin/false plex && \
    usermod -G users plex && \

# Setup directories
    mkdir -p \
      /config \
      /transcode \
      /data \
    && \

# Cleanup
    apt-get -y autoremove && \
    apt-get -y clean && \
    rm -rf /var/lib/apt/lists/* && \
    rm -rf /tmp/* && \
    rm -rf var/tmp/*

EXPOSE 32400/tcp 3005/tcp 8324/tcp 32469/tcp 1900/udp 32410/udp 32412/udp 32413/udp 32414/udp
VOLUME /config /transcode

ENV VERSION=latest \
    CHANGE_DIR_RIGHTS="false" \
    CHANGE_CONFIG_DIR_OWNERSHIP="true" \
    HOME="/config"

COPY root/ /

Thanks for adding that. I thought you were trying to run native.
Relocating this to the docker forum where they can help you better

thanks! FWIW, I tried with the linuxserver/plex docker image as well, same thing. Wherevewr I put the transcode folder, it never works.

Also, if i do a “watch ps aux | grep -i trans”, i never see the transcoder process start.

You might want to check whether your kubernetes installation has general issues with inotify (e.g. minikube has issues https://github.com/kubernetes/minikube/issues/1551)

As you are already bound to local storage, I whould remove the /transode volumeMounts and see whether it works with an implicit volume. It was the initial workaround for the link you posted earlier.

Would inotify affect the transcode process though? I’m not an expert here by any means. I also tried switching the /transcode mount to a “emptydir”

- name: transcode-volume
  emptyDir:
    medium: "Memory"

but this didn’t work either. upon spinning up a transcode, it creates the directory structure (/transcode/Transcode/Sessions/plex-garaklfjaskfjsldkjfas…) but then never begins transcoding. all folders are owned by plex:plex and have at least 755 perms.

Edit: I also see this in plex media server.log when debug is turned on:

ERROR - [Transcoder] Unknown decoder ‘h264’

does that have anything to do with it?

Well shoot. Turns out it was the “noexec” on my nfs mount. Solved via:
https://forums.plex.tv/t/transcoder-crashing-unknown-decoder-h264/205798/2

removed the noexec in my pv yaml, reapplied, redeployed pod, all works now.

Thanks guys!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.