0

I want to use emms to play video file formats as well as audio.

I currently use emms-player-mpv as the only default player on my setup, configured as follows:

(setq-default emms-player-list '(emms-player-mpv)
        emms-player-mpv-environment '("PULSE_PROP_media.role=music")
        emms-player-mpv-parameters '("--quiet" "--really-quiet" "--no-config"
                         "--save-position-on-quit"
                         "--no-audio-display" "--force-window=no"
                         "--vo=null"))

                    

As it stands, emms-player-mpv does not open a new (system) window and play the video of (e.g.) an .mkv file, but just plays the audio.

I've tried to create a separate simple player to use mpv to play video files instead, using variations of this configuration (as well as some unrelated stuff):

  (require 'emms-player-simple)

  (define-emms-simple-player my-mpv-player '(file)
    (regexp-opt '(".mp3" ".mp4" ".mkv" ".webm")) 
    "mpv"
  "--quiet" "--really-quiet" "--no-config" "--save-position-on-quit" "--force-window=yes")

  (add-to-list 'emms-player-list 'emms-player-my-mpv-player)
  (setq-default emms-player-list '(emms-player-my-mpv-player) ;;emms-player-mpv)
        ;; emms-player-my-mpv-environment '("PULSE_PROP_media.role=video")
                emms-player-my-mpv-player-parameters '("--quiet" "--really-quiet"
                               "--save-position-on-quit" "--force-window=yes"))

Unfortunately, I keep getting the error `Don't know how to play track:

emms-player-start: Don’t know how to play track: (*track* (type...

This is true even for the audio format .mp3 files I can play with the usual emms-player-mpv.

Using a different media player like vlc instead of mpv leads to the same issue.

Is there something I'm missing in defining the simple player? Is there a more convenient way to play video files using emms?

EDIT

I removed "--force-window=no" "--vo=null" options, so that I now use (setq-default emms-player-mpv-parameters '("--quiet" "--really-quiet" "--no-config" "--save-position-on-quit" "--no-audio-display" )). Now, audio files play without creating a window and video files open properly in their own video. So far so good.

Would be interested in seeing how I could define a new player though.

nonreligious
  • 473
  • 2
  • 14
  • I use `(setq emms-player-list '(emms-player-mpv))` and it works fine. No need to define a new player. – jagrg Dec 17 '22 at 00:20
  • @jagrg Because I use `emms-player-mpv` primarily for music/podcasts, I use the settings `"--force-window=no" "--vo=null"`, shown in my initial configuration. This prevents an `mpv` window from being drawn and the video output being shown in general. I prefer this because I listen to audio files more than I watch videos, so it's better not to have an unnecessary window created most of the time. – nonreligious Dec 17 '22 at 09:56
  • Again, `emms-player-mpv` is what I use, and I don't see additional windows when playing audio files. Maybe try adding those parameter to the `emms-player-mpv-parameters` variable, or perhaps to you mpv config file directly. – jagrg Dec 17 '22 at 22:22
  • OK, gotcha: I removed `"--force-window=no" "--vo=null"` options, so that I now use `(setq-default emms-player-mpv-parameters '("--quiet" "--really-quiet" "--no-config" "--save-position-on-quit" "--no-audio-display" ))`. Now, audio files play without creating a window and video files open properly in their own video. Thanks for rubber-ducking. – nonreligious Dec 19 '22 at 13:17

0 Answers0