Installing Plex Docker on Raspberry Pi 4 and a Brief Test
First of all, during this epidemic, I hope everyone is safe.
Today I received a Raspberry Pi 4, and since I already have a mini host with Plex service installed, I wanted to test if the Raspberry Pi 4 can smoothly run Plex. So I decided to give it a try. Oh, I'm running it with Docker, this article includes instructions on installing Docker, pulling the Plex image, configuration, the entire playback process, and then a brief test.(English version Translated by GPT-3.5, [返回中文](../20200208-test-raspberry-pi-4-plex))Introduction
The test videos include the following, which should cover most scenarios:
Detective Conan: The Fist of Blue Sapphire BDMV Remux
H.264, True HD Audio18GB MKV
Detective Conan Episode 993 The Conspiracy at the Food Court
H.264, AAC227MB MP4
Detective Conan: The Zero Enforcer
BDRip H.265(HEVC), Flac5.6GB MKV
Natsume's Book of Friends Season 4 Episode 6 The Other Side of the Glass
H.264 10Bit(10Bit is mentioned when I downloaded it) AAC160MB MKV
Love, Death and Robot
H.265, Ec-3650MB MP4
Zootopia BDRip
H.264 DTS16GB MKV
I’m using the 4GB version of the Raspberry Pi 4.
Cat CPUInfo
1 | root@raspberrypi:~# cat /proc/cpuinfo |
Free -m
1 | total used free shared buff/cache available |
Installing Docker
One command is all you need
Installing Docker is very simple, just one command, as for the waiting time… (I recommend using a VPN)
1 | curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh |
Docker Accelerator
Before that, I need to get a Docker accelerator from Alibaba Cloud, otherwise, waiting for the image to be pulled from the official website will be frustrating.
Log in to Alibaba Cloud - Container Registry
Then just copy the following shell script, Aliyun has already replaced the address for us (you can also use DaoCloud Mirror for acceleration)
1
2
3
4
5
6
7
8sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://xxxxx.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
Pulling the Plex Image
Detailed instructions for using this image can be found here. I chose the one with the highest download count linuxserver/plex - Docker Hub and not
plexinc/pms-docker
because the official image does not have an ARM version.
1 | docker pull linuxserver/plex |
Starting the Plex Image
I used the following command, as for why an SSH port 1122
is added, it’s just for precaution (which turned out to be useful later).
1 | docker create \ |
You can see that a Docker Plex has been successfully created.
1 | root@raspberrypi:~# docker create \ |
Then start it, here you don’t need to enter the complete hash value. If the hash starts with 8a
and there is only one, you can directly use docker start 8a
, docker start 8
will also work.
1 | docker start 8a7741bfb60 |
Successful Start
Then you can see that the Docker has successfully started.
1 | root@raspberrypi:~# docker ps |
Configuring Plex
Accessing the Web Interface
At this point, the Raspberry Pi’s 32400
port is mapped to the Docker’s 32400
port, and the Plex web configuration address is:
1 | http://树莓派IP:32400/web |
After accessing it, you will see the following screen.
Register and Log In
After registering, your account should be automatically logged in.
Error: Server Not Found
Then, there is a problem… After some searching, it seems that for the initial configuration, you need to connect using 127.0.0.1
, and then the configuration will be displayed. So I continued the configuration through an SSH tunnel.
Error: Use Xshell’s SSH Tunnel Function for Configuration
First, connect to the Plex Docker and install OpenSSH and Vim.
1
docker exec -it 8a /bin/bash
Use APT to install OpenSSH and Vim.
1
apt update && apt install openssh-server vim vim-common -y
After the installation, edit
/etc/ssh/sshd_config
and changePermitRootLogin prohibit-password
toPermitRootLogin yes
.1
2
3
4
5
6
7
8
9
10
11......
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
# 修改这里
# PermitRootLogin prohibit-password
PermitRootLogin yes
#StrictModes yes
........Change the root password and start the SSH service.
1
2passwd root
service ssh startIf you’re using Xshell, create a new connection. The address is the Raspberry Pi’s IP, and the port is
1122
. Then choose Properties - SSH - Tunneling.Connect with this SSH connection.
Connecting to Docker Configuration
Discovering the Server
If you encounter the problem mentioned earlier, which is “No soup for you”, then you need to use an SSH tunnel and open the following address in your browser.
Open this address in your browser
1 | http://127.0.0.1:32400/web |
Then you will see this screen
Adding a Library
When creating, I added
-v /mnt/movies:/data
, so the Raspberry Pi’s/mnt/movies
is mapped to the/data
directory.
Movie List
Codec Not Found
If you see the following message:
1 | Conversion failed. A required codec could not be found or failed to install. |
it means the codec download failed. The codecs are downloaded to this directory:
1 | /config/Library/Application Support/Plex Media Server/Codecs |
You can check the Plex logs to see which codec is being downloaded or you can try playing again, it will automatically download again, and eventually, it will succeed.
Log directory
1 | /config/Library/Application Support/Plex Media Server/Logs/Plex Media Server.log |
You can see which codec failed to download in the logs, the log structure is as follows:
1 | ...... |
Brief Test (Raspberry Pi 4 CPU overclocked to 2.0G, Room Temperature 9°C)
Detective Conan: The Fist of Blue Sapphire H.264 1:49:27
Detective Conan: The Fist of Blue Sapphire BDMV Remux H.264, True HD Audio 18GB MKV
Original Quality (Unable to select subtitles) 42℃
TOP
1 | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
Random Clip Jump Time
- Click on the progress bar until the image appears:
6 seconds
- Image appears to jump to the corresponding timeline and play:
2 seconds
Playback Status
No buffering, but there is severe frame skipping while playing, about every 4 seconds, 1 second is skipped.
Transcoding to 1080p 61℃
TOP
1 | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
Random Clip Jump Time
- Click on the progress bar until the image appears:
25 seconds
- Image appears to jump to the corresponding timeline and play:
7 seconds
Playback Status
Buffering occurs, about 1 buffer every 20 seconds, buffering for 3 seconds, frequent buffering
Detective Conan Episode 993 The Conspiracy at the Food Court H.264 24:44
Detective Conan Episode 993 The Conspiracy at the Food Court H.264, AAC 227MB MP4
Original Quality 36℃
TOP
1 | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
Random Clip Jump Time
- Click on the progress bar until the image appears:
less than 1 second, almost instant play
- Image appears to jump to the corresponding timeline and play:
less than 1 second, almost instant play
Playback Status
No buffering or any issues within 1 minute, smooth playback
Transcoding to 328p 51℃
TOP
1 | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
Random Clip Jump Time
- Click on the progress bar until the image appears:
11 seconds
- Image appears to jump to the corresponding timeline and play:
no image skipping during jump
Playback Status
No buffering or any issues within 1 minute, smooth playback
Detective Conan: The Zero Enforcer HEVC 1:51:20
Detective Conan: The Zero Enforcer BDRip H.265(HEVC), Flac 5.6GB MKV
Transcoding of Original Quality (Unable to select original output) 73℃
TOP
1 | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
Random Clip Jump Time
- Click on the progress bar until the image appears:
21 seconds
- Image appears to jump to the corresponding timeline and play:
10 seconds
Playback Status
No buffering, but there is severe frame skipping while playing, about every 10 seconds, 1 second is skipped.
Natsume’s Book of Friends Season 4 Episode 6 The Other Side of the Glass H.264 24:17
Natsume’s Book of Friends Season 4 Episode 6 The Other Side of the Glass H.264 10Bit AAC 160MB MKV
Transcoding of Original Quality (Unable to select original output) 71℃
TOP
1 | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
Random Clip Jump Time
- Click on the progress bar until the image appears:
14 seconds
- Image appears to jump to the corresponding timeline and play:
2 seconds
Playback Status
No buffering or any issues within 1 minute, smooth playback
Love, Death and Robot H.265 12:06
Love, Death and Robot H.265, Ec-3 650MB MP4
Transcoding of Original Quality (Unable to select original output) 76℃
TOP
1 | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
Random Clip Jump Time
- Click on the progress bar until the image appears:
32 seconds
- Image appears to jump to the corresponding timeline and play:
10 seconds
Playback Status
No buffering or any issues within 1 minute, smooth playback
Zootopia H.264 1:48:44
Zootopia BDRip H.264 DTS 16GB MKV
Transcoding of Original Quality (Unable to select original output) 73℃
TOP
1 | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND |
Random Clip Jump Time
- Click on the progress bar until the image appears:
26 seconds
- Image appears to jump to the corresponding timeline and play:
9 seconds
Playback Status
No buffering or any issues within 1 minute, smooth playback
Summary of Brief Test (Table)
Movie Title | File Size | Transcoding | Codec | Duration | CPU Usage | Temperature | Smoothness |
---|---|---|---|---|---|---|---|
Detective Conan: The Fist of Blue Sapphire | 17.61GB | No | H.264 | 1:49:27 | 53.5% | 42℃ | No buffering, severe frame skipping |
Detective Conan: The Fist of Blue Sapphire | 17.61GB | Yes | H.264 | 1:49:27 | 288.7% | 61℃ | Very choppy |
Detective Conan: The Conspiracy at the Food Court | 226.04MB | No | H.264 | 24:44 | 14.9% | 36℃ | Perfect |
Detective Conan: The Conspiracy at the Food Court | 226.04MB | Yes | H.264 | 24:44 | 317.9% | 51℃ | Perfect |
Detective Conan: The Zero Enforcer | 5.63GB | Yes | H.265 | 1:51:20 | 341.2% | 73℃ | No buffering, severe frame skipping |
Natsume’s Book of Friends: The Other Side of the Glass | 160.3GB | Yes | H.264 10Bit | 24:17 | 375.5% | 71℃ | No buffering |
Love, Death and Robot | 656.66MB | Yes | H.265 | 12:06 | 352.9% | 76℃ | No buffering |
Zootopia | 13.89GB | Yes | H.264 | 1:48:44 | 393.8% | 73℃ | No buffering |