Re: Plex for Windows does not use SVP

Hey, I reinstalled SVP (picked every package despite some of them probably not needed). Mpv plays at high frame rate, I am able to transcode a video with the svp transcoder, I am able to import vapoursynth into a python console. "Plex for Windows" still doesn't work. I've tried both copying the mpv-1.dll file and deleting it, the end result is the same. The video plays but doesn't transcode to a frame rate.

These are my env values:
https://i.imgur.com/0HnuruC.png

This is my event log:

12:16:02.214 [i]: VideoPlayer: mpv [Plex.exe] connected, waiting for the video info...
12:16:04.746 [i]: VideoPlayer: mpv 0.33.0-dirty /via 'mpvpipe'
12:16:05.441 [i]: Media: video looks like some kind of stream
12:16:05.441 [i]: Media: video 1440x1080 [PAR 1.000] at 23.976 fps (via video player)
12:16:05.441 [i]: Media: codec type is hevc (HEVC (High Efficiency Video Coding)), DXVA2_VLD, BT.709 BT.1886
12:16:05.630 [i]: Playback: starting up...
12:16:05.634 [i]: Playback [af3afe49]: Frame server (64-bit) C:\Program Files (x86)\SVP 4\mpv64\vapoursynth.dll
12:16:05.635 [i]: Playback [af3afe49]: resulting video frame 1440x1080
12:16:05.635 [i]: Playback [af3afe49]: 1 acceptible profiles, best is 'Automatic' [0]
12:16:05.637 [i]: Playback [af3afe49]: enabled while video is paused
12:16:05.638 [i]: Profile: using automatic profile #1 /film
12:16:05.639 [i]: Playback [af3afe49]: playing at 47.952 [23.976 *2/1] 
12:16:05.668 [E]: Playback [af3afe49]: VS - Could not initialize VapourSynth scripting.

Re: Plex for Windows does not use SVP

copy _everything_ from SVP\mpv64 into Plex's folder

Re: Plex for Windows does not use SVP

It works now! Thank you! big_smile

29 (edited by joaoserraseal 30-04-2022 15:39:04)

Re: Plex for Windows does not use SVP

just sharing
so anyway just to share that...
since i have to keep replacing the mpv-1.dll all the time (each time plex client updates)

I've decided to make a batch svpToPlex.bat

COPY "C:\Program Files (x86)\SVP 4\mpv64\mpv-1.dll" "C:\Program Files\Plex\Plex"
PAUSE

this will copy automatically the mpv file to my plex client, although you need to execute it with admin priveleges
I'm still thinking if theres a way to run this easily each time i turn plex on, like a pseudo-shortcut with plex icon maybe

I could add it to windows startup but this wont work for me since i most of times use Hibernate pc

30 (edited by benj0670 08-06-2022 03:47:13)

Re: Plex for Windows does not use SVP

Looks like the issue has returned with the latest Plex-1.45.0.3013 update. Above mentions copying everything into the Plex/Plex directory, I have tried this and it does not work. It was previously working fine on Plex-1.43.4.2971 all that changed was Plex updated. I have replaced the mpv-1.dll since the update and it fails with error code 4294967283. It seems that there is an issue with resolving the stream host. I have provided what I've found below to show that it works fine with Plex's dll but not SVP's dll. All that is changed is the mpv-1.dll:

Plex's original mpv-1.dll:

Jun 08, 2022 00:52:58.714 [7036] DEBUG - [MPVEngine/mpv] cplayer: Setting option 'stream-lavf-o' = 'resolve_hosts=[XXXXXXXXXXX.plex.direct:XXXXXXXXXXX]' (flags = 16)
Jun 08, 2022 00:52:58.715 [7036] DEBUG - [MPVEngine/mpv] cplayer: Running hook: ytdl_hook/on_load
Jun 08, 2022 00:52:58.715 [7036] DEBUG - [MPVEngine/mpv] ytdl_hook: ytdl:// hook 
Jun 08, 2022 00:52:58.715 [7036] DEBUG - [MPVEngine/mpv] cplayer: Set property: start="+1796" -> 1
Jun 08, 2022 00:52:58.715 [7036] DEBUG - [MPVEngine/mpv] ytdl_hook: not a ytdl:// url 
Jun 08, 2022 00:52:58.715 [7036] DEBUG - [MPVEngine/mpv] cplayer: Set property: aid="no" -> 1
Jun 08, 2022 00:52:58.715 [7036] DEBUG - [MPVEngine/mpv] cplayer: Set property: sid="no" -> 1
un 08, 2022 00:52:58.715 [7036] DEBUG - [MPVEngine/mpv] ffmpeg: Opening https://XXXXXXXXXX.plex.direct:32400/library/parts/2151/1499763098/file.mkv?X-Plex-Session-Identifier=n6o2qylyc6vqah1jf6j4v9xd&X-Plex-Product=Plex%20for%20Windows&X-Plex-Version=1.45.0.3013-1676042f&X-Plex-Client-Identifier=oti94rrvujjg47wu7cq8df9q&X-Plex-Platform=windows&X-Plex-Platform-Version=10.0.22000&X-Plex-Features=external-media%2Cindirect-media&X-Plex-Model=standalone&X-Plex-Device-Name=SurfaceBook2&X-Plex-Device-Screen-Resolution=1481x858%2C1714x1143&X-Plex-Client-Profile-Name=Plex%20Desktop&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx&X-Plex-Language=en&Accept-Language=en
Jun 08, 2022 00:52:58.768 [7036] DEBUG - [MPVEngine/mpv] ffmpeg: Mime-type: 'video/x-matroska'
Jun 08, 2022 00:52:58.768 [7036] DEBUG - [MPVEngine/mpv] demux: Trying demuxers for level=normal.
Jun 08, 2022 00:52:58.768 [7036] DEBUG - [MPVEngine/mpv] mkv: Seeking to 3117326564 to read header element 0x1c53bb6b.
Jun 08, 2022 00:52:58.768 [7036] DEBUG - [MPVEngine/mpv] ffmpeg: stream level seek from 16384 to 3117326564
Jun 08, 2022 00:52:58.814 [7036] INFO - [MPVEngine] Resuming playback.
Jun 08, 2022 00:52:58.814 [7036] DEBUG - [MPVEngine/mpv] cplayer: Set property: pause=no -> 1
Jun 08, 2022 00:52:58.815 [7036] INFO - [MPVEngine] Playback has resumed.
Jun 08, 2022 00:52:58.815 [10876] DEBUG - [QHotkeyInput] Playback state is now 'Playing'

SVP's mpv-1.dll:

Jun 08, 2022 00:49:40.008 [10812] DEBUG - [MPVEngine/mpv] cplayer: Setting option 'stream-lavf-o' = 'resolve_hosts=[XXXXXXXXXXX.plex.direct:XXXXXXXXXXX]' (flags = 16)
Jun 08, 2022 00:49:40.008 [10812] DEBUG - [MPVEngine/mpv] cplayer: Running hook: ytdl_hook/on_load
Jun 08, 2022 00:49:40.008 [10812] DEBUG - [MPVEngine/mpv] ytdl_hook: ytdl:// hook 
Jun 08, 2022 00:49:40.008 [10812] DEBUG - [MPVEngine/mpv] cplayer: Set property: start="+650" -> 1
Jun 08, 2022 00:49:40.008 [10812] DEBUG - [MPVEngine/mpv] ytdl_hook: not a ytdl:// url 
Jun 08, 2022 00:49:40.008 [10812] DEBUG - [MPVEngine/mpv] cplayer: Set property: aid="no" -> 1
Jun 08, 2022 00:49:40.008 [10812] DEBUG - [MPVEngine/mpv] cplayer: Set property: sid="no" -> 1
Jun 08, 2022 00:49:40.008 [10812] DEBUG - [MPVEngine/mpv] ffmpeg: Opening https://XXXXXXXXXX.plex.direct:32400/video/:/transcode/universal/start?hasMDE=1&path=%2Flibrary%2Fmetadata%2F6110&mediaIndex=0&partIndex=0&protocol=http&fastSeek=1&directPlay=0&directStream=1&subtitleSize=100&audioBoost=100&location=lan&addDebugOverlay=0&autoAdjustQuality=0&directStreamAudio=1&advancedSubtitles=text&session=w88l4lzkqkk4r1neskd6gfga&offset=650&subtitles=auto&copyts=1&Accept-Language=en&X-Plex-Session-Identifier=tkt3rheiwgook11zjim7r5os&X-Plex-Chunked=1&X-Plex-Incomplete-Segments=1&X-Plex-Product=Plex%20for%20Windows&X-Plex-Version=1.45.0.3013-1676042f&X-Plex-Client-Identifier=oti94rrvujjg47wu7cq8df9q&X-Plex-Platform=windows&X-Plex-Platform-Version=10.0.22000&X-Plex-Features=external-media%2Cindirect-media&X-Plex-Model=standalone&X-Plex-Device-Name=SurfaceBook2&X-Plex-Device-Screen-Resolution=1481x858%2C1714x1143&X-Plex-Client-Profile-Name=Plex%20Desktop&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx&X-Plex-Language=en
Jun 08, 2022 00:49:40.011 [10812] ERROR - [MPVEngine/mpv] ffmpeg: tcp: Failed to resolve hostname XXXXXXXXXXX: The name does not resolve for the supplied parameters
Jun 08, 2022 00:49:40.011 [10812] ERROR - [MPVEngine/mpv] stream: Failed to open https:/XXXXXXXXXXX  -----------(I shortened this) 
Jun 08, 2022 00:49:40.011 [10812] DEBUG - [MPVEngine/mpv] cplayer: Opening failed or was aborted: https://XXXXXXXXXXX

Specifically looking at the "ffmpeg: Opening" line, you can see there is a different structure to how the URL is passed through. This seems to be the root causes of resolve error and may need the SVP dev team to recompile the MPV dll for the new Plex URL structure.

Any assistance from the dev team would be appreciated as this is one of the main reasons I have SVP

Re: Plex for Windows does not use SVP

try the latest "official build": https://sourceforge.net/projects/mpv-pl … z/download

Re: Plex for Windows does not use SVP

Hey Chainik,

Using the dll from the build you linked has fixed the problem. Note it is named mpv-2.dll rather than mpv-1.dll but it works fine as it is. Simply removing the mpv-1.dll from the Plex directory and copying the mpv-2.dll in resolves the ffmpeg open error.

Thanks for the help

Re: Plex for Windows does not use SVP

is sets 'resolve_hosts' to help ffmpeg resolve this 'XXXXXXXXXXX.plex.direct'
interesting part is that ffmpeg doesn't have such option ('resolve_hosts') at all big_smile

34 (edited by benj0670 14-06-2022 02:52:33)

Re: Plex for Windows does not use SVP

So I found out something interesting that I will have to dive deeper into. Could be something weird with my network but SVP only works when connecting outside of my network. If I try to watch something while on the same network as my Plex server it errors out and can't resolve. It seems either MPC or SVP don't have local network access as I can pull the URL out of the Plex log and load it up fine in my browser. I can also navigate directly to the server on any device on my local network so it's not a firewall issue. I'm going to try and force both MPC's and SVP's directories open access through the network, will update how it goes.

35 (edited by benj0670 14-06-2022 02:56:29)

Re: Plex for Windows does not use SVP

After some testing, the only thing that seems to work is using a VPN to route out of the local network. Turns out it is just my DNS authority server not resolving the host which is weird as it works fine with the original mpv-1.dll so I will investigate that on my own some more. Just in case it ever helps someone in the future!

Re: Plex for Windows does not use SVP

so does it work with the official mpv build or not?

cause it's possible that the one provided with Plex was patched to add this 'resolve_hosts' option
what it does - it basically replaces xxxxx.plex.direct with just an IP address

Re: Plex for Windows does not use SVP

> Note it is named mpv-2.dll rather than mpv-1.dll but it works fine as it is. Simply removing the mpv-1.dll from the Plex directory and copying the mpv-2.dll in resolves the ffmpeg open error.

hmmm... Plex app doesn't like "mpv-2.dll" at all, it needs "mpv-1.dll".
If you "simply removed the mpv-1.dll from the Plex directory and copied the mpv-2.dll" then Plex uses mpv-1.dll from somewhere else, probably from SVP's directory if you have it in PATH.
And even if I rename mpv-2.dll into mpv-1.dll then it still doesn't work cause built-in SSL is not compatible with Plex.

Jun 14, 2022 17:38:28.879 [104472] ERROR - [MPVEngine/mpv] ffmpeg: tls: mbedtls_ssl_handshake returned -0x2700

Re: Plex for Windows does not use SVP

update SVP now
mpv-1.dll built from the latest mpv sources plus ffmpeg 'resolve_hosts' patch