You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add intro, credits, and outro detection to plex_generate_vid_previews using FFmpeg chromaprint audio fingerprinting (intros) and blackdetect/silencedetect filters (credits), then write markers to the Plex database's taggings table.
Chromaprint audio fingerprinting — an FFmpeg extension that compares audio across episodes in a season to find recurring segments (intro themes). This is the primary method for intro detection.
Silence detection — FFmpeg's silencedetect filter finds extended periods of silence that often precede credits.
Detection Parameters
Intros: 15s–2min long, located within the first 25% of episode or first 10 minutes (whichever is smaller)
Credits: 15s–5min long, located near the end of the video (typically last 25%)
How Plex Stores Markers
Plex stores markers in its SQLite database in the taggings table (confirmed by MarkerEditorForPlex source code). Key fields:
Field
Description
metadata_item_id
Plex episode/movie rating key
tag_id
Marker tag type (tag_type=12 in the tags table)
index
Ordering index for multiple markers
text
Marker type: 'intro', 'credits', or 'commercial'
time_offset
Start time in milliseconds
end_time_offset
End time in milliseconds
created_at
Timestamp
extra_data
JSON (PMS >=1.40) or legacy string with version and final flag
There is no public Plex HTTP API for creating markers. Both MarkerEditorForPlex and the now-EOL plex-credits-detect project write directly to the SQLite database. python-plexapi only has read-only Marker objects but no addMarker() method.
The project already has PLEX_CONFIG_FOLDER access, so the Plex database at PLEX_CONFIG_FOLDER/Plug-in Support/Databases/com.plexapp.plugins.library.db is accessible.
Architecture
flowchart TB
subgraph detection [Detection Phase]
A[Enumerate Library] --> B{Media Type?}
B -->|TV Episode| C[Group by Season]
B -->|Movie| D[Single File Analysis]
C --> E["Chromaprint Fingerprint each episode"]
E --> F["Compare Fingerprints across season"]
F --> G["Identify Common Audio Segments"]
G --> H[Intro Markers]
C --> I["BlackDetect + SilenceDetect near end of each episode"]
D --> I
I --> J[Credits Markers]
end
subgraph writing [Marker Write Phase]
H --> K["Write to Plex SQLite taggings table"]
J --> K
K --> L["Verify via python-plexapi read"]
end
Feature: Add Intro, Credits, and Outro Detection
Summary
Add intro, credits, and outro detection to plex_generate_vid_previews using FFmpeg chromaprint audio fingerprinting (intros) and blackdetect/silencedetect filters (credits), then write markers to the Plex database's
taggingstable.Research Findings
How Plex Does Detection Internally
Plex uses three detection methods (confirmed by the intro-skipper project wiki and Plex blog):
blackdetectfilter identifies black/near-black frames marking transitions (credits start).silencedetectfilter finds extended periods of silence that often precede credits.Detection Parameters
How Plex Stores Markers
Plex stores markers in its SQLite database in the
taggingstable (confirmed by MarkerEditorForPlex source code). Key fields:metadata_item_idtag_idtagstable)indextext'intro','credits', or'commercial'time_offsetend_time_offsetcreated_atextra_dataThere is no public Plex HTTP API for creating markers. Both MarkerEditorForPlex and the now-EOL plex-credits-detect project write directly to the SQLite database.
python-plexapionly has read-onlyMarkerobjects but noaddMarker()method.The project already has
PLEX_CONFIG_FOLDERaccess, so the Plex database atPLEX_CONFIG_FOLDER/Plug-in Support/Databases/com.plexapp.plugins.library.dbis accessible.Architecture
flowchart TB subgraph detection [Detection Phase] A[Enumerate Library] --> B{Media Type?} B -->|TV Episode| C[Group by Season] B -->|Movie| D[Single File Analysis] C --> E["Chromaprint Fingerprint each episode"] E --> F["Compare Fingerprints across season"] F --> G["Identify Common Audio Segments"] G --> H[Intro Markers] C --> I["BlackDetect + SilenceDetect near end of each episode"] D --> I I --> J[Credits Markers] end subgraph writing [Marker Write Phase] H --> K["Write to Plex SQLite taggings table"] J --> K K --> L["Verify via python-plexapi read"] end