trizen/straw-viewer

No audio when using Celluloid

cihlarma opened this issue · 2 comments

Probably NOTOURBUG, but I tried using Celluloid (GTK+ mpv frontend) as a player for gtk-straw-viewer. My config is as follows:

celluloid => {
  arg   => "--enqueue",
  audio => "--mpv-audio-files=*AUDIO*",
  cmd   => "celluloid",
  fs    => "--mpv-fullscreen",
  srt   => "--mpv-sub-files=*SUB*",
},

All of the options work except for audio - there is no audio track available and no error messages are present in GUI or stdout. It may be that either Celluloid or libmpv isn't handling the audio URL passed to it properly (but the subtitles work because they're downloaded and saved into the cache folder), but I can't actually see what *AUDIO* is when I click on a video. Mind you that using raw mpv with the default straw-viewer config works.

A work-around for anyone passing by that I realized I could use after reading straw-viewer --tricks:

celluloid => {
  arg => "--enqueue *URL*",
  cmd => "celluloid",
  fs  => "--mpv-fullscreen",
  srt => "--mpv-sub-files=*SUB*",
},

Still, it doesn't solve the behaviour mentioned in the issue.

From the documentation of mpv, it states that --audio-files is a path list option. This means that the audio file must be a local file on the system, not an external URL:

      --audio-files=<files>
              Play audio from an external file while viewing a video.

              This is a path list option. See List Options for details.

One solution would be setting dash => 0, in the config-file file of gtk-straw-viewer and using:

celluloid => {
  arg   => "--enqueue",
  audio => "",
  cmd   => "celluloid",
  fs    => "--mpv-fullscreen",
  srt   => "--mpv-sub-files=*SUB*",
},

(however, this solution does not support 1080p+ video)

An alternative solution would be passing just the YouTube *URL* to celluloid and let it extract the streams with youtube-dl:

celluloid => {
  arg   => "--enqueue *URL*",
  audio => "",
  cmd   => "celluloid",
  fs    => "--mpv-fullscreen",
  srt   => "--mpv-sub-files=*SUB*",
},

(the downside of this solution, is that the resolution of the video is chosen by celluloid/mpv)