Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display lyrics in the console when playing a mp3 #1404

Closed
Horla opened this issue Dec 29, 2014 · 9 comments

Comments

Projects
None yet
2 participants
@Horla
Copy link

commented Dec 29, 2014

[17:13:14] <SuperDupont: Hi, I am using mpv to play music and it is really great. Thank you! I am wondering if there is a way to display the lyrics as most of my mp3 files have embedded lyrics (id3 tag). Is there?
[17:14:42] <lachs0r: yes, probably (by accessing the metadata properties)
[17:14:54] <lachs0r: but there is no simple switch to do this
[17:15:30] <SuperDupont: Ok, thanks anyway
[17:15:31] <lachs0r: actually it should print them on the terminal
[17:15:48] <lachs0r: (it prints all text tags there by default)
[17:15:54] <SuperDupont: It doesn't
[17:16:01] <lachs0r: well.
[17:16:43] <lachs0r: I don’t have many mp3 files, and none of them have lyrics… appears to work for vorbiscomment (ogg/flac) and ape tags (wavpack and others) though
[17:17:31] <SuperDupont: Should I open an issue on github?
[17:17:41] <wm4: SuperDupont: sure, also a sample would be helpful
[17:18:08] <SuperDupont: Ok, I will try to find one without any copyright

One example:
MP3 file: http://www.filedropper.com/international
terminal output: http://paste.ubuntu.com/9641180/
mediainfo: http://paste.ubuntu.com/9641173/

(https://www.marxists.org/history/ussr/sounds/lyrics/international.htm)

mpv version: http://paste.ubuntu.com/9641208/

@wm4

This comment has been minimized.

Copy link
Contributor

commented Dec 29, 2014

The file you posted contains a "USLT" tag, which is for "unsynchronised lyrics/text". ID3 also has synchronised lyrics/text ("SYLT"), but the file doesn't contain it.

This mean we could dump the lyrics in plaintext at program start, but not more.

@wm4

This comment has been minimized.

Copy link
Contributor

commented Dec 29, 2014

Oh, and if that was not explicit enough: for SYLT tags, we could turn it into a subtitle track, effectively showing timed lyrics. But I'd need a sample file for this.

@Horla

This comment has been minimized.

Copy link
Author

commented Dec 29, 2014

@wm4 : http://www.compuphase.com/mp3/From-The-Machine-World.mp3
http://www.compuphase.com/mp3/sylt.htm

When I read it with kodi + the lyrics plugin of kodi (CU LRC Lyrics), I get a synchronisation with some weird text.

@wm4

This comment has been minimized.

Copy link
Contributor

commented Dec 29, 2014

Thanks. I don't think the SYLT tag contains lyrics in this one, but something else - but at least it has lyrics. I'll probably look if I can implement it in ffmpeg. More sample files are welcome.

@wm4

This comment has been minimized.

Copy link
Contributor

commented Jan 10, 2015

Took a serious look. The only file with SYLT tag I found (which is the same as yours) doesn't follow the id3v2 spec.

@wm4

This comment has been minimized.

Copy link
Contributor

commented Jan 10, 2015

PS: I implemented the USLT tag in ffmpeg, if anyone cares about that.

@wm4 wm4 added the wontfix label Jan 11, 2015

@wm4

This comment has been minimized.

Copy link
Contributor

commented Jan 11, 2015

Seems like "kodi (CU LRC Lyrics)" doesn't support these id3v2 tags either.

Edit: no sample file -> no feature.

@wm4 wm4 closed this Jan 11, 2015

@wm4

This comment has been minimized.

Copy link
Contributor

commented Jan 11, 2015

Or actually, it seems it does... and there's also another abomination called "Lyrics3", because the other stuff wasn't terrible enough. Either way, without a sample (or a bunch of them), nothing can be done.

wm4 pushed a commit that referenced this issue Jan 12, 2015

wm4
player: change --display-tags behavior
Remove the "all" special-behavior, and instead interpret trailing "*"
characters. --display-tags=all is replaced by --display-tags=* as a
special-case of the new behavior.

See #1404.

Note that the most straight-forward value for matchlen in the normal
case would be INT_MAX, because it should be using the entire string.
I used keylen+1 instead, because glibc seems to handle this case
incorrectly:

    snprintf(buf, sizeof(buf), "%.*s", INT_MAX, "hello");

The result is empty, instead of just containing the string argument.
This might be a glibc bug; it works with other libcs (even MinGW-w64).
@wm4

This comment has been minimized.

Copy link
Contributor

commented Jan 12, 2015

See above commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.