Plex: Difference between revisions

From miki
Jump to navigation Jump to search
Line 266: Line 266:
* Keep transcoding AC3 media.
* 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)?


;Ghost in the Shell (Anime)
;Ghost in the Shell (Anime)

Revision as of 23:59, 26 December 2020

Links

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

Configuration

See also Shield TV and Wolverine.

  • 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 [3],[4]:

  • 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).

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 [5], [6]

To prevent that:

  • Use Plex add-on in Kodi, instead of the Plex app on the shield.
  • ???

More on DirectPlay:

Naming convention

References [7]

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

Issue with playing Lucy

  • Trying to play Lucy (H265 HEVC AC3) on Shield TV -> can't play (error).
  • Looking at the server log, we see there are errors in the transcoder.
  • We also see that server says directplay is disabled
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
  • When forbidding transcoding on server, shield refuses to play as well (with another msg, but that basically says server tried to transcode but was refused to).
  • It seems transcoding is forced with Shield Plex App because of AC3 audio / E-AC3 audio [8], [9].
  • One solution is to use Plex addon on Kodi [10].
  • Maybe another solution is to install Plex beta app from Plex.
  • In Kodi addon:
  • Select appropriate Plex Server.
  • Make sure direct play is enabled (default).
  • Enable H265 direct play (disabled by default).
  • Optionally, set Plex addon to autostart (when kodi starts, so that to jump to Plex addon directly).
  • ... Turns out that the audio track had a delay, so likely was corrupted in some way.

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

  • Symptom: when launching media, 30s (32 in fact) of spinning wheel before media shows up. During that time, dashboard doesn't show any connection.
  • Relevant tickets [11], [12].
  • Seems to occur only when doing Direct Stream on the Plex App on Shieldh TV Pro.
  • When transcoding (can be forced by disabling HDMI passthrough on Plex App), delay is only 8s on Shield TV Pro.
  • Can't reproduce this anymore. Audio passthrough disabled doesn't trigger transcode when using AC3 anymore (saw a quick update message before playing the media).
  • On Web browser, delay is less than 3s, direct or not.
  • On Kodi addon, delay is ?.

Some tests:

  • Select movie.
  • Select version
  • Play from start.
  • When Direct Play, try both Shield as server, and Wolverine.
  • Shield App:
  • Dec 26, 2020 17:33
  • 1080p, 1.9Mbps: Interstellar 1080p H264 AAC stereo .MP4: Direct Play AV, 3s (+SRT subtitles)
  • SD, 1.7Mbps: Interstellar 480p H264 AC3 5.1 .MKV: '
  • SD, 1.5Mbps: Interstellar 480p H264 AAC 5.1 .MKV: '
  • SD, 1.4Mbps: Interstellar 480p H265 AC3 5.1 .MKV: '
  • Dec 26, 2020 17:36:35
  • Shield Kodi:
  • Note: on Kodi, even when there is a delay, the play request shows up immediately on the dashboard. Looking in the log, we don't see the same 30s delay between the Content-Length requests.
  • Dec 26, 2020 17:37:51
  • 1080p, 1.9Mbps: Interstellar 1080p H264 AAC stereo .MP4: Direct Play AV, 3s (+SRT subtitles)
  • Note that in the logs, we see transcode messages, even though it direct plays.
    Dec 26, 2020 19:11:35.247 [4977] DEBUG - [Transcode] MDE: Interstellar (2014): no direct play video profile exists for http/mp4/h264
    Dec 26, 2020 19:11:35.247 [4977] DEBUG - [Transcode] MDE: Interstellar (2014): no direct play video profile exists for http/mp4/h264/aac
    Dec 26, 2020 19:11:35.247 [4977] DEBUG - [Transcode] MDE: Interstellar (2014): transcoding selected subtitle stream
    Dec 26, 2020 19:11:35.247 [4977] DEBUG - [Transcode] MDE: Interstellar (2014): selected media 0 / 183
  • SD, 1.7Mbps: Interstellar 480p H264 AC3 5.1 .MKV: Direct Play AV, 20s (+SRT subtitles!)
  • SD, 1.5Mbps: Interstellar 480p H264 AAC 5.1 .MKV: Direct Play AV, 20s (+SRT subtitles!)
  • SD, 1.4Mbps: Interstellar 480p H265 AC3 5.1 .MKV: '
  • Dec 26, 2020 17:40:24
  • Shield App with Shield Server:
  • Start — Dec 26, 2020 21:24:34
  • Delay One Brave-H264-AAC2ch.mkv: DP 30s (same with VOBSUB)
  • Delay Two Brave-H264-AAC2ch-mp4weboptim.m4v: DP 2s (no VOBSUB available :-( )
  • Delay Three Brave-H264-AAC5.1ch.mkv: DP 30s (same with VOBSUB)
  • Delay Four Brave-H264-AAC5.1ch-mp4weboptim.m4v: DP 2s (no VOBSUB available :-( )
  • Delay Five Brave-H264-AC32ch.mkv: DP 30s (same with VOBSUB)
  • Delay Six Brave-H264-AC32ch-mp4weboptim.m4v: DP 2s (no VOBSUB available :-( )
  • Delay Seven Brave-H264-AC35.1chpassthrough.mkv: DP 30s (same with VOBSUB)
  • Delay Eight Brave-H264-AC35.1chpassthrough-mp4weboptim.m4v: DP 2s (no VOBSUB available :-( )
  • Delay Nine Brave-H264-AC35.1chrecoded.mkv: DP 30s (same with VOBSUB)
  • Delay Ten Brave-H264-AC35.1chrecoded-mp4weboptim.m4v: DP 1s (no VOBSUB available :-( )
  • End — Dec 26, 2020 21:32:52
  • DelayTwo One - Bad Teacher-AAC2ch.mkv: DP 30s (same with VOBSUB)
  • DelayTwo Two - Bad Teacher-AAC2ch-mp4weboptim.m4v: DP 2s, but if playing VOBSUB, transcode V (and bad quality) (transcode reason: Direct Play was attempted but failed, fallen back to transcoding)
  • DelayTwo Three - Bad Teacher-AAC5.1ch-mp4weboptim.m4v: DP 2s, but if playing VOBSUB, transcode V (and bad quality) (transcode reason: Direct Play was attempted but failed, fallen back to transcoding)
  • DelayThree One - Brave - H264-AACstereo-MP4.m4v: DP 2s (MP4 but not web optimized) But if playing VOBSUB, transcode V (and bad quality) (transcode reason: Direct Play was attempted but failed, fallen back to transcoding)!
  • DelayThree Two - Brave - H264-AC3passthrough-MP4.m4v: DP 2s (MP4 but not web optimized). But if playing VOBSUB, transcode V (and bad quality) (transcode reason: Direct Play was attempted but failed, fallen back to transcoding)!
  • Shield Kodi with Shield Server:
  • Start — Dec 26, 2020 21:38:41
  • Delay One Brave-H264-AAC2ch.mkv: DP 20s
  • Delay Two Brave-H264-AAC2ch-mp4weboptim.m4v: DP 2s
  • Delay Three Brave-H264-AAC5.1ch.mkv: DP 20s, but doesnt play (goes into Playing Next screen)
We get the following errors. But we get the same when it works, except the curl_easy_perform one.
   Dec 26, 2020 21:42:28.038 [10513] Error — Error issuing curl_easy_perform(handle): 28
   Dec 26, 2020 21:42:30.098 [10358] Error — [Transcode] ClientProfileExtra: missing protocol parameter
   Dec 26, 2020 21:42:30.098 [10358] Warning — [Transcode] ClientProfileExtra: ignoring directive: append-transcode-target-audio-codec(type=videoProfile&context=streaming&audioCodec=ac3)
   Dec 26, 2020 21:42:30.099 [10358] Warning — [Transcode] TranscodeUniversalRequest: at least one profile extra directive could not be read
   Dec 26, 2020 21:42:51.601 [10633] Error — Unknown metadata type: folder
   Dec 26, 2020 21:42:51.693 [10634] Warning — SLOW QUERY: It took 210.000000 ms to retrieve 51 items.
  • Delay Four Brave-H264-AAC5.1ch-mp4weboptim.m4v: DP 2s
  • Delay Five Brave-H264-AC32ch.mkv: DP 20s, but doesnt play
  • Delay Six Brave-H264-AC32ch-mp4weboptim.m4v: DP 2s
  • Delay Seven Brave-H264-AC35.1chpassthrough.mkv: DP 20s, but doesnt play
  • Delay Eight Brave-H264-AC35.1chpassthrough-mp4weboptim.m4v: DP 2s
  • Delay Nine Brave-H264-AC35.1chrecoded.mkv: DP 20s, but doesnt play
  • Delay Ten Brave-H264-AC35.1chrecoded-mp4weboptim.m4v: DP 2s
  • End — Dec 26, 2020 21:54:33
  • DelayTwo One - Bad Teacher-AAC2ch.mkv: DP 20s
  • DelayTwo Two - Bad Teacher-AAC2ch-mp4weboptim.m4v: DP 2s
  • DelayTwo Three - Bad Teacher-AAC5.1ch-mp4weboptim.m4v: DP 2s
  • DelayThree One - Brave - H264-AACstereo-MP4.m4v: DP 2s (MP4 but not web optimized). If playing VOBSUB, DP 2s also!
  • DelayThree Two - Brave - H264-AC3passthrough-MP4.m4v: DP 2s (MP4 but not web optimized). If playing VOBSUB, DP 2s also!
  • Shield App with Shield Server, with HDMI passthrough disabled:
  • ... This was our trick to trigger anymore when using AC3, but this doesn't work anymore.
  • Shield App with Synology Server:
  • End — Dec 26, 2020 23:09:xx
  • Delay One to Ten: Direct Play 2s delay. Same with VOBSUB.
  • End — Dec 26, 2020 23:11:45
  • DelayThree One - Brave - H264-AACstereo-MP4.m4v: DP 2s (MP4 but not web optimized) But if playing VOBSUB, Cannot play media (because transcode disabled)!
  • DelayThree Two - Brave - H264-AC3passthrough-MP4.m4v: DP 2s (MP4 but not web optimized). But if playing VOBSUB, Cannot play media (because transcode disabled)!
  • Shield Kodi with Synology Server:
  • Start — Dec 26, 2020 23:15:21
  • Delay One to Ten: Direct Play 2s delay. Same with VOBSUB.
  • End — Dec 26, 2020 23:18:35
  • DelayTwo One - Bad Teacher-AAC2ch.mkv: DP 2s (same with VOBSUB)
  • DelayTwo Two - Bad Teacher-AAC2ch-mp4weboptim.m4v: DP 2s (same with VOBSUB)
  • DelayTwo Three - Bad Teacher-AAC5.1ch-mp4weboptim.m4v: DP 2s (same with VOBSUB)
  • DelayThree One - Brave - H264-AACstereo-MP4.m4v: DP 2s (MP4 but not web optimized). If playing VOBSUB, DP 2s also!
  • DelayThree Two - Brave - H264-AC3passthrough-MP4.m4v: DP 2s (MP4 but not web optimized). If playing VOBSUB, DP 2s also!

Relevant logs analysis:

  • We get a Failed to stream media, client probably disconnected after 5505024 bytes: 104 - Connection reset by peer. Initially thought it was linked to 30s delay, but we get it everytimes.
49122:Dec 26, 2020 16:53:12.388 [22929] DEBUG - Auth: authenticated user 1 as m.xelp@immie.org
49123:Dec 26, 2020 16:53:12.388 [32247] DEBUG - Request: [192.168.1.88:42344 (Subnet)] GET /library/parts/12486/1608848836/file.mkv?autoAdjustQuality=0&hasMDE=1&location=lan&mediaBufferSize=74944 (8 live) TLS Signed-in Token (m.xelp@immie.org) (range: bytes=0-) 
49124:Dec 26, 2020 16:53:12.404 [32247] DEBUG - Content-Length of /storage/WOLVERINE/family/movie/_tests/Interstellar (2014) - x265.mkv is 1746637281 (of total: 1746637281).
49125:Dec 26, 2020 16:53:12.620 [22929] DEBUG - Auth: authenticated user 1 as m.xelp@immie.org
49126:Dec 26, 2020 16:53:12.620 [31709] DEBUG - Request: [192.168.1.88:42346 (Subnet)] GET /library/parts/12486/1608848836/file.mkv?autoAdjustQuality=0&hasMDE=1&location=lan&mediaBufferSize=74944 (9 live) TLS Signed-in Token (m.xelp@immie.org) (range: bytes=1746378705-) 
49127:Dec 26, 2020 16:53:12.626 [31709] DEBUG - Content-Length of /storage/WOLVERINE/family/movie/_tests/Interstellar (2014) - x265.mkv is 258576 (of total: 1746637281).
49128:Dec 26, 2020 16:53:42.665 [22929] DEBUG - Failed to stream media, client probably disconnected after 5505024 bytes: 104 - Connection reset by peer
49129:Dec 26, 2020 16:53:42.665 [22929] DEBUG - Completed after connection close: [192.168.1.88:42344] 206 GET /library/parts/12486/1608848836/file.mkv?autoAdjustQuality=0&hasMDE=1&location=lan&mediaBufferSize=74944 (7 live) TLS 30276ms 5505024 bytes (range: bytes=0-) 
49130:Dec 26, 2020 16:53:42.680 [22929] DEBUG - Completed: [192.168.1.88:42346] 206 GET /library/parts/12486/1608848836/file.mkv?autoAdjustQuality=0&hasMDE=1&location=lan&mediaBufferSize=74944 (7 live) TLS 30059ms 258576 bytes (range: bytes=1746378705-) 
49131:Dec 26, 2020 16:53:42.780 [22929] DEBUG - Auth: authenticated user 1 as m.xelp@immie.org
49132:Dec 26, 2020 16:53:42.781 [31709] DEBUG - Request: [192.168.1.88:42350 (Subnet)] GET /library/parts/12486/1608848836/file.mkv?autoAdjustQuality=0&hasMDE=1&location=lan&mediaBufferSize=74944 (7 live) TLS Signed-in Token (m.xelp@immie.org) (range: bytes=5006-) 
49133:Dec 26, 2020 16:53:42.795 [31709] DEBUG - Content-Length of /storage/WOLVERINE/family/movie/_tests/Interstellar (2014) - x265.mkv is 1746632275 (of total: 1746637281).
49134:Dec 26, 2020 16:53:43.252 [22929] DEBUG - Auth: authenticated user 1 as m.xelp@immie.org
49135:Dec 26, 2020 16:53:43.252 [31709] DEBUG - Request: [192.168.1.88:42352 (Subnet)] POST /playQueues?includeChapters=1&continuous=0&includeLoudnessRamps=1&repeat=0&extrasPrefixCount=0&type=video&shuffle=0&uri=server%3A%2F%2F315dbe1ac5eab4b3b25956e1907bba687927fecf%2Fcom.plexapp.plugins.library%2Flibrary%2Fmetadata%2F183&key=%2Flibrary%2Fmetadata%2F183 (7 live) TLS GZIP Signed-in Token (m.xelp@immie.org)
  • When on Kodi Add-on, we get this msg every 5s, even when no movie playing:
   Dec 26, 2020 17:39:52.399 [22928] DEBUG - Auth: authenticated user 1 as m.xelp@immie.org
   Dec 26, 2020 17:39:52.399 [2609] DEBUG - Request: [192.168.1.61:59608 (Subnet)] GET /statistics/bandwidth?timespan=6 (17 live) GZIP Signed-in Token (m.xelp@immie.org)
   Dec 26, 2020 17:39:52.411 [22928] DEBUG - Completed: [192.168.1.61:59608] 200 GET /statistics/bandwidth?timespan=6 (17 live) GZIP 12ms 1514 bytes (pipelined: 19)
  • When streaming ends, we get:
   Dec 26, 2020 21:57:29.759 [11396] DEBUG — Streaming Resource: Terminated session 0x29fdd71598:440ac09a-635c-4e98-971b-720a0905387e with reason Client stopped playback.

Relevant analysis:

  • When using MP4 (web optimized) container, there is no thumbnail when movie is not identified, but there is one when using .MKV container.
  • AC3/AAC loudness difference:
  • With HDMI passthrough, loudness is bigger for AC3 than for AAC. When HDMI passthrough is disabled, AC3 and AAC have same loudness, which is same as AAC with HDMI passthrough.
  • This doesn't occur with Kodi add-on (probably because no HDMI passthrough).

Miscellaneous issues

  • 'Enhanced' - French SRT subtitles not showing
  • Because the SRT file was empty / corrupted.
  • 'Lucy' - Cannot play AC3 audio. Turns out there was an issue in that track anyway (delay).
  • Keep transcoding AC3 media.
  • 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)?
Ghost in the Shell (Anime)
  • Direct Play without subtitles, but transcode with subtitles.
  • MP4, but still 30s delay when using shield server.

To Do

  • Shield TV - Play with Shield audio passthrough settings. See if that enables the direct play of AC3.