Page 1 of 1

How to set the font/encoding for the subtitle?

Posted: 20 Dec 2015 14:55
by gam2046
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.

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

Posted: 20 Dec 2015 19:41
by Rémi Denis-Courmont
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.

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

Posted: 21 Dec 2015 03:31
by gam2046
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).

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

Posted: 21 Dec 2015 09:34
by Rémi Denis-Courmont
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.

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

Posted: 22 Dec 2015 07:36
by gam2046
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 "■■")

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

Posted: 28 Jun 2016 09:33
by Jean-Baptiste Kempf
block means wrong font, not wrong encoding.