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

Project IINA Support #144

Closed
jurplel opened this issue Sep 12, 2017 · 25 comments
Closed

Project IINA Support #144

jurplel opened this issue Sep 12, 2017 · 25 comments

Comments

@jurplel
Copy link
Contributor

@jurplel jurplel commented Sep 12, 2017

I'm seeing Mac development on the horizon, and this is my favorite player for Mac. I figured since it was MPV based, it would be easy to support.
https://lhc70000.github.io/iina/

@albertosottile
Copy link
Member

@albertosottile albertosottile commented Sep 14, 2017

Just a preliminary question, do you know if it is possible to control IINA via terminal, as for mpv? I installed it on my system via cask, but did not find any CLI for it.

@jurplel
Copy link
Contributor Author

@jurplel jurplel commented Sep 14, 2017

I'm not actually sure, but I found some relevant issues that might help answer your question.
iina/iina#875
iina/iina#58
streamlink/streamlink-twitch-gui#480
Looking like that's a no but in progress
iina/iina#898

@albertosottile
Copy link
Member

@albertosottile albertosottile commented Sep 14, 2017

Yep, according to the roadmap it has to be implemented yet. I am afraid that until they do that, we have no way to interact with IINA and add support for Syncplay. I guess we just have to wait and then try to adjust our mpv module accordingly.

@albertosottile
Copy link
Member

@albertosottile albertosottile commented Sep 14, 2017

I already read those, as far as I understood there is no way to control the player status after IINA is launched from the command line...

@jurplel
Copy link
Contributor Author

@jurplel jurplel commented Sep 14, 2017

Okay, thanks for your time.

@albertosottile
Copy link
Member

@albertosottile albertosottile commented Sep 14, 2017

Thank you, maybe you could comment again when they release a functional CLI for IINA.

@Et0h
Copy link
Contributor

@Et0h Et0h commented Sep 14, 2017

If it doesn't support terminal (which is what Syncplay currently uses for mpv) does it at least support the mpv JSON IPC protocol ?

@albertosottile
Copy link
Member

@albertosottile albertosottile commented Sep 14, 2017

From here: https://github.com/lhc70000/iina/wiki/Use-SVP-with-IINA it seems that it does, by adding an option in IINA's preferences. I just tried it and obtained a reasonable answer:
echo '{ "command": ["get_property", "playback-time"] }' | socat - /tmp/mpvsocket {"data":499.749000,"error":"success"}

So it should be possible to control IINA with this JSON IPC interface. Unfortunately, the effort required would be much higher than just adjusting the code in mpv.py .

Maybe we could ask @Hamuko to help, it seems that his Sopu client uses JSON IPC to control mpv (https://github.com/Hamuko/Sopu/blob/master/sopu/mediaplayer.py)

@Et0h
Copy link
Contributor

@Et0h Et0h commented Sep 16, 2017

I don't use OSX so it'd definitely need someone to take it up not just to port it over but also to maintain it.

@jurplel
Copy link
Contributor Author

@jurplel jurplel commented Nov 9, 2017

CLI is on the way it seems
iina/iina#1181

@albertosottile
Copy link
Member

@albertosottile albertosottile commented Nov 9, 2017

Great, let's wait for a release. In the meantime, @etoh do we use any --no-* option in mpv.py?

@Et0h
Copy link
Contributor

@Et0h Et0h commented Nov 12, 2017

@jeep70 Great news! 👍

@alby128 We use "no-osd set" to set properties without affecting the OSD, but we don't make use of any command line options which start with --no. Depending on your definition, you could say --input-terminal=no (which we use in Syncplay) is equivalent to --no-input-terminal, but if the problem comes from using the --no prefix style to set variables then that doesn't happen (unless someone manually sets up a --no command in Syncplay player arguments).

On Windows, the default command line options are: ['--force-window', '--idle', '--hr-seek=always', '--keep-open', '--msg-level=all=error,cplayer=info,term-msg=info', '--input-terminal=no', '--input-file=/dev/stdin', '--term-playing-msg=<SyncplayUpdateFile>\nANS_filename=${filename}\nANS_length=${=length:${=duration:0}}\nANS_path=${path}\n</SyncplayUpdateFile>', '--terminal=yes']

@Et0h
Copy link
Contributor

@Et0h Et0h commented Dec 8, 2017

iina/iina#1181 seems to have been merged into the develop branch. Is the IINA develop branch working properly with Syncplay @jeep70 (assuming you change the Syncplay code to detect IINA as mpv)?

@Et0h
Copy link
Contributor

@Et0h Et0h commented Dec 10, 2017

If IINA is now compatible with Syncplay then to add support from Syncplay's side a developer would need to do something like:

  1. Create icon and list it in Py2exe,
  2. Create /players/iina.py which is a subclass of NewMpvPlayer and ensure relevant constants are put in constants.py
  3. Reference the player in other Syncplay code so it shows up and knows where to find the player executable.

See 88113d8 and 117a45b for examples of this being done for MPC-BE.

However, adding support also means testing it and then maintaining compatibility in future versions of the player so I suggest only a dev who regularly uses Syncplay with IINA and is willing to be the long-term IINA lead works on adding initial IINA support to Syncplay.

@jurplel
Copy link
Contributor Author

@jurplel jurplel commented Dec 10, 2017

I can't seem to get syncplay to work from the git - I'm using python2 to open the client and it crashes with global name GraphicalUI is not defined after pressing run syncplay (unmodified code and using stock mpv). I also tried building it with py2app but that just crashes the same way

@albertosottile
Copy link
Member

@albertosottile albertosottile commented Dec 10, 2017

There is something wrong either in the version you downloaded or in your python environment. Please check if you have twisted, appnope, and pyobjc installed. If you are not sure, just run pip2 install twisted appnope pyobjc.

@jurplel
Copy link
Contributor Author

@jurplel jurplel commented Dec 10, 2017

That worked, but using IINA doesn't work with syncplay it seems. I changed the code a little so that every path was accepted for mpv, but it just becomes completely unresponsive after going to the server window. Selecting a file in IINA doesn't do anything. Quitting IINA results in this dialog box
screen shot 2017-12-10 at 2 24 27 pm
This is with the built develop branch of IINA. Terminal Log:

2017-12-10 14:19:41.057 Python[8544:967879] +[NSSegmentedCell(StaticMethods) _image_state_for_visual_state:style:trackingMode:]: Unknown NSSegmentVisualState 0
2017-12-10 14:19:41.057 Python[8544:967879] +[NSSegmentedCell(StaticMethods) _image_state_for_visual_state:style:trackingMode:]: Unknown NSSegmentVisualState 0
2017-12-10 14:19:42.586 Python[8544:967879] +[NSSegmentedCell(StaticMethods) _image_state_for_visual_state:style:trackingMode:]: Unknown NSSegmentVisualState 0
2017-12-10 14:19:42.586 Python[8544:967879] +[NSSegmentedCell(StaticMethods) _image_state_for_visual_state:style:trackingMode:]: Unknown NSSegmentVisualState 0
2017-12-10 14:19:43.465 Python[8544:967879] +[NSSegmentedCell(StaticMethods) _image_state_for_visual_state:style:trackingMode:]: Unknown NSSegmentVisualState 0
2017-12-10 14:19:43.465 Python[8544:967879] +[NSSegmentedCell(StaticMethods) _image_state_for_visual_state:style:trackingMode:]: Unknown NSSegmentVisualState 0
2017-12-10 14:19:46.753 Python[8544:967879] +[NSSegmentedCell(StaticMethods) _image_state_for_visual_state:style:trackingMode:]: Unknown NSSegmentVisualState 0
2017-12-10 14:19:46.753 Python[8544:967879] +[NSSegmentedCell(StaticMethods) _image_state_for_visual_state:style:trackingMode:]: Unknown NSSegmentVisualState 0
2017-12-10 14:19:48.020 Python[8544:967879] +[NSSegmentedCell(StaticMethods) _image_state_for_visual_state:style:trackingMode:]: Unknown NSSegmentVisualState 0
2017-12-10 14:19:48.020 Python[8544:967879] +[NSSegmentedCell(StaticMethods) _image_state_for_visual_state:style:trackingMode:]: Unknown NSSegmentVisualState 0
2017-12-10 14:19:50.615 Python[8544:967879] +[NSSegmentedCell(StaticMethods) _image_state_for_visual_state:style:trackingMode:]: Unknown NSSegmentVisualState 0
2017-12-10 14:19:50.615 Python[8544:967879] +[NSSegmentedCell(StaticMethods) _image_state_for_visual_state:style:trackingMode:]: Unknown NSSegmentVisualState 0
2017-12-10 14:19:52.003 Python[8544:967879] +[NSSegmentedCell(StaticMethods) _image_state_for_visual_state:style:trackingMode:]: Unknown NSSegmentVisualState 0
2017-12-10 14:19:52.003 Python[8544:967879] +[NSSegmentedCell(StaticMethods) _image_state_for_visual_state:style:trackingMode:]: Unknown NSSegmentVisualState 0
2017-12-10 14:19:55.371 Python[8544:967879] +[NSSegmentedCell(StaticMethods) _image_state_for_visual_state:style:trackingMode:]: Unknown NSSegmentVisualState 0
2017-12-10 14:19:55.371 Python[8544:967879] +[NSSegmentedCell(StaticMethods) _image_state_for_visual_state:style:trackingMode:]: Unknown NSSegmentVisualState 0
2017-12-10 14:19:58.171 Python[8544:967879] +[NSSegmentedCell(StaticMethods) _image_state_for_visual_state:style:trackingMode:]: Unknown NSSegmentVisualState 0
2017-12-10 14:19:58.171 Python[8544:967879] +[NSSegmentedCell(StaticMethods) _image_state_for_visual_state:style:trackingMode:]: Unknown NSSegmentVisualState 0
objc[8544]: Class FIFinderSyncExtensionHost is implemented in both /System/Library/PrivateFrameworks/FinderKit.framework/Versions/A/FinderKit (0x7fff97964a70) and /System/Library/PrivateFrameworks/FileProvider.framework/OverrideBundles/FinderSyncCollaborationFileProviderOverride.bundle/Contents/MacOS/FinderSyncCollaborationFileProviderOverride (0x1264cacd8). One of the two will be used. Which one is undefined.
2017-12-10 14:22:05.406 Python[8544:967879] modalSession has been exited prematurely - check for a reentrant call to endModalSession:
2017-12-10 14:23:57.162 IINA[8570:986310] MPV log: [vd] warn: Falling back to software decoding.```
@Et0h
Copy link
Contributor

@Et0h Et0h commented Dec 10, 2017

@jeep70 If you run Syncplay in --debug mode is there anything interesting in the Syncplay<->IINA communication? Have you tried Syncplay in both NewMpvPlayer and OldMpvPlayer modes by changing the run static method in MpvPlayer (mpv.py)?

@jurplel
Copy link
Contributor Author

@jurplel jurplel commented Dec 10, 2017

Just running it in debug mode didn't seem to do anything different, but when i switched the mode check in the run method, I got a different result.

https://hastebin.com/mequgifoni

Everything after modalSession has been exited prematurely showed up after i force quitted IINA. Pretty much everything else is the same. This is what happens when I try using iina-cli

https://hastebin.com/konajasebe

I can't seem to open up the app bundle in syncplay. It should be noted that all of the above shows up immediately and i do not have to do anything to IINA for that to happen.

@Et0h
Copy link
Contributor

@Et0h Et0h commented Dec 14, 2017

Sorry I can't be of any more assistance in figuring this out. Maybe you could try and get an IINA dev to join the effort.

@Et0h
Copy link
Contributor

@Et0h Et0h commented Apr 26, 2018

Syncplay already supports mpv and VLC. If IINA ever adds support for Syncplay then please update this issue, but until then I'm going to consider this matter on pause. Unfortunately I don't have the macOS or programming knowledge to make progress on this, and it would need a dedicated lead to ensure things work from both the IINA and Syncplay side.

@Et0h Et0h closed this Apr 26, 2018
@jurplel
Copy link
Contributor Author

@jurplel jurplel commented Apr 26, 2018

That's reasonable. Thank you for entertaining the idea.

@albertosottile
Copy link
Member

@albertosottile albertosottile commented Dec 6, 2020

Syncplay 1.6.7 will add support for IINA. The first beta of this release is avaliable here: https://github.com/Syncplay/syncplay/releases/tag/v1.6.7-Beta1. Any feedback would be truly appreciated!

@jurplel
Copy link
Contributor Author

@jurplel jurplel commented Dec 8, 2020

Awesome!

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

Successfully merging a pull request may close this issue.

None yet
3 participants