3

GitHub Source Page

i'm using this really amazing video player in ubuntu, i just want to make little change in it's behaviour with subtitles (.srt files)

Default Behaviour

currently MPV shows subtitles which are hard coded in a video file or srt file which is exactly named as the video file, for eg it'll pick up the subtitle file if the name of video file is video.mkv and name of the subtitle file is video.srt , but it won't pick it up if it's different.

What I want to achieve

it should pick up any and all the subtitles which are available in the same folder as the video file, automatically

5 Answers 5

8

To provide an actual mpv only answer, you can specify the mechanism by which subtitle tracks are loaded in your mpv.conf file located at .config/mpv.conf as explained here in the mpv manual. In your case you would add sub-auto=all.

1
  • I found that I had to set the filepath to .config/mpv/mpv.conf instead of .config/mpv.conf (running Xubuntu 20.04 with mpv 0.32.0) Jul 18, 2022 at 18:59
4

SMPlayer is a frontend for various media player programs, defaulting in modern versions to mpv. If you don't mind using it (since you'd be using mpv with some niceties), it gives this option for selecting subtitles:

enter image description here

It is available in Ubuntu's repositories, so a sudo apt-get install smplayer is enough to get it.

3
  • i tried to stay away from it because GUI looked terrible, but it's highly configurable and I've managed to make it look more minimalist, thanks for the suggestion, works for me Apr 7, 2017 at 10:35
  • @SumeetDeshmukh ah yes, I should have mentioned that the first thing I do when installing it is to go to the Interface settings and change the themes and layout
    – muru
    Apr 7, 2017 at 10:41
  • that's what I did, it's already growing on me, thanks again Apr 7, 2017 at 10:42
4

If you use mpv from the terminal you can type mpv [name of your file] --sub-files=[name of your srt file]. Actually you can add a list of srt files type man mpv for more info. Good luck.

1

In Linux, create a file mpv.conf in ~/.config/mpv and add the following lines:

--sub-auto=all 
--sub-file-paths=sub:subtitles:Subs:<any_other_folder_with_subtitle_files>

You can add names of folder where subtitles are (could be a subdirectory within the folder of the movie) separated by :.

0

I am trying to play an online video from internet using mpv and want to add local subtitle into it.

for eg. mpv --sub-file=subtitle.srt 'Video Url' This code is not working until i add the absolute path of subtitle file

After passing the absolute path of the subtitle file in --sub-file flag, mpv pick up the subtitle file located in my local pc whose having different name from video file name and streaming online video with it.

for eg. mpv --sub-file=/home/UserName/Desktop/subtitle.srt 'Video Url'

Hope This Help :]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.