AND (file_path LIKE '%.mkv' OR file_path LIKE '%.mp4' OR file_path LIKE '%.avi' OR file_path LIKE '%.mov' OR file_path LIKE '%.webm' OR file_path LIKE '%.m4v' OR file_path LIKE '%.wmv' OR file_path LIKE '%.flv' OR file_path LIKE '%.ts' OR file_path LIKE '%.m2ts')
pub fn find_mpv_executable() -> Option<String> { println!("[MPV] Searching for mpv.exe on the system..."); // First, check if mpv is in PATH (fastest check) if let Ok(output) = Command::new("where").arg("mpv.exe").output() { if output.status.success() { if let Ok(path) = String::from_utf8(output.stdout) { let path = path.lines().next().unwrap_or("").trim(); if !path.is_empty() && Path::new(path).exists() { println!("[MPV] Found mpv in PATH: {}", path); return Some(path.to_string()); } } } } // Check common installation paths for pattern in MPV_SEARCH_PATHS { if pattern.contains('*') { // Handle wildcard patterns (for user-specific paths) if let Some(found) = expand_and_check_pattern(pattern) { println!("[MPV] Found mpv at: {}", found); return Some(found); } } else if Path::new(pattern).exists() { println!("[MPV] Found mpv at: {}", pattern); return Some(pattern.to_string()); } } println!("[MPV] mpv.exe not found on the system"); None}
-- StreamVault Progress Tracker for MPV-- Saves playback position to a JSON file periodically and on quitlocal progress_file = "%APPDATA%/StreamVault/mpv_progress/{media_id}.json"local save_interval = 2 -- secondslocal function get_progress_data() local pos = mp.get_property_number("time-pos") local duration = mp.get_property_number("duration") local paused = mp.get_property_bool("pause") or false local eof = mp.get_property_bool("eof-reached") or false return string.format( '{"position":%.3f,"duration":%.3f,"paused":%s,"eof_reached":%s}', pos, duration, paused and "true" or "false", eof and "true" or "false" )endlocal function save_progress() local data = get_progress_data() local file = io.open(progress_file, "w") if file then file:write(data) file:close() endend-- Periodic save timer (every 2 seconds)local timer = mp.add_periodic_timer(save_interval, save_progress)-- Save on pause/unpausemp.observe_property("pause", "bool", save_progress)-- Save on seekmp.register_event("seek", save_progress)-- Save on quit - most important!mp.register_event("shutdown", save_progress)-- Save when file endsmp.register_event("end-file", save_progress)
Clear old progress: Settings → Advanced → Clean Up Missing Titles
Subtitles Not Loading
MPV auto-loads subtitles in the same directory as the video. To manually load:
Press v during playback to cycle subtitle tracks
Drag and drop .srt file onto MPV window
Use MPV config file (%APPDATA%/mpv/mpv.conf) to set default subtitle preferences
Hardware Acceleration Issues
Edit %APPDATA%/mpv/mpv.conf to configure GPU acceleration:
# Use hardware decodinghwdec=auto-safe# Force specific GPU API (if auto fails)# hwdec=d3d11va # Windows (Direct3D)# hwdec=videotoolbox # macOS# hwdec=vaapi # Linux