You are not logged in.

#1 2014-07-13 12:07:40

kamirao
Member
Registered: 2012-03-20
Posts: 16
Website

mpv profiles

I know that I can put:

[extension.mp3]
option=value

in ~/.mpv/config so the profile will be activated when i play any mp3 file. Does anyone knows if same can be done for all audio/video files in a specific directory, let's say /media/disk1? I've been searching this all over internet but couldn't find one.

Thanks,

Offline

#2 2014-07-13 12:21:32

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: mpv profiles

man mpv wrote:

   File-specific Configuration Files
       You can also write file-specific configuration files. If you  wish  to
       have a configuration file for a file called 'movie.avi', create a file
       named 'movie.avi.conf' with the file-specific options in it and put it
       in ~/.mpv/. You can also put the configuration file in the same direc‐
       tory  as  the  file  to  be  played,  as  long   as   you   give   the
       --use-filedir-conf  option  (either  on  the  command  line or in your
       global config file). If a file-specific configuration file is found in
       the  same  directory,  no  file-specific  configuration is loaded from
       ~/.mpv. In addition,  the  --use-filedir-conf  option  enables  direc‐
       tory-specific  configuration files.  For this, mpv first tries to load
       a mpv.conf from the same directory as the file played and  then  tries
       to load any file-specific configuration.

I'm not sure if it's recursive.

Offline

#3 2014-07-13 12:48:39

diffycat
Member
Registered: 2011-06-18
Posts: 26

Re: mpv profiles

Also you can create shell-wrapper which will check files directory and launch mpv with required profile. E.g:

mpv-custom () {
  [ "$#" -ne 1 ] && echo 'Usage: mpv-custom <file>' && return

  file_name="${1}"
  full_name=`readlink -f $file_name`

  if  [[ $full_name == /media/disk1* ]];
  then
    mpv --profile=my-profile "${1}"
  else
    mpv "${1}"
  fi
}

^^^ I've not ran that code.

Offline

Board footer

Powered by FluxBB