Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.

automaticaly showing subtitles with mpv

0 votes
asked Jun 13 in vifm by Mattia

On my vifmrc I've setted mpv as my video player.
When running mpv on a normal shell, it manages to automatically load the corresponding subtitle file (the one with the same name as the video file and a subtitle extension).
Sadly when using it on vifm it seems like mpv doesn't find this file.

that's my vifmrc:

filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
     \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
     \*.as[fx]
    \ {View using ffplay}
    \ ffplay -fs -autoexit %f,
    \ {View using Dragon}
    \ dragon %f:p,
    \ {View using mpv}
    \ mpv %f,
fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
      \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
      \*.as[fx]
	  \ mpv %f,

Does anyone know how to fix this problem?

1 Answer

+1 vote
answered Jun 13 by xaizek
selected Jun 13 by xaizek
 
Best answer

I'm not sure that fileviewer with mpv %f makes sense. :fileviewer specifies what command to run on :view, which expects textual output.

mpv %f is the third in the :filextype command, maybe it's not being run? Order defines priority. Try using:

filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
         \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
         \*.as[fx]
           \ {View using mpv}
           \ mpv %f,
           \ {View using ffplay}
           \ ffplay -fs -autoexit %f,
           \ {View using Dragon}
           \ dragon %f:p,

You can also make sure that file is run using mpv by running :file and
picking mpv from the menu. Try this, I guess you view videos with something else when picking them inside vifm.

commented Jun 13 by Mattia Marchesini

thanks for your help that was the actual problem (I didn't even know I have ffplay installed)
I registered so I can upvote you

If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.
...