mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.25k stars 2.9k forks source link

Would be nice if mpv also looked for subs in symlink target folder #6098

Closed graywolf closed 4 years ago

graywolf commented 6 years ago

At the moment mpv seems to only look for subs in same folder as file, which works most of the time but fails for subtitles.

$ ls extra
video.ass
video.mkv

$ ln -s extra/video.mkv video.mkv

$ mpv video.mkv
Playing: video.mkv
 (+) Video --vid=1 (*) (h264 1920x1080 23.976fps)
 (+) Audio --aid=1 --alang=jpn (*) (flac 2ch 48000Hz)
Using hardware decoding (vaapi).

Would be nice if mpv checked current folder (same way as does now) and if subs not found also checked link target folder.

Just something to consider :)

If feature itself is accepted, I could try to put together PR.

tomty89 commented 6 years ago

Wouldn't also symlinking the sub file be the sensical thing to do ._.

Argon- commented 6 years ago

Well you could use https://mpv.io/manual/master/#options-sub-file-paths and tell it to check extra directories.

graywolf commented 6 years ago

@tomty89 that's my "workaround" atm, but I don't need the subs there and they only clutter tab-completion

@Argon- that's great, if I combine it with readlink I should be able to get mpv to read it from proper folder :) thanks a lot

Argon- commented 6 years ago

May I ask what the purpose of linking is? If organization is crucial (maybe you have a lot of sub/external files and want to reduce clutter) I'd recommend you don't link the video one layer "up" but instead put the external files into subfolders, e.g.:

video.mkv
subs/video.ass
audio/video.mka

Now it's really easy: just add "subs" to --sub-file-paths and "audio" to --audio-file-paths and you are set. You could also use a local mpv.conf to set these paths on a per-folder/per-movie basis.

graywolf commented 6 years ago

Sure, I don't mind sharing my reasons :) When I rip various official DVDs/BRs for personal backup (legal in my country), there often is lot of extra content. That goes into /extra folder. Main "thing" goes into the root. Sometimes, just sometimes, the parts of the extra content are crucial enough for me to want to have them exposed in the root folder too, however they are still extra content and should be in /extra. symlinks to the rescue. But subtitles are just clutter from this point of view.

While short wrapper script combining readlink and --sub-file-paths seems to work fine, still, I think my original suggestion/feature request would be reasonable default.. :)

ghost commented 4 years ago

I don't think mpv is going to do this. You can use the subtitle search path option that was mentioned.