Plex: Difference between revisions

From miki
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 5: Line 5:
;Plex Add-ons
;Plex Add-ons
* [https://github.com/pannal/Sub-Zero.bundle/ Sub-zero] — an alternative to built-in subtitle finder.
* [https://github.com/pannal/Sub-Zero.bundle/ Sub-zero] — an alternative to built-in subtitle finder.

;Tools
* [https://www.filebot.net/ Filebot] A tool to rename media according to media center naming schemes (support Plex, Kodi...).


== Install ==
== Install ==
Line 23: Line 26:


== Configuration ==
== Configuration ==
See also Shield TV and Wolverine.
See also [[Shieldtv]] and [[Configuration NAS Wolverine]].


=== Plex App on NVidia Shield TV Pro ===
=== Plex App on NVidia Shield TV Pro ===
Line 35: Line 38:


=== Plex Server ===
=== Plex Server ===
* Connect: http://captain:32400/
* Server - Settings - Library - Disable media deletion.
* Server - Settings - Library - Disable media deletion.
* Languages - Prefer subtitles in Français.
* Languages - Prefer subtitles in Français.
Line 61: Line 65:
* Make sure H365 is enabled if supported.
* Make sure H365 is enabled if supported.
* Set plex add-on to autostart when Kodi starts (to avoid to navigate to that add-on every time).
* Set plex add-on to autostart when Kodi starts (to avoid to navigate to that add-on every time).

=== Prevent transcode with AC3 / EAC3 audio on Nvidia Shield TV ===
Although the NVidia shield TV supports AC3 / EAC3 natively, it is transcoded by the support [https://forums.plex.tv/t/native-nvidia-shield-plex-app-wont-direct-play-4k-eac3/616436], [https://www.reddit.com/r/PleX/comments/f8eo85/plex_app_on_shield_tv_refuses_to_direct_play/]

To prevent that:
* Use Plex add-on in Kodi, instead of the Plex app on the shield.
* ???

More on DirectPlay:
* https://www.reddit.com/r/PleX/comments/f8eo85/plex_app_on_shield_tv_refuses_to_direct_play/


=== Naming convention ===
=== Naming convention ===
Line 130: Line 124:
.Plex Server
.Plex Server
* Go to server page, manage, console or troubleshooting and click Download logs.
* Go to server page, manage, console or troubleshooting and click Download logs.

=== General workaround tips ===
When encountering an issue:
* Try to disable subtitles to see if issue is related to the subtitles.
* Try Kodi Plex add-on.
* Try changing the Plex server.


=== Rewind / FF issues ===
=== Rewind / FF issues ===
Line 141: Line 141:
=== 30s startup delay ===
=== 30s startup delay ===
See [[Plex issue 30s delay]].
See [[Plex issue 30s delay]].

Fix:
* Disable opportunistic lock on the NAS.


=== MP4 container with VOBSUB subtitles triggers transcode ===
=== MP4 container with VOBSUB subtitles triggers transcode ===
Test case: any DVD converted with Handbrake, using e.g. MP4 container, H264, any audio, VOBSUB subtitles.
Test case: any DVD converted with Handbrake, using e.g. MP4 container, H264, any audio, VOBSUB subtitles.


Workaround:
=== MKV container with PGC subtitles triggers transcode ===
* Use '''Kodi add-on'''.
* Use '''MKV''' container.

=== MKV container with PGS subtitles triggers transcode ===
Test case: {{file|[zza]Lucy.2014.BDRIP.1080p.x265.AC3.mkv}}.
Test case: {{file|[zza]Lucy.2014.BDRIP.1080p.x265.AC3.mkv}}.

Workaround:
* Use '''Kodi add-on'''.


=== Quality quite bad when transcoding on Shield ===
=== Quality quite bad when transcoding on Shield ===
Line 152: Line 162:
* Note: in App, Video Quality, Adjust automatically is set to OFF, but Home streaming is set to Maximum.
* Note: in App, Video Quality, Adjust automatically is set to OFF, but Home streaming is set to Maximum.


=== Miscellaneous issues ===
=== Miscellaneous issues log ===
* 'Enhanced' - French SRT subtitles not showing
* {{green|'''Invalid'''}} ''Enhanced'' - French SRT subtitles not showing
:* Because the SRT file was empty / corrupted.
:* Because the SRT file was empty / corrupted.
* {{green|'''Invalid'''}} ''Lucy'' ({{file|[zza]Lucy.2014.BDRIP.1080p.x265.AC3.mkv}}, MKV, H265, AC3 audio, PGS and SRT subtitles) - Cannot play AC3 audio, keep transcoding it and fails.
* 'Lucy' - Cannot play AC3 audio. Turns out there was an issue in that track anyway (delay).
:* Not related to AC3 but to PGS subtitles, which trigger transcode. In addition, there was an issue in that media (audio delay).
* Keep transcoding AC3 media.
:* Playing with '''PGS subtitles''' trigger transcode, which fails (so transcode not due to using AC3 as initially thought [https://www.reddit.com/r/PleX/comments/f8eo85/plex_app_on_shield_tv_refuses_to_direct_play/], [https://forums.plex.tv/t/native-nvidia-shield-plex-app-wont-direct-play-4k-eac3/616436]).
1382:Dec 20, 2020 00:42:18.545 [23009] DEBUG - [Transcode] MDE: Lucy (2014): Direct Play is disabled
1383:Dec 20, 2020 00:42:18.545 [23009] DEBUG - [Transcode] MDE: Lucy (2014): media must be transcoded in order to use the hls protocol
:* Note Plex addon on Kodi has better support for subtitles and audio in general [https://forums.plex.tv/t/native-nvidia-shield-plex-app-wont-direct-play-4k-eac3/616436].
* {{green|'''Invalid'''}} Keep transcoding AC3 media.
:* Does not seem to be the case in our DVD tests. The delay is due to something else.
:* Does not seem to be the case in our DVD tests. The delay is due to something else.
* When transcoding on Shield TV server, the quality is quite bad. Why can't we boost the quality of the transcode to the max (say 4Mb)?
* {{red|'''Issue'''}} Transcoding quality is quite bad even though quality is set to maxium (using Shield TV Pro for transcoding)
:* In the dashboard, we see that often times the bitrate is quite low (1Mb, sometimes less, or a small 2Mb). Why can't we boost the quality of the transcode to the max (say 4Mb)? Disabling HW support does not change much on this.
* {{green|'''Workaround'''}} ''Ghost in the Shell'' ({{file|Ghost in a Shell.m4v}}, HEVC, AAC LC, VOBSUB), transcode when enabling subtitles.
:* Known issue, due to MP4 container.


=== Reset / Retore Plex Server on NVIDIA Shield ===
;Ghost in the Shell (Anime)
+ Reference: [https://www.reddit.com/r/PleX/comments/p7qke6/restoring_database_backup_of_nvidia_shield_plex/ Reddit post]
* Direct Play without subtitles, but transcode with subtitles.
* MP4, but still 30s delay when using shield server.


This might be necessary if the Plex Media Server on the NVIDIA Shield refuses to start (eg. after a Shield FW upgrade).
;Lucy

* File {{file|[zza]Lucy.2014.BDRIP.1080p.x265.AC3.mkv}}, MKV, H265, AC3 audio, PGS and SRT subtitles.
;Clear data and/or cache
* Note that file has serious audio delay issues.
* This steps is necessary to recover the PMS app.
* Playing with '''PGS subtitles''' trigger transcode, which fails (so transcode not due to using AC3 as initially thought [https://www.reddit.com/r/PleX/comments/f8eo85/plex_app_on_shield_tv_refuses_to_direct_play/], [https://forums.plex.tv/t/native-nvidia-shield-plex-app-wont-direct-play-4k-eac3/616436]).
* In Shield settings, clear the Plex app '''cache''' (NOT THE DATA), and the PMS app '''data''' (note that PMS is a system app).
1382:Dec 20, 2020 00:42:18.545 [23009] DEBUG - [Transcode] MDE: Lucy (2014): Direct Play is disabled

1383:Dec 20, 2020 00:42:18.545 [23009] DEBUG - [Transcode] MDE: Lucy (2014): media must be transcoded in order to use the hls protocol
;Restore PMS backup
* Workaround:
* In Plex app, wait for PMS server to restart, and move the PMS storage location to '''user accessible''' internal storage.
:* Plex addon on Kodi [https://forums.plex.tv/t/native-nvidia-shield-plex-app-wont-direct-play-4k-eac3/616436].
* Then In Nvidia shield storage settings, enable file transfer via network.
* Also, stop the PMS server by forcing a stop (note that PMS is a system app).
* From remote PC, go to {{file|smb://xxx.xxx.xx.x/internal/Plex Media Server/Database Backups}} folder, if it exists (otherwise you don't have any backup). Copy the file there to another location.
* Rename the latest backup files to have them look like:
:* {{file|com.plexapp.plugins.library.db}}
:* {{file|com.plexapp.plugins.library.blobs.db}}
* Go to the PMS internal storage at {{file|//xxx.xxx.xx.x/internal/android/data/com.plexapp.mediaserver.smb/Plex Media Server/Plug-in Support/Databases}} (this requires to move the PMS storage location as said in the first step). Remove the files there, and copy there the two renamed files above.
* Restart the Plex application (might also need to restart the Nvidia Shield), and wait for the PMS to restart.
* Visit the PMS server on local network (http://xxx.xxx.xx.x/32400)
:* check that the libraries are restored.
:* trigger a '''refresh of all metadata''' to have all arts restored.


== To Do ==
== To Do ==
* Shield TV - Play with Shield audio passthrough settings. See if that enables the direct play of AC3.
* '''Done''' Shield TV - Play with Shield audio passthrough settings. See if that enables the direct play of AC3. — AC3 is supported wether HDMI passthrough is enabled or not.

Latest revision as of 21:05, 16 September 2022

Links

Plex Add-ons
  • Sub-zero — an alternative to built-in subtitle finder.
Tools
  • Filebot A tool to rename media according to media center naming schemes (support Plex, Kodi...).

Install

Plex Media Player on Linux

See https://knapsu.eu/plex/. Use flatpak. Dependency on KDE [2].

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak remote-add --if-not-exists kdeapps --from https://distribute.kde.org/kdeapps.flatpakrepo
flatpak remote-add --if-not-exists plex-media-player https://flatpak.knapsu.eu/plex-media-player.flatpakrepo
flatpak install plex-media-player tv.plex.PlexMediaPlayer

... doesn't seem to work great on Debian Buster at least.

Kodi Plex Add-On

  • Select add-on from videos add-on.
  • Sign in to account.
  • In settings, enable direct play and enable h265.
  • Optionally, set add-on to autostart when Kodi starts.

Configuration

See also Shieldtv and Configuration NAS Wolverine.

Plex App on NVidia Shield TV Pro

  • Audio Passthrough:
  • Set to HDMI because it amplifies AC3 audio.
  • Todo: Note that passthrough is not advised [3], so maybe we should reconsider that.
  • Video quality - Adjust automatically:
  • Currently set to OFF.
  • Todo: Does that influence the quality of transcode?

Plex Server

  • Connect: http://captain:32400/
  • Server - Settings - Library - Disable media deletion.
  • Languages - Prefer subtitles in Français.

How-To

Fix film metadata / bad matching

  • Go in server library.
  • Select movie, then Fix match....

If movie has several versions available, and one of these is not correct:

  • Select first split apart.

See also this post about upgrading the matching agent.

Use Plex add-on in Kodi

Advantage of using the Kodi add-on is that it has (currently) better direct play support (in particular AC3 audio).

To install Plex add-on in Kodi [4],[5]:

  • Go to Kodi add-on menu
  • Select Download, Videos Add-Ons.
  • Select Plex.
  • Install.

Some settings to consider:

  • Make sure direct play is enabled.
  • Make sure H365 is enabled if supported.
  • Set plex add-on to autostart when Kodi starts (to avoid to navigate to that add-on every time).

Naming convention

References [6]

Recommended folder structure:

   /Media
      /Movies
         movie content
      /Music
         music content
      /TV Shows
         television content
Basic Naming - separate folder
   /Movies
      /Avatar (2009)
         Avatar (2009).mkv
      /Batman Begins (2005)
         Batman Begins (2005).mp4
         Batman Begins (2005).en.srt
         poster.jpg
Basic Naming - standalone files (slower scanning)
   /Movies
      Avatar (2009).mkv
      Batman Begins (2005).mp4
Split across multiple files
Use MovieName (release year) – Split_Name.ext, where Split_Name is cdX, discX, diskX, dvdX, partX or ptX.
   /Movies
      /The Dark Knight (2008)
         The Dark Knight (2008) - pt1.mp4
         The Dark Knight (2008) - pt2.mp4
Subtitles
Must enable the local media assets scanner. Recommended formats are SRT, SMI, SSA (or ASS).
Use
  • MovieName (Release Date).[Language_Code].ext or
  • Movies/MovieName (Release Date).[Language_Code].ext
  • Movies/MovieName (Release Date).[Language_Code].forced.ext
   /Movies
      Avatar (2009).mkv
      Avatar (2009).en.srt
   
   /Movies
      /Avatar (2009)
         Avatar (2009).mkv
         Avatar (2009).eng.ass

Troubleshooting

Collect logs

Plex Player

.Plex Server

  • Go to server page, manage, console or troubleshooting and click Download logs.

General workaround tips

When encountering an issue:

  • Try to disable subtitles to see if issue is related to the subtitles.
  • Try Kodi Plex add-on.
  • Try changing the Plex server.

Rewind / FF issues

  • At least have that issue on Chrome / Debian Buster, with ShieldTV embedded player.
  • Trying fix:
  • Trying the official player from https://plex.tv, click launch.
  • Trying to enable Settings -> Plex Web -> Debug -> Use alternate streaming protocol for video playback. -> Much better!

30s startup delay

See Plex issue 30s delay.

Fix:

  • Disable opportunistic lock on the NAS.

MP4 container with VOBSUB subtitles triggers transcode

Test case: any DVD converted with Handbrake, using e.g. MP4 container, H264, any audio, VOBSUB subtitles.

Workaround:

  • Use Kodi add-on.
  • Use MKV container.

MKV container with PGS subtitles triggers transcode

Test case: [zza]Lucy.2014.BDRIP.1080p.x265.AC3.mkv.

Workaround:

  • Use Kodi add-on.

Quality quite bad when transcoding on Shield

  • transcoding quality is quite low (using shield plex app and shield plex server)
  • Note: in App, Video Quality, Adjust automatically is set to OFF, but Home streaming is set to Maximum.

Miscellaneous issues log

  • Invalid Enhanced - French SRT subtitles not showing
  • Because the SRT file was empty / corrupted.
  • Invalid Lucy ([zza]Lucy.2014.BDRIP.1080p.x265.AC3.mkv, MKV, H265, AC3 audio, PGS and SRT subtitles) - Cannot play AC3 audio, keep transcoding it and fails.
  • Not related to AC3 but to PGS subtitles, which trigger transcode. In addition, there was an issue in that media (audio delay).
  • Playing with PGS subtitles trigger transcode, which fails (so transcode not due to using AC3 as initially thought [8], [9]).
1382:Dec 20, 2020 00:42:18.545 [23009] DEBUG - [Transcode] MDE: Lucy (2014): Direct Play is disabled
1383:Dec 20, 2020 00:42:18.545 [23009] DEBUG - [Transcode] MDE: Lucy (2014): media must be transcoded in order to use the hls protocol
  • Note Plex addon on Kodi has better support for subtitles and audio in general [10].
  • Invalid Keep transcoding AC3 media.
  • Does not seem to be the case in our DVD tests. The delay is due to something else.
  • Issue Transcoding quality is quite bad even though quality is set to maxium (using Shield TV Pro for transcoding)
  • In the dashboard, we see that often times the bitrate is quite low (1Mb, sometimes less, or a small 2Mb). Why can't we boost the quality of the transcode to the max (say 4Mb)? Disabling HW support does not change much on this.
  • Workaround Ghost in the Shell (Ghost in a Shell.m4v, HEVC, AAC LC, VOBSUB), transcode when enabling subtitles.
  • Known issue, due to MP4 container.

Reset / Retore Plex Server on NVIDIA Shield

+ Reference: Reddit post

This might be necessary if the Plex Media Server on the NVIDIA Shield refuses to start (eg. after a Shield FW upgrade).

Clear data and/or cache
  • This steps is necessary to recover the PMS app.
  • In Shield settings, clear the Plex app cache (NOT THE DATA), and the PMS app data (note that PMS is a system app).
Restore PMS backup
  • In Plex app, wait for PMS server to restart, and move the PMS storage location to user accessible internal storage.
  • Then In Nvidia shield storage settings, enable file transfer via network.
  • Also, stop the PMS server by forcing a stop (note that PMS is a system app).
  • From remote PC, go to smb://xxx.xxx.xx.x/internal/Plex Media Server/Database Backups folder, if it exists (otherwise you don't have any backup). Copy the file there to another location.
  • Rename the latest backup files to have them look like:
  • com.plexapp.plugins.library.db
  • com.plexapp.plugins.library.blobs.db
  • Go to the PMS internal storage at //xxx.xxx.xx.x/internal/android/data/com.plexapp.mediaserver.smb/Plex Media Server/Plug-in Support/Databases (this requires to move the PMS storage location as said in the first step). Remove the files there, and copy there the two renamed files above.
  • Restart the Plex application (might also need to restart the Nvidia Shield), and wait for the PMS to restart.
  • Visit the PMS server on local network (http://xxx.xxx.xx.x/32400)
  • check that the libraries are restored.
  • trigger a refresh of all metadata to have all arts restored.

To Do

  • Done Shield TV - Play with Shield audio passthrough settings. See if that enables the direct play of AC3. — AC3 is supported wether HDMI passthrough is enabled or not.