Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS support #18

Closed
theg00s3 opened this issue Feb 17, 2020 · 16 comments
Closed

MacOS support #18

theg00s3 opened this issue Feb 17, 2020 · 16 comments

Comments

@theg00s3
Copy link
Contributor

I've tried to compile this on my mac, but it doesn't seem to work. I was wondering if anyone had gotten this working on Mac.

@iwalton3
Copy link
Member

Do you have any error messages or stack traces from attempting to run this? I just responded to another user about trying to test this. I don't have a mac to test on, but I can help anyone who has one to get it working.

@theg00s3
Copy link
Contributor Author

theg00s3 commented Feb 17, 2020

This is the log from Jellyfin:

[2020-02-18 00:42:43.219 +11:00] [INF] User policy for "Nikila". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[2020-02-18 00:42:43.219 +11:00] [INF] Bitrate exceeds DirectPlay limit: media bitrate: 10248170, max bitrate: 8000000
[2020-02-18 00:42:43.219 +11:00] [INF] Profile: "Jellyfin MPV Shim", Path: "/media/windows/TV/Brooklyn Nine-Nine/Season 7/Brooklyn Nine-Nine - S07E03 - Pimento WEBDL-1080p.mkv", isEligibleForDirectPlay: False, isEligibleForDirectStream: True
[2020-02-18 00:42:43.219 +11:00] [INF] Bitrate exceeds DirectPlay limit: media bitrate: 10248170, max bitrate: 8000000
[2020-02-18 00:42:43.219 +11:00] [INF] Profile: "Jellyfin MPV Shim", Path: "/media/windows/TV/Brooklyn Nine-Nine/Season 7/Brooklyn Nine-Nine - S07E03 - Pimento WEBDL-1080p.mkv", isEligibleForDirectPlay: False, isEligibleForDirectStream: True
[2020-02-18 00:42:43.219 +11:00] [INF] Bitrate exceeds DirectPlay limit: media bitrate: 10248170, max bitrate: 8000000
[2020-02-18 00:42:43.219 +11:00] [INF] Profile: "Jellyfin MPV Shim", Path: "/media/windows/TV/Brooklyn Nine-Nine/Season 7/Brooklyn Nine-Nine - S07E03 - Pimento WEBDL-1080p.mkv", isEligibleForDirectPlay: False, isEligibleForDirectStream: True

This is the log from shim:

2020-02-18 00:42:31,538 [    INFO] tryConnect url: https://[URL goes here]/system/info/public
2020-02-18 00:42:31,544 [   DEBUG] Starting new HTTPS connection (1): [URL goes here]:443
2020-02-18 00:42:31,574 [   DEBUG] https://[URL goes here]:443 "GET /system/info/public HTTP/1.1" 200 None
2020-02-18 00:42:31,577 [    INFO] calling onSuccessfulConnection with server Berry2
2020-02-18 00:42:31,579 [   DEBUG] Starting new HTTPS connection (1): [URL goes here]:443
2020-02-18 00:42:31,607 [   DEBUG] https://[URL goes here]:443 "GET /System/Info HTTP/1.1" 200 None
2020-02-18 00:42:31,610 [   DEBUG] credentialsupdated
2020-02-18 00:42:31,610 [   DEBUG] resolving connectToServers with result['State']: {'Servers': [{'address': 'https://[URL goes here]', 'Name': 'Berry2', 'Id': 'ae29528ec10a44d1ab3383a599ee6db7', 'DateLastAccessed': '2020-02-18T00:42:31Z', 'UserId': 'f5acdb6693bd43a5b4954e8ccd980b05', 'AccessToken': '388078d2d7d340ccaa5609dbb850c729', 'Users': [{'Id': 'f5acdb6693bd43a5b4954e8ccd980b05', 'IsSignedInOffline': True}], 'uuid': '20a03e4a-8ceb-4488-8458-1134c8dc8407', 'username': 'nikila', 'connected': True}], 'State': 3}
2020-02-18 00:42:31,610 [    INFO] User is authenticated.
2020-02-18 00:42:31,610 [   DEBUG] Converted retries value: 3 -> Retry(total=3, connect=None, read=None, redirect=None, status=None)
2020-02-18 00:42:31,610 [   DEBUG] Converted retries value: 3 -> Retry(total=3, connect=None, read=None, redirect=None, status=None)
2020-02-18 00:42:31,610 [    INFO] Websocket url: wss://[URL goes here]/socket?api_key=388078d2d7d340ccaa5609dbb850c729&device_id=550b2135-7c71-4683-8dac-9ba208012333
2020-02-18 00:42:31,612 [   DEBUG] Starting new HTTPS connection (1): [URL goes here]:443
2020-02-18 00:42:31,645 [    INFO] --->[ websocket ]
2020-02-18 00:42:31,645 [   DEBUG] Unhandled Event WebSocketConnect: None
2020-02-18 00:42:31,648 [   DEBUG] https://[URL goes here]:443 "POST /Sessions/Capabilities/Full HTTP/1.1" 204 0
2020-02-18 00:42:42,181 [   DEBUG] Handled Event Play: {'Id': '83ed1a3e4fd48c03fbf4da4dee4bb151', 'ItemIds': ['4131bf900574d7f08dfb93bbc317fcc8'], 'PlayCommand': 'PlayNow', 'ControllingUserId': 'f5acdb6693bd43a5b4954e8ccd980b05', 'ServerId': 'ae29528ec10a44d1ab3383a599ee6db7'}
2020-02-18 00:42:42,189 [   DEBUG] https://[URL goes here]:443 "GET /Users/f5acdb6693bd43a5b4954e8ccd980b05/Items/4131bf900574d7f08dfb93bbc317fcc8 HTTP/1.1" 200 None
2020-02-18 00:42:43,229 [   DEBUG] EventHandler::playMedia <jellyfin_mpv_shim.media.Media object at 0x1090cc370>
2020-02-18 00:42:43,236 [   DEBUG] https://[URL goes here]:443 "POST /Items/4131bf900574d7f08dfb93bbc317fcc8/PlaybackInfo HTTP/1.1" 200 None

I installed mpv-shim from pip

@iwalton3
Copy link
Member

It looks like it is trying to transcode the file you are playing due to bitrate. That should just work, but it does make me wonder if the file plays via the web client. It looks like it is retrieving the file metadata, but then it doesn't actually play. I know that if mpv fails to play a file it doesn't send any error messages currently.

How did you install MPV? Did you install it via the mpv brew package or did you install libmpv1?

@theg00s3
Copy link
Contributor Author

The mpv brew package

@iwalton3
Copy link
Member

iwalton3 commented Feb 17, 2020

Ok. Can you test with a file with a lower bitrate that don't require transcoding? Although the player should work for transcoded files as well.

One other thing you can do to test is run MPV externally. Set the config file to use these settings:

    "mpv_ext": true,
    "mpv_ext_ipc": "/tmp/mpv-socket",
    "mpv_ext_path": null,
    "mpv_ext_start": false,

Then run MPV in the command line like this:

mpv --input-ipc-server=/tmp/mpv-socket --idle

After starting MPV, run the MPV Shim program. That should print any errors from MPV if there are any.

@theg00s3
Copy link
Contributor Author

theg00s3 commented Feb 17, 2020

MPV doesn't throw any errors. It seems that mpv-shim isn't sending anything to mpv, as mpv's verbose logs don't show anything happening after startup.

Update:
Using the external mpv does work. My config wasn't working because I somehow excluded the quotation marks around /tmp/mpv-socket.

@iwalton3
Copy link
Member

iwalton3 commented Feb 17, 2020

EDIT: Based on the edit you should be able to disregard this.

It is very possible that the MPV communications library itself isn't working. To rule that out, could you run this python script?

#!/usr/bin/env python3
import python_mpv_jsonipc
import time

mpv = python_mpv_jsonipc.MPV()
mpv.play("http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4")

time.sleep(300)

If this doesn't work, then it means it is a problem with the MPV library (which I also maintain) and if it does work, it means it is a problem with the MPV Shim.

@theg00s3
Copy link
Contributor Author

That python script works

@iwalton3
Copy link
Member

Using the external mpv does work. My config wasn't working because I somehow excluded the quotation marks around /tmp/mpv-socket.

Yeah, that would do it. I still wonder why it doesn't work by default. Does it work with this config?

    "mpv_ext": true,
    "mpv_ext_ipc": null,
    "mpv_ext_path": null,
    "mpv_ext_start": true,

Additionally, what happens when you run this:

#!/usr/bin/env python3
import mpv
import time

player = mpv.MPV()
player.play("http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4")

time.sleep(300)

@theg00s3
Copy link
Contributor Author

That config works.
Nothing seems to happen when I run that

@iwalton3
Copy link
Member

And that would be the problem. I use python-mpv as the default backend for playing media. So if it is silently failing on Mac OSX, then the entire application will silently fail.

I'm going to change the default playback backend to the external one for OSX. I'd like to provide some basic instructions for how to install this on OSX.

Did you have to do anything aside from install brew, python3, mpv, and this program? Does the system tray icon work, or are you using the cli version? If you are using the system tray GUI, did you have to install tkinter separately?

@theg00s3
Copy link
Contributor Author

theg00s3 commented Feb 17, 2020

Did you have to do anything aside from install brew, python3, mpv, and this program?

Nope.

I'm using the cli version
I got the gui and the system tray working. pystray was installed using the linux instructions, and tkinter was install with brew install tcl-tk . Because my python was installed using pyenv, I had to run FLAGS="-I$(brew --prefix tcl-tk)/include" pyenv install 3.8.1 to get tkinter working

@iwalton3
Copy link
Member

iwalton3 commented Feb 17, 2020

It looks like the GUI isn’t easily installable on OSX. https://stackoverflow.com/a/48737927

I’ll make an update that changes the default OSX backend and post instructions for the cli version both versions.

@iwalton3
Copy link
Member

Version1.3.8 has been release with the default player backend changed for OSX. I posted installation instructions here: https://github.com/iwalton3/jellyfin-mpv-shim/blob/master/README.md#osx-installation

Please let me know if there are any issues with the procedure, as I cannot test it.

@theg00s3
Copy link
Contributor Author

theg00s3 commented Feb 17, 2020

It looks right to me

@iwalton3
Copy link
Member

Regarding the issue with python-mpv, it looks like it is a known issue: jaseg/python-mpv#61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants