mpv-player / mpv

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

add PID to properties so it can be retrieved via JSON IPC #7562

Closed wis closed 3 years ago

wis commented 4 years ago

shouldn't PID be one of the properties? https://mpv.io/manual/stable/#property-list

Expected behavior of the wanted feature

$ echo '{ "command": ["get_property", "pid"] }' | socat - /tmp/mpvSockets/1234 should work like $ echo '{ "command": ["get_property", "path"] }' | socat - /tmp/mpvSockets/1234 works now: {"data":"/home/user/Music/song.mp3","request_id":0,"error":"success"}

nothing about pids in listed properties with $ echo '{ "command": ["get_property", "property-list"] }' | socat - /tmp/mpvSockets/1234:

{
  "data": [
    "speed",
    "audio-speed-correction",
    "video-speed-correction",
    "display-sync-active",
    "filename",
    "stream-open-filename",
    "file-size",
    "path",
    "media-title",
    "stream-path",
    "current-demuxer",
    "file-format",
    "stream-pos",
    "stream-end",
    "duration",
    "avsync",
    "total-avsync-change",
    "mistimed-frame-count",
    "vsync-ratio",
    "decoder-frame-drop-count",
    "frame-drop-count",
    "vo-delayed-frame-count",
    "percent-pos",
    "time-start",
    "time-pos",
    "time-remaining",
    "audio-pts",
    "playtime-remaining",
    "playback-time",
    "chapter",
    "edition",
    "current-edition",
    "chapters",
    "editions",
    "metadata",
    "filtered-metadata",
    "chapter-metadata",
    "vf-metadata",
    "af-metadata",
    "core-idle",
    "eof-reached",
    "seeking",
    "playback-abort",
    "cache-speed",
    "demuxer-cache-duration",
    "demuxer-cache-time",
    "demuxer-cache-idle",
    "demuxer-start-time",
    "demuxer-cache-state",
    "cache-buffering-state",
    "paused-for-cache",
    "demuxer-via-network",
    "clock",
    "seekable",
    "partially-seekable",
    "idle-active",
    "chapter-list",
    "track-list",
    "edition-list",
    "playlist",
    "playlist-pos",
    "playlist-pos-1",
    "playlist-count",
    "mixer-active",
    "volume",
    "ao-volume",
    "ao-mute",
    "audio-delay",
    "audio-codec-name",
    "audio-codec",
    "audio-params",
    "audio-out-params",
    "aid",
    "audio-device",
    "audio-device-list",
    "current-ao",
    "video-out-params",
    "video-dec-params",
    "video-params",
    "video-format",
    "video-frame-info",
    "video-codec",
    "dwidth",
    "dheight",
    "width",
    "height",
    "current-window-scale",
    "vo-configured",
    "vo-passes",
    "current-vo",
    "container-fps",
    "estimated-vf-fps",
    "video-aspect",
    "video-aspect-override",
    "vid",
    "hwdec-current",
    "hwdec-interop",
    "estimated-frame-count",
    "estimated-frame-number",
    "osd-dimensions",
    "osd-width",
    "osd-height",
    "osd-par",
    "osd-sym-cc",
    "osd-ass-cc",
    "sid",
    "secondary-sid",
    "sub-delay",
    "sub-speed",
    "sub-pos",
    "sub-text",
    "sub-start",
    "sub-end",
    "vf",
    "af",
    "ab-loop-a",
    "ab-loop-b",
    "packet-video-bitrate",
    "packet-audio-bitrate",
    "packet-sub-bitrate",
    "video-bitrate",
    "audio-bitrate",
    "sub-bitrate",
    "display-names",
    "display-fps",
    "estimated-display-fps",
    "vsync-jitter",
    "display-hidpi-scale",
    "working-directory",
    "protocol-list",
    "decoder-list",
    "encoder-list",
    "demuxer-lavf-list",
    "mpv-version",
    "mpv-configuration",
    "ffmpeg-version",
    "options",
    "file-local-options",
    "option-info",
    "property-list",
    "profile-list",
    "command-list",
    "input-bindings",
    "shared-script-properties",
    "video",
    "audio",
    "sub",
    "colormatrix",
    "colormatrix-input-range",
    "colormatrix-primaries",
    "colormatrix-gamma",
    "drop-frame-count",
    "vo-drop-frame-count",
    "include",
    "profile",
    "shuffle",
    "quiet",
    "really-quiet",
    "terminal",
    "msg-level",
    "dump-stats",
    "msg-color",
    "log-file",
    "msg-module",
    "msg-time",
    "config",
    "config-dir",
    "reset-on-next-file",
    "scripts",
    "script-opts",
    "load-scripts",
    "osc",
    "ytdl",
    "ytdl-format",
    "ytdl-raw-options",
    "load-stats-overlay",
    "load-osd-console",
    "bluray-device",
    "frames",
    "start",
    "end",
    "length",
    "play-dir",
    "video-reversal-buffer",
    "audio-reversal-buffer",
    "rebase-start-time",
    "playlist-start",
    "pause",
    "keep-open",
    "keep-open-pause",
    "image-display-duration",
    "index",
    "alang",
    "slang",
    "vlang",
    "track-auto-selection",
    "lavfi-complex",
    "audio-display",
    "hls-bitrate",
    "display-tags",
    "cdrom-device",
    "audio-files",
    "demuxer",
    "audio-demuxer",
    "sub-demuxer",
    "demuxer-thread",
    "demuxer-termination-timeout",
    "demuxer-cache-wait",
    "prefetch-playlist",
    "cache-pause",
    "cache-pause-initial",
    "cache-pause-wait",
    "mf-fps",
    "mf-type",
    "mc",
    "fps",
    "audio-samplerate",
    "audio-channels",
    "audio-format",
    "audio-pitch-correction",
    "af-defaults",
    "vf-defaults",
    "ad",
    "vd",
    "audio-spdif",
    "video-aspect-method",
    "sub-files",
    "sub-file-paths",
    "audio-file-paths",
    "external-files",
    "autoload-files",
    "sub-auto",
    "audio-file-auto",
    "osd-bar",
    "audio-exclusive",
    "audio-fallback-to-null",
    "audio-stream-silence",
    "audio-wait-open",
    "force-window",
    "volume-max",
    "mute",
    "replaygain",
    "replaygain-preamp",
    "replaygain-clip",
    "replaygain-fallback",
    "gapless-audio",
    "title",
    "force-media-title",
    "video-rotate",
    "cursor-autohide",
    "cursor-autohide-fs-only",
    "stop-screensaver",
    "use-filedir-conf",
    "osd-level",
    "osd-on-seek",
    "osd-duration",
    "osd-fractions",
    "sstep",
    "framedrop",
    "video-latency-hacks",
    "untimed",
    "stream-dump",
    "stop-playback-on-init-failure",
    "loop-playlist",
    "loop-file",
    "loop",
    "resume-playback",
    "resume-playback-check-mtime",
    "save-position-on-quit",
    "write-filename-in-watch-later-config",
    "ignore-path-in-watch-later-config",
    "watch-later-directory",
    "ordered-chapters",
    "ordered-chapters-files",
    "chapter-merge-threshold",
    "chapter-seek-threshold",
    "chapters-file",
    "merge-files",
    "correct-pts",
    "initial-audio-sync",
    "video-sync",
    "video-sync-max-video-change",
    "video-sync-max-audio-change",
    "video-sync-adrop-size",
    "hr-seek",
    "hr-seek-demuxer-offset",
    "hr-seek-framedrop",
    "autosync",
    "term-osd",
    "term-osd-bar",
    "term-osd-bar-chars",
    "term-playing-msg",
    "osd-playing-msg",
    "term-status-msg",
    "osd-status-msg",
    "osd-msg1",
    "osd-msg2",
    "osd-msg3",
    "video-osd",
    "idle",
    "input-terminal",
    "input-file",
    "input-ipc-server",
    "screenshot-template",
    "screenshot-directory",
    "record-file",
    "cuda-decode-device",
    "aspect",
    "ass",
    "audiofile",
    "cursor-autohide-delay",
    "delay",
    "dvdangle",
    "endpos",
    "font",
    "forcedsubsonly",
    "format",
    "lua",
    "lua-opts",
    "mouse-movements",
    "msgcolor",
    "msgmodule",
    "name",
    "osdlevel",
    "playing-msg",
    "spugauss",
    "srate",
    "ss",
    "stop-xscreensaver",
    "sub-fuzziness",
    "subcp",
    "subdelay",
    "subfile",
    "subfont-text-scale",
    "subfont",
    "subfps",
    "subpos",
    "media-keys",
    "right-alt-gr",
    "autosub",
    "autosub-match",
    "status-msg",
    "idx",
    "forceidx",
    "mkv-subtitle-preroll",
    "ass-use-margins",
    "input-unix-socket",
    "softvol-max",
    "sub-text-font",
    "sub-text-font-size",
    "sub-text-color",
    "sub-text-border-color",
    "sub-text-shadow-color",
    "sub-text-back-color",
    "sub-text-border-size",
    "sub-text-shadow-offset",
    "sub-text-spacing",
    "sub-text-margin-x",
    "sub-text-margin-y",
    "sub-text-align-x",
    "sub-text-align-y",
    "sub-text-blur",
    "sub-text-bold",
    "sub-text-italic",
    "ass-line-spacing",
    "ass-force-margins",
    "ass-vsfilter-aspect-compat",
    "ass-vsfilter-color-compat",
    "ass-vsfilter-blur-compat",
    "ass-force-style",
    "ass-styles",
    "ass-hinting",
    "ass-shaper",
    "ass-style-override",
    "ass-scale-with-window",
    "sub-ass-style-override",
    "sub-paths",
    "dvd-device",
    "dvd-speed",
    "dvd-angle",
    "cdda-speed",
    "cdda-paranoia",
    "cdda-sector-size",
    "cdda-overlap",
    "cdda-toc-bias",
    "cdda-toc-offset",
    "cdda-skip",
    "cdda-span",
    "cdda-cdtext",
    "dvbin-prog",
    "dvbin-card",
    "dvbin-timeout",
    "dvbin-file",
    "dvbin-full-transponder",
    "dvbin-channel-switch-offset",
    "stream-lavf-o",
    "http-header-fields",
    "user-agent",
    "referrer",
    "cookies",
    "cookies-file",
    "tls-verify",
    "tls-ca-file",
    "tls-cert-file",
    "tls-key-file",
    "network-timeout",
    "http-proxy",
    "deinterlace",
    "vd-lavc-fast",
    "vd-lavc-show-all",
    "vd-lavc-skiploopfilter",
    "vd-lavc-skipidct",
    "vd-lavc-skipframe",
    "vd-lavc-framedrop",
    "vd-lavc-threads",
    "vd-lavc-bitexact",
    "vd-lavc-assume-old-x264",
    "vd-lavc-check-hw-profile",
    "vd-lavc-software-fallback",
    "vd-lavc-o",
    "vd-lavc-dr",
    "hwdec",
    "hwdec-codecs",
    "hwdec-image-format",
    "hwdec-extra-frames",
    "ad-lavc-ac3drc",
    "ad-lavc-downmix",
    "ad-lavc-threads",
    "ad-lavc-o",
    "demuxer-lavf-probesize",
    "demuxer-lavf-probe-info",
    "demuxer-lavf-format",
    "demuxer-lavf-analyzeduration",
    "demuxer-lavf-buffersize",
    "demuxer-lavf-allow-mimetype",
    "demuxer-lavf-probescore",
    "demuxer-lavf-hacks",
    "demuxer-lavf-o",
    "sub-codepage",
    "rtsp-transport",
    "demuxer-lavf-linearize-timestamps",
    "demuxer-lavf-propagate-opts",
    "demuxer-rawaudio-channels",
    "demuxer-rawaudio-rate",
    "demuxer-rawaudio-format",
    "demuxer-rawvideo-w",
    "demuxer-rawvideo-h",
    "demuxer-rawvideo-format",
    "demuxer-rawvideo-mp-format",
    "demuxer-rawvideo-codec",
    "demuxer-rawvideo-fps",
    "demuxer-rawvideo-size",
    "demuxer-mkv-subtitle-preroll",
    "demuxer-mkv-subtitle-preroll-secs",
    "demuxer-mkv-subtitle-preroll-secs-index",
    "demuxer-mkv-probe-video-duration",
    "demuxer-mkv-probe-start-time",
    "demuxer-cue-codepage",
    "sub-fps",
    "sub-visibility",
    "sub-forced-only",
    "stretch-dvd-subs",
    "stretch-image-subs-to-screen",
    "image-subs-video-resolution",
    "sub-fix-timing",
    "sub-gauss",
    "sub-gray",
    "sub-ass",
    "sub-filter-sdh",
    "sub-filter-sdh-harder",
    "sub-scale",
    "sub-ass-line-spacing",
    "sub-use-margins",
    "sub-ass-force-margins",
    "sub-ass-vsfilter-aspect-compat",
    "sub-ass-vsfilter-color-compat",
    "sub-ass-vsfilter-blur-compat",
    "embeddedfonts",
    "sub-ass-force-style",
    "sub-ass-styles",
    "sub-ass-hinting",
    "sub-ass-shaper",
    "sub-ass-justify",
    "sub-ass-override",
    "sub-scale-by-window",
    "sub-scale-with-window",
    "sub-ass-scale-with-window",
    "sub-clear-on-seek",
    "teletext-page",
    "sub-font",
    "sub-font-size",
    "sub-color",
    "sub-border-color",
    "sub-shadow-color",
    "sub-back-color",
    "sub-border-size",
    "sub-shadow-offset",
    "sub-spacing",
    "sub-margin-x",
    "sub-margin-y",
    "sub-align-x",
    "sub-align-y",
    "sub-blur",
    "sub-bold",
    "sub-italic",
    "sub-justify",
    "sub-font-provider",
    "osd-bar-align-x",
    "osd-bar-align-y",
    "osd-bar-w",
    "osd-bar-h",
    "osd-scale",
    "osd-scale-by-window",
    "force-rgba-osd-rendering",
    "osd-font",
    "osd-font-size",
    "osd-color",
    "osd-border-color",
    "osd-shadow-color",
    "osd-back-color",
    "osd-border-size",
    "osd-shadow-offset",
    "osd-spacing",
    "osd-margin-x",
    "osd-margin-y",
    "osd-align-x",
    "osd-align-y",
    "osd-blur",
    "osd-bold",
    "osd-italic",
    "osd-justify",
    "osd-font-provider",
    "ao",
    "audio-client-name",
    "audio-buffer",
    "pulse-host",
    "pulse-buffer",
    "pulse-latency-hacks",
    "pulse-allow-suspended",
    "alsa-resample",
    "alsa-mixer-device",
    "alsa-mixer-name",
    "alsa-mixer-index",
    "alsa-non-interleaved",
    "alsa-ignore-chmap",
    "alsa-buffer-time",
    "alsa-periods",
    "oss-mixer-device",
    "oss-mixer-channel",
    "jack-port",
    "jack-name",
    "jack-autostart",
    "jack-connect",
    "jack-std-channel-layout",
    "ao-null-untimed",
    "ao-null-buffer",
    "ao-null-outburst",
    "ao-null-speed",
    "ao-null-latency",
    "ao-null-broken-eof",
    "ao-null-broken-delay",
    "ao-null-channel-layouts",
    "ao-null-format",
    "ao-pcm-file",
    "ao-pcm-waveheader",
    "ao-pcm-append",
    "brightness",
    "saturation",
    "contrast",
    "hue",
    "gamma",
    "video-output-levels",
    "screenshot-format",
    "screenshot-jpeg-quality",
    "screenshot-jpeg-source-chroma",
    "screenshot-png-compression",
    "screenshot-png-filter",
    "screenshot-webp-lossless",
    "screenshot-webp-quality",
    "screenshot-webp-compression",
    "screenshot-high-bit-depth",
    "screenshot-tag-colorspace",
    "audio-resample-filter-size",
    "audio-resample-phase-shift",
    "audio-resample-linear",
    "audio-resample-cutoff",
    "audio-normalize-downmix",
    "audio-resample-max-output-size",
    "audio-swresample-o",
    "input-conf",
    "input-ar-delay",
    "input-ar-rate",
    "input-default-bindings",
    "input-test",
    "input-doubleclick-time",
    "input-right-alt-gr",
    "input-key-fifo-size",
    "input-cursor",
    "input-vo-keyboard",
    "input-media-keys",
    "window-dragging",
    "input-x11-keyboard",
    "vo",
    "taskbar-progress",
    "snap-window",
    "ontop",
    "ontop-level",
    "border",
    "fit-border",
    "on-all-workspaces",
    "geometry",
    "autofit",
    "autofit-larger",
    "autofit-smaller",
    "window-scale",
    "window-minimized",
    "window-maximized",
    "force-window-position",
    "x11-name",
    "monitoraspect",
    "monitorpixelaspect",
    "fullscreen",
    "fs",
    "native-keyrepeat",
    "panscan",
    "video-zoom",
    "video-pan-x",
    "video-pan-y",
    "video-align-x",
    "video-align-y",
    "video-margin-ratio-left",
    "video-margin-ratio-right",
    "video-margin-ratio-top",
    "video-margin-ratio-bottom",
    "video-unscaled",
    "wid",
    "screen",
    "fs-screen",
    "keepaspect",
    "keepaspect-window",
    "hidpi-window-scale",
    "native-fs",
    "override-display-fps",
    "video-timing-offset",
    "x11-netwm",
    "x11-bypass-compositor",
    "swapchain-depth",
    "gpu-context",
    "gpu-api",
    "gpu-debug",
    "gpu-sw",
    "vo-vdpau-deint",
    "vo-vdpau-chroma-deint",
    "vo-vdpau-pullup",
    "vo-vdpau-denoise",
    "vo-vdpau-sharpen",
    "vo-vdpau-hqscaling",
    "vo-vdpau-fps",
    "vo-vdpau-composite-detect",
    "vo-vdpau-queuetime-windowed",
    "vo-vdpau-queuetime-fs",
    "vo-vdpau-output-surfaces",
    "vo-vdpau-colorkey",
    "vo-vdpau-force-yuv",
    "xv-port",
    "xv-adaptor",
    "xv-ck",
    "xv-ck-method",
    "xv-colorkey",
    "xv-buffers",
    "vo-vaapi-scaling",
    "vo-vaapi-scaled-osd",
    "vo-null-fps",
    "vo-image-outdir",
    "vo-image-format",
    "vo-image-jpeg-quality",
    "vo-image-jpeg-source-chroma",
    "vo-image-png-compression",
    "vo-image-png-filter",
    "vo-image-webp-lossless",
    "vo-image-webp-quality",
    "vo-image-webp-compression",
    "vo-image-high-bit-depth",
    "vo-image-tag-colorspace",
    "vo-tct-algo",
    "vo-tct-width",
    "vo-tct-height",
    "vo-tct-256",
    "drm-connector",
    "drm-mode",
    "drm-atomic",
    "drm-draw-plane",
    "drm-drmprime-video-plane",
    "drm-format",
    "drm-draw-surface-size",
    "drm-osd-plane-id",
    "drm-video-plane-id",
    "drm-osd-size",
    "cache",
    "cache-on-disk",
    "demuxer-readahead-secs",
    "demuxer-max-bytes",
    "demuxer-max-back-bytes",
    "force-seekable",
    "cache-secs",
    "access-references",
    "demuxer-seekable-cache",
    "sub-create-cc-track",
    "stream-record",
    "video-backward-overlap",
    "audio-backward-overlap",
    "video-backward-batch",
    "audio-backward-batch",
    "demuxer-backward-playback-step",
    "metadata-codepage",
    "rar-list-all-volumes",
    "cache-dir",
    "cache-unlink-files",
    "stream-buffer-size",
    "load-unsafe-playlists",
    "gpu-dumb-mode",
    "gamma-factor",
    "gamma-auto",
    "target-prim",
    "target-trc",
    "target-peak",
    "tone-mapping",
    "hdr-compute-peak",
    "hdr-peak-decay-rate",
    "hdr-scene-threshold-low",
    "hdr-scene-threshold-high",
    "tone-mapping-param",
    "tone-mapping-max-boost",
    "tone-mapping-desaturate",
    "tone-mapping-desaturate-exponent",
    "gamut-warning",
    "opengl-pbo",
    "scale",
    "scale-param1",
    "scale-param2",
    "scale-blur",
    "scale-cutoff",
    "scale-taper",
    "scale-wparam",
    "scale-wblur",
    "scale-wtaper",
    "scale-clamp",
    "scale-radius",
    "scale-antiring",
    "scale-window",
    "dscale",
    "dscale-param1",
    "dscale-param2",
    "dscale-blur",
    "dscale-cutoff",
    "dscale-taper",
    "dscale-wparam",
    "dscale-wblur",
    "dscale-wtaper",
    "dscale-clamp",
    "dscale-radius",
    "dscale-antiring",
    "dscale-window",
    "cscale",
    "cscale-param1",
    "cscale-param2",
    "cscale-blur",
    "cscale-cutoff",
    "cscale-taper",
    "cscale-wparam",
    "cscale-wblur",
    "cscale-wtaper",
    "cscale-clamp",
    "cscale-radius",
    "cscale-antiring",
    "cscale-window",
    "tscale",
    "tscale-param1",
    "tscale-param2",
    "tscale-blur",
    "tscale-cutoff",
    "tscale-taper",
    "tscale-wparam",
    "tscale-wblur",
    "tscale-wtaper",
    "tscale-clamp",
    "tscale-radius",
    "tscale-antiring",
    "tscale-window",
    "scaler-lut-size",
    "scaler-resizes-only",
    "correct-downscaling",
    "linear-downscaling",
    "linear-upscaling",
    "sigmoid-upscaling",
    "sigmoid-center",
    "sigmoid-slope",
    "fbo-format",
    "dither-depth",
    "dither",
    "dither-size-fruit",
    "temporal-dither",
    "temporal-dither-period",
    "error-diffusion",
    "alpha",
    "opengl-rectangle-textures",
    "background",
    "interpolation",
    "interpolation-threshold",
    "blend-subtitles",
    "glsl-shaders",
    "deband",
    "sharpen",
    "gpu-tex-pad-x",
    "gpu-tex-pad-y",
    "gpu-shader-cache-dir",
    "gpu-hwdec-interop",
    "opengl-hwdec-interop",
    "hwdec-preload",
    "hdr-tone-mapping",
    "opengl-shaders",
    "opengl-shader",
    "opengl-shader-cache-dir",
    "opengl-tex-pad-x",
    "opengl-tex-pad-y",
    "opengl-fbo-format",
    "opengl-dumb-mode",
    "opengl-gamma",
    "deband-iterations",
    "deband-threshold",
    "deband-range",
    "deband-grain",
    "use-embedded-icc-profile",
    "icc-profile",
    "icc-profile-auto",
    "icc-cache-dir",
    "icc-intent",
    "icc-contrast",
    "icc-3dlut-size",
    "3dlut-size",
    "spirv-compiler",
    "opengl-glfinish",
    "opengl-waitvsync",
    "opengl-swapinterval",
    "opengl-check-pattern",
    "opengl-restrict",
    "opengl-es",
    "opengl-early-flush",
    "opengl-debug",
    "opengl-sw",
    "opengl-vsync-fences",
    "opengl-backend",
    "vulkan-device",
    "vulkan-swap-mode",
    "vulkan-queue-count",
    "vulkan-async-transfer",
    "vulkan-async-compute",
    "wayland-frame-wait-offset",
    "wayland-disable-vsync",
    "wayland-edge-pixels-pointer",
    "vaapi-device",
    "sws-scaler",
    "sws-lgb",
    "sws-cgb",
    "sws-cvs",
    "sws-chs",
    "sws-ls",
    "sws-cs",
    "sws-fast",
    "sws-bitexact",
    "sws-allow-zimg",
    "o",
    "of",
    "ofopts",
    "ovc",
    "ovcopts",
    "oac",
    "oacopts",
    "ovoffset",
    "oaoffset",
    "orawts",
    "ovfirst",
    "oafirst",
    "ocopy-metadata",
    "oset-metadata",
    "oremove-metadata"
  ],
  "request_id": 0,
  "error": "success"
}
Akemi commented 3 years ago

~added with #5245~ okay only available through scripting but not as a property.