mpv icon indicating copy to clipboard operation
mpv copied to clipboard

Subtitles no longer autoloaded

Open tomba4 opened this issue 9 years ago • 65 comments

So, the 2017-02-12 changelog says: "sub: remove .txt as text subtitle extension", which leaves me with no subtitles support. Is there a way to readd .txt as subtitle extension? I couldn't find anything in the documentation.

tomba4 avatar Feb 13 '17 19:02 tomba4

Why do your subtitles have a .txt extension?

ghost avatar Feb 14 '17 05:02 ghost

That's the default where I come from. Almost all subtitles produced in the last ~20 years are in .txt.

tomba4 avatar Feb 14 '17 05:02 tomba4

And where is that?

ghost avatar Feb 14 '17 06:02 ghost

Poland.

tomba4 avatar Feb 14 '17 06:02 tomba4

Could you upload a sample? I've never seen a .txt subtitle before.

wiiaboo avatar Feb 15 '17 14:02 wiiaboo

.txt is used as a container for various formats. Some examples:

  1. time-based (rarely used anymore) 00:01:54:Pomóż mi! Nie! 00:01:57:Akcja rozgrywa się między 09:00,|a 10:00 wieczorem 00:02:00:w dniu prawyborów prezydenckich|w stanie Kalifornia.

  2. frame based (old)

[2453][2482]Poprosiłem fotografa. [2484][2526]Najstarsze zdjęcia 506. Pułku. [2528][2554]Pochodzą z Toccoa.

  1. frame based (currently in wide use): {5390}{5414}Czas na nas. {5414}{5486}- Co z Sheldonem?|- Nie idzie. {5488}{5543}Co powiemy Siebertowi? {5543}{5735}Powiedzcie, że dr Cooper woli|zedrzeć maskę natury

tomba4 avatar Feb 15 '17 15:02 tomba4

That's horrible. Why would they choose an extension that's used everywhere to indicate a simple text file as something to be interpreted as subtitles?

wiiaboo avatar Feb 15 '17 16:02 wiiaboo

Well, it's a text :) and I'm not sure what other choices were available ~20 years ago when the subtitles scene started. In any case, it has worked quite well all those years.

tomba4 avatar Feb 15 '17 16:02 tomba4

I can't think of a way to fix this completely. We either revert to accepting .txt again and screw people with .txt on the video's directory or use an heuristic and only allow .txt if prefixed by 'pl' or 'pol'?

What do you use to get these subtitles, subliminal?

wiiaboo avatar Feb 15 '17 19:02 wiiaboo

Maybe rename subs.txt to subs.pol and make mpv ttreat that .pol file as text subs?

No idea if it can work out or not, just couldn't help showing myself off. Sorry...

kkkrackpot avatar Feb 15 '17 20:02 kkkrackpot

Just wondering: how is .txt a problem? I have many videos with .txt that's not subtitles and never had any problems, the file is just not loaded (txt "[file] Stream opened successfully", followed by "Can not open external file file.txt").

I've never used subliminal. For a very long time there have been large polish-only sites that dealt with subtitles and although recently they started switching to .srt, the vast majority is .txt.

Renaming is not really an option, since people's collections often are on DVDs.

Would it be a big problem to add supported extensions in the config file?

tomba4 avatar Feb 15 '17 20:02 tomba4

@fhlfibh same effort as ffmpeg-converting the text subs to srt before playing.

wiiaboo avatar Feb 15 '17 23:02 wiiaboo

Do you mind uploading a sample file with the .txt subs? Maybe try https://www.subtitle-converter.com/

Though I think the idea of choosing the files extensions mpv should load would be better, have a default set for obvious ones .srt .ass .idx .sub etc... and let people add whichever extensions they want to load?

dragons4life avatar Feb 16 '17 19:02 dragons4life

I reverted mpv to previous version when I find out that it don't support *.txt subtitles. I propose two workarounds which are not mutually exclusive:

Workaround: Usually filename of .txt subtitles is the same as video file, so you could accept and auto-load *.txt subtitles if video and subtitles name are the same, for example: some video.mp4 some video.txt subtitles auto-loaded, and if filename mismatches .txt subtitles will be not loaded.

Additional workaround: You could add small button in lower right corner of window and shortcut key to open directory browse window for user, so that he could choose another file with subtitles.

termenti avatar Feb 20 '17 12:02 termenti

Workaround: Usually filename of .txt subtitles is the same as video file, so you could accept and auto-load *.txt subtitles if video and subtitles name are the same, for example: some video.mp4 some video.txt subtitles auto-loaded, and if filename mismatches .txt subtitles will be not loaded.

That's --sub-auto=exact/fuzzy behavior exactly, not a workaround.

wiiaboo avatar Feb 20 '17 13:02 wiiaboo

You can just rename the .txt files to .sub or something else random.

ghost avatar Feb 20 '17 13:02 ghost

Renaming is not an option as I mentioned previously. I guess it all boils down to a question whether there are other mpv users who lost subtitle support with this change and if there's enough of them for this update to be reverted...

tomba4 avatar Feb 20 '17 13:02 tomba4

Workaround: Usually filename of .txt subtitles is the same as video file, so you could accept and auto-load *.txt subtitles if video and subtitles name are the same, for example: some video.mp4 some video.txt subtitles auto-loaded, and if filename mismatches .txt subtitles will be not loaded.

That's --sub-auto=exact/fuzzy behavior exactly, not a workaround.

--sub-auto=exact/fuzzy/all is not working, subtitles are not loading. Maybe because .txt subtitles are not supported...

And if I would want to change all my *.txt subtitles, what extension/format should I choose to not have problems? What subtitle extensions/formats are most popular/trouble-less?

termenti avatar Feb 21 '17 19:02 termenti

.sub, .srt, .vtt, etc. It just matters that it's an extension that'll get autoloaded. You don't even need to convert them.

wiiaboo avatar Feb 21 '17 20:02 wiiaboo

Maybe it's time to abandon the DOS age and start recognizing files by contents rather than filename suffix?

mgorny avatar Feb 23 '17 17:02 mgorny