How to set the font/encoding for the subtitle?

This forum is about all development around libVLC.
gam2046
New Cone
New Cone
Posts: 6
Joined: 17 Dec 2015 05:32

How to set the font/encoding for the subtitle?

Postby gam2046 » 20 Dec 2015 14:55

How to set the font for the subtitle with LibVLC? (In GUI, set by Ctrl + P -> "subtitle / OSD" -> "Subtitle effects" -> "Font")
And I want to set the default encoding, I tried to use "--subsdec-encoding=utf8" when I called "libvlc_new", but failed.

How can I achieve this effect? Thanks.

Rémi Denis-Courmont
Developer
Developer
Posts: 15268
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: How to set the font/encoding for the subtitle?

Postby Rémi Denis-Courmont » 20 Dec 2015 19:41

Eh, subsdec-encoding works the same way in libvlc_new() as it does in VLC command line so far (though that might change in the future).

In any case, UTF-8 is autodetected, so there is no point forcing it there.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

gam2046
New Cone
New Cone
Posts: 6
Joined: 17 Dec 2015 05:32

Re: How to set the font/encoding for the subtitle?

Postby gam2046 » 21 Dec 2015 03:31

Eh, subsdec-encoding works the same way in libvlc_new() as it does in VLC command line so far (though that might change in the future).

In any case, UTF-8 is autodetected, so there is no point forcing it there.
Thanks. So how do I change the font for the subtitle? The default font is "Arial", but it is a Ascii font that cannot be displayed in other fonts (such as Chinese).

Rémi Denis-Courmont
Developer
Developer
Posts: 15268
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: How to set the font/encoding for the subtitle?

Postby Rémi Denis-Courmont » 21 Dec 2015 09:34

You should be able to use the same options as VLC for fonts configuration. Needless to say, those options depend on the VLC version and operating system, so meddling with them might not be such a great idea.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

gam2046
New Cone
New Cone
Posts: 6
Joined: 17 Dec 2015 05:32

Re: How to set the font/encoding for the subtitle?

Postby gam2046 » 22 Dec 2015 07:36

You should be able to use the same options as VLC for fonts configuration. Needless to say, those options depend on the VLC version and operating system, so meddling with them might not be such a great idea.
I try to do this, I set up the Chinese title of the media :

Code: Select all

libvlc_media_set_meta(media,libvlc_meta_Title,"中文");
But the show is a block (like "■■")

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: How to set the font/encoding for the subtitle?

Postby Jean-Baptiste Kempf » 28 Jun 2016 09:33

block means wrong font, not wrong encoding.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 30 guests