mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.74k stars 2.93k forks source link

JSON IPC - get_property geometry #5426

Closed krlklm closed 6 years ago

krlklm commented 6 years ago

mpv version and ffmpeg version

mpv 0.27.0 (C) 2000-2017 mpv/MPlayer/mplayer2 projects built on Fri Jan 5 13:35:23 GMT 2018 ffmpeg library versions: libavutil 55.78.100 libavcodec 57.107.100 libavformat 57.83.100 libswscale 4.8.100 libavfilter 6.107.100 libswresample 2.9.100 ffmpeg version: 3.4.1

Platform

Mac OS 10.11.6 El Capitan

Reproduction steps

Expected behavior

When sending echo '{ "command": ["get_property", "geometry"] }' | socat - /tmp/mpvsocket1 in the CLI it should output the current geometry of the window (size, position x, position y) after it was dragged and resized with the mouse.

Actual behavior

The CLI outputs the size and position of the movie window when it was created, not the current values.

(I do get the current value of the volume setting when i use 'get_property volume' instead of 'get_property geometry')

Log file

http://www.dienststelle.de/projekte/2017/videoplayer/mpv/output.log

Akemi commented 6 years ago

from our side this is expected behaviour, as in this wasn't meant to work. if you just need the size of the window there are the dwidth and dheight properties, i believe.

do you need the (new) position? also what is your use-case?

krlklm commented 6 years ago

Thanks for the hint with dwith and dheight. Yes, I would need the new position as well.

Use case:

This is for an art installation. Several movies should open and play at predefined positions and window sizes over time. The score will be run by Ableton Live (www.ableton.com). Audio loops in Ableton live will be synchronised to video loops with IINA (https://github.com/lhc70000/iina), which is based on mpv. We are using IINA instead of mpv, as the windows should look like regular QuickTime Player windows. The IINA player will be controlled via a Max4Live instrument / patch that can send commands via CLI (www.ableton.com/en/live/max-for-live/).

For a convenient way to design the layout of the score over time it would be good (or even necessary) to be able to drag the movie windows, resize them and then get these values to store them.

Ideally we could even control the position and size of the windows after creation, but I learned that this is not possible (at least at the moment).

Thanks!

Akemi commented 6 years ago

then you should open an issue on the iina issue tracker, since iina controls window size and position in that case. mpv only knows about the size in this case since it needs to know the size of the rendering surface.

so even if we add support for it, it most likely won't work with iina (at first). since they also, most likely, need to support that mechanism, if they even would want that.

it's a duplicate of #3872.

krlklm commented 6 years ago

Collider Li from IINA just answered:

IINA is ready for it. Once mpv implemented this feature, we'll update IINA accordingly.

Would you be able to implement requesting the current window size and position via JSON IPC? Thanks!