ユーザ用ツール

サイト用ツール


サイドバー

最新の10件
一覧
linux:debian:bullseye:playerctl

playerctl

動画プレイヤーを操作するコマンド

利用例

(すべての)プレイヤーを探す

$ playerctl -l
$ playerctl --list-all

(すべての)プレイヤーを一時停止

$ playerctl pause

(すべての)プレイヤーを再生

$ playerctl play

(すべての)プレイヤーを再生/一時停止トルグ(再生中だと一時停止,一時停止だと再生)

$ playerctl play-pause

特定のプレイヤーの操作(-p/–player)

$ playerctl --player=mpv -l
$ playerctl -p vlc -l

再生状況確認(s)

$ playerctl position 
1023.474151

30秒戻す(-),30秒進める(+)

$ playerctl position 30-
$ playerctl position 30+

指定時間に移動

$ playerctl position 90

usage

Usage:
  playerctl [OPTION…] COMMAND - Controller for media players

  For players supporting the MPRIS D-Bus specification

Help Options:
  -h, --help                     Show help options

Application Options:
  -p, --player=NAME              A comma separated list of names of players to control (default: the first available player)
  -a, --all-players              Select all available players to be controlled
  -i, --ignore-player=IGNORE     A comma separated list of names of players to ignore.
  -f, --format                   A format string for printing properties and metadata
  -F, --follow                   Block and append the query to output when it changes for the most recently updated player.
  -l, --list-all                 List the names of running players that can be controlled
  -s, --no-messages              Suppress diagnostic messages
  -v, --version                  Print version information

Available Commands:
  play                    Command the player to play
  pause                   Command the player to pause
  play-pause              Command the player to toggle between play/pause
  stop                    Command the player to stop
  next                    Command the player to skip to the next track
  previous                Command the player to skip to the previous track
  position [OFFSET][+/-]  Command the player to go to the position or seek forward/backward OFFSET in seconds
  volume [LEVEL][+/-]     Print or set the volume to LEVEL from 0.0 to 1.0
  status                  Get the play status of the player
  metadata [KEY...]       Print metadata information for the current track. If KEY is passed,
                          print only those values. KEY may be artist,title, album, or any key found in the metadata.
  open [URI]              Command for the player to open given URI.
                          URI can be either file path or remote URL.
  loop [STATUS]           Print or set the loop status.
                          Can be "None", "Track", or "Playlist".
  shuffle [STATUS]        Print or set the shuffle status.
                          Can be "On", "Off", or "Toggle".

mpvを検出できない

$ playerctl -a -l
No players found
$ pgrep mpv
463413
$ playerctl --version
v2.3.1
$ dpkg-query -W playerctl
playerctl       2.3.1-1

はじめplayerctl のversion が古いせいかと思ったが, /usr/share/doc/playerctl/changelog.Debian.gz を見るとちょうど 2.3.1-1 で対応ししたよう

playerctl (2.3.1-1) unstable; urgency=medium
  :
  * d/control:
  :
    - Add mpv to list of controllable players
  :

issue を見るとmpv に mpv-mpris plugin が必要なよう.

Debian pkg にmpv-mpris があるがbullseye-backports から.

$ rmadison mpv-mpris
mpv-mpris  | 0.7.1-1~bpo11+1 | bullseye-backports       | source, amd64, arm64, armel, armhf, i386, mips64el, mipsel, ppc64el, s390x
mpv-mpris  | 0.7.1-1~bpo11+1 | bullseye-backports-debug | source
mpv-mpris  | 0.7.1-1         | stable                   | source, amd64, arm64, armel, armhf, i386, mips64el, mipsel, ppc64el, s390x
mpv-mpris  | 0.7.1-1         | testing                  | source, amd64, arm64, armel, armhf, i386, mips64el, ppc64el, s390x
mpv-mpris  | 0.7.1-1         | unstable                 | source, amd64, arm64, armel, armhf, i386, mips64el, mipsel, ppc64el, s390x
mpv-mpris  | 0.7.1-1         | unstable-debug           | source

bullseye x8664 の場合 hoyon/mpv\-mpris: MPRIS plugin for mpv から最新の mpris.so を入手して ~/.config/mpv/scripts に置く.(システムワイドの場合は /etc/mpv/scripts )
※x86
64 以外のarchtecture だとセルフビルドするかbullseye-backports から導入( sudo apt install mpv-mpris のみ )

$ mkdir -p ~/.config/mpv/scripts
$ wget https://github.com/hoyon/mpv-mpris/releases/latest/download/mpris.so -O ~/.config/mpv/scripts/mpris.so

この後に実行したmpv からplayerctl で検出できるようになった.

$ playerctl -l
mpv

コメント

コメントを入力. Wiki文法が有効です:
  _   __   ___    __  ___   _  __     __
 | | / /  / _ \  /  |/  /  / |/ / __ / /
 | |/ /  / ___/ / /|_/ /  /    / / // / 
 |___/  /_/    /_/  /_/  /_/|_/  \___/
 
linux/debian/bullseye/playerctl.txt · 最終更新: 2023/08/18 06:15 by matoken