-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use-filedir-conf=yes
-options doesn't apply to .m3u
-playlist entries
#15803
Comments
use-filedir-conf=yes
-options doesn't apply to "http://"-videofilesuse-filedir-conf=yes
-options doesn't apply to .m3u
-playlists containing "http://"-videofiles
use-filedir-conf=yes
-options doesn't apply to .m3u
-playlists containing "http://"-videofilesuse-filedir-conf=yes
-options doesn't apply to .m3u
-playlist entries
For me it works with playlists also |
It works as documented. It uses a file specific config that is currently played, so in your case
Playlists are not played or shown as current file in mpv. This is essentially a feature request to add |
I see. Well in that case, yeah I think it would be great as a feature. |
Exactly what options did you leave in the external |
I just have copied the whole mpv.conf into my parent music folder, m3u files are stored there too. Just enabled the visualization. I believe there is no need for you of my whole mpv.conf, this part is for music:
After that, whenever I open m3u playlists stored in music folder they are playing with visualization. |
Yes, because it loads the config from the media file location. Exactly as |
Yes like kasper93 described this works as intended. My feature-request attains to URLs and files in subdirectories. |
Ah, sorry then. |
For the time being, this is what me and DeepSeek came up with. -- dynamic-include.lua
local utils = require 'mp.utils'
-- Store the initial input file path
local initial_input_path = nil
-- Function to normalize path separators (cross-platform)
local function normalize_path(path)
return path:gsub("\\", "/")
end
-- Function to check if a file exists
local function file_exists(path)
local file = io.open(path, "r")
if file then
file:close()
return true
end
return false
end
-- Function to parse and apply configuration settings
local function apply_config_file(conf_path)
local file = io.open(conf_path, "r")
if not file then
mp.msg.warn("Config file not found: " .. conf_path)
return
end
mp.msg.info("Loading config file: " .. conf_path)
for line in file:lines() do
-- Skip comments and empty lines
if not line:match("^%s*#") and not line:match("^%s*$") then
-- Parse the line into a key and value
local key, value = line:match("^([^=]+)=(.+)$")
if key and value then
key = key:gsub("%s+", "") -- Remove whitespace
value = value:gsub("%s+", "") -- Remove whitespace
-- Set the property or option
local success, err = pcall(mp.set_property, key, value)
if not success then
mp.msg.warn("Failed to set property: " .. key .. "=" .. value .. " (" .. err .. ")")
else
mp.msg.info("Set property: " .. key .. "=" .. value)
end
else
mp.msg.warn("Invalid line in config file: " .. line)
end
end
end
file:close()
end
-- Function to handle the initial input file
local function track_initial_input_path()
-- Only process the first input file (playlist file)
if initial_input_path then
return
end
-- Get the path of the first input file
local path = mp.get_property("path")
if not path then
mp.msg.warn("No file path available.")
return
end
-- Normalize path separators
initial_input_path = normalize_path(path)
mp.msg.info("Initial input file path set to: " .. initial_input_path)
-- Get the directory of the initial input file
local dir = utils.split_path(initial_input_path)
local conf_path = utils.join_path(dir, "mpv.conf")
conf_path = normalize_path(conf_path)
-- Check if the config file exists and apply it
if file_exists(conf_path) then
apply_config_file(conf_path)
else
mp.msg.warn("Config file not found: " .. conf_path)
end
end
-- Register the event to run when a file starts loading
mp.register_event("start-file", track_initial_input_path) I'm too tired to actually look this through, but it works. It applies any MPV option from a |
This also does it: local utils = require 'mp.utils'
local first_entry = mp.get_property('playlist/0/filename')
if first_entry then
local path = select(1, utils.split_path(first_entry)) .. 'mpv.conf'
if utils.file_info(path) then
mp.commandv('load-config-file', path)
end
end |
This should be |
|
DAMN @guidocella you're goated, good shit. |
mpv Information
Other Information
Reproduction Steps
test.m3u8
-file containing links to videos likesubdir/video.mp4
mpv.conf
-file in same directory, containing configuration likefullscreen=yes
orsave-position-on-quit=yes
mpv --no-config --use-filedir-conf test.m3u8
Expected Behavior
Options from the
mpv.conf
-file next to thetest.m3u8
-file should be applied.Actual Behavior
Options from the
mpv.conf
-file next to thetest.m3u8
-file are not applied.Log File
output.txt
Sample Files
No response
I carefully read all instruction and confirm that I did the following:
--log-file=output.txt
.Edit:
Also happens to local videofiles, I discovered. Even with
profile-restore=copy
in externalmpv.conf
The text was updated successfully, but these errors were encountered: