Skip to content

Instantly share code, notes, and snippets.

@bogsen
bogsen / fix-plex-hdr-subtitles.md
Last active September 6, 2024 10:48
Fix Plex transcoding HDR videos very slowly when burning subtitles in at the same time

This workaround should no longer be necessary with newer Plex versions: https://forums.plex.tv/t/subtitle-burn-in-improvement-test-build/884481


Old content left here for reference:

What?

For some reason, although Plex supports hardware-accelerated HDR tone mapping, Plex decides not to use it when subtitles need to be burned in. This results in extremely slow transcoding on hardware that should

#!/usr/bin/env python
from evdev import InputDevice, list_devices, ecodes
from os import system
FILTER_ALL = 0x10
FILTER_STYLUS = 0x04
DEFAULT_FILTER = FILTER_ALL
device = None
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
int main() {
int fd = open("/dev/fb0", O_WRONLY);
while (1) {
ioctl(fd, 1074032001);
sleep(1);
}