This script was created to speed up the Plex preview thumbnails process. It will use multi threaded processes with a mixture of nvidia GPU and CPU for max throughput
Create github issue OR see thread https://forums.plex.tv/t/script-to-regenerate-video-previews-multi-threaded/788360
Ensure ffmpeg is in your path https://www.ffmpeg.org/download.html
Requires python3
pip3 install loguru rich plexapi gpustat requests pymediainfo
Download the plex_generate_previews.py script to your machine. Open it in your fav editor and update variables.
To get your plex url and token
- Open plex web https://app.plex.tv/ and go to any video file
- Open the ... menu and select "get info"
- Click "view xml" on bottom left
- Use the url (without the path) for the
PLEX_URL
var in the python script. For examplehttps://xxxx.plex.direct:32400/
orhttps://127.0.0.1:32400/
if running locally. - Find Plex-Token in the url and insert the value into
PLEX_TOKEN
var in the python script.
You can specify an OPTIONAL cmd line arg which will tell the script to only work files which contain that text
python3 plex_preview_thumbnail_generator.py <ONLY_PROCESS_FILES_IN_PATH>