mpv-player / mpv

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

Show list of available languages with additional information about them #7781

Open Pzixel opened 4 years ago

Pzixel commented 4 years ago

I'm a huge fan of MPC-HC, but as you probably know this project is dead so I'm looking for a replacement. And I watch movies with multiple languages all the time. The problem here is in MPC I can make a decision which language I want to set but in MPV I cannot.

For example, this is my bought copy of Shrek movie. When I open it in MPC-HC I can choose between multiple languages and subtitles:

image

Now, I can see that if I want to watch english in best quality I need to chose the latest, if I want to listen russian in best quality I need to chose # 12 and so on. The same point still for the subtitles.

Unfortunately, in MPV I only see languages count and I can't decide which one to use. Although I can switch between languages even in this case I have little information about the track:

image

So my UX is basically non-existing.

Expected behavior of the wanted feature

I propose to add "list languages" and "list subtitles" hotkey (and hopefully, triggered by mouse right-click on relevant buttons as well), that should print list of languages (or subtitles) with short summary about each (bitrate is vital). Currently you can change languages so mouse click is working and you print currently selected language, so printing something on this action works too. It just need to print a list instead of one entry and include some details.

This feature is priceless for files with multiple languages and/or subtitles, and it seems to be relatively cheap (all the required features already exist in the player, you only need to shuffle them a bit), so I think this feature has quite a good net worth overall.

ghost commented 4 years ago

Yes, that might be nice.

There's no interactive and scrollable list GUI thing anywhere in the player, so that's a big bit missing. Someone would have to implement it.

Normally, you start the player from the terminal, where it lists all tracks and a good deal of information, and you'd just restart the player with the relevant track selection options if just cycling through doesn't cut it.

Not sure why you say that bitrate information is vital. That's certainly useless for subtitles.

CounterPillow commented 4 years ago

the track-list property sort of might work for you, it's by default shown by pressing F9. However, the OSD not knowing how big it is will most certainly cut off information if you have a lot of tracks.

ghost commented 4 years ago

Of course that's not interactive, and not scrollable.

shabahengam commented 4 years ago

maybe this project can help https://github.com/darsain/uosc select subtitles uosc-sub select audio uosc-audio

Pzixel commented 4 years ago

@wm4 I say bitrate is vital for audio.

There's no interactive and scrollable list GUI thing anywhere in the player, so that's a big bit missing. Someone would have to implement it.

Although scrollable list would be nice it's good enough to just print it like this:

image

So you just print it on the screen and then user can click "change language" N times (or probably there should be a hotkey to choose track by number).

@CounterPillow Right, something like F9, but which fits to the screen and has required details.

Interactive list option is preferable, but it's much harder to implement so I don't ask it. And in this case all we need is calculate font size to make list fit into the screen and add additional information that affects language selection. F9 as it's currently implemented doesn't provide enough info to make a decision:

image

Pzixel commented 4 years ago

So... What do you think?

In the end I think maybe I could implement it although I'm a no expert in C and not sure if you accept such a change, but I really think this is a huge gap in the player.

ghost commented 4 years ago

As I said, I'm open to it. But someone has to do the work. (There's some chance I'll try it and produce something ugly.)

This would probably be implemented in Lua, not C. Most likely you'd just add it to osc.lua. (There might be better ways to do this, but for now it's what it is.) You could also just start by writing it as a new script, so you don't even need to be able to build the player.

Pzixel commented 4 years ago

Thanks, I'll try to grab it on weekends, I guess.

You could also just start by writing it as a new script, so you don't even need to be able to build the player.

That's a cool proposal, but how do I check if it works if I don't build the player? I mean it's a script language, no types or anything, I'm feeling quite insecure when I can't even typecheck it. How can I make sure if I write something making sense?


I'll probably try to setup my environment and build player if I could. I'm almost sure I'll need some sort of debugging (at least to add meta-information about channels, I don't know where they are stored so I need to examine possible objects for that information).

ghost commented 4 years ago

I mean it's a script language, no types or anything, I'm feeling quite insecure when I can't even typecheck it. How can I make sure if I write something making sense?

You check whether the script works or crashes. If you have any suggestions for a typed scripting language, I'm open to it. You could also write a C plugin in any language that can import C symbols (at least on Linux), but that probably goes too far.

Building isn't needed for normal external scripts. You can even take osc.lua and load it externally (use --no-osc to disable the internal copy).

Pzixel commented 4 years ago

Ahh, so I can run compiled player with my script and make it work that way? Cool.

You check whether the script works or crashes. If you have any suggestions for a typed scripting language, I'm open to it.

No-no-no, lua is fine. I'm just saying that I need to check if things are working before creating a PR. It seems that I can do it with precompiled player.

P.S. Your avatar alvays make me nervous if something on the page didn't load correctly.