Set subtitles from video

This forum is about all development around libVLC.
mowpy
New Cone
New Cone
Posts: 3
Joined: 14 Mar 2016 11:07

Set subtitles from video

Postby mowpy » 14 Mar 2016 11:21

Hi there,

I'm developping a vlc player with some controls and it work fine for now,

I already add the "SetAudioTrack" to choose audio track and it work fine, with this code :

Code: Select all

_VlcOptionAudio.SetItemChecked(e.Position, true); // the position is choose by the client from a list _mediaPlayer.SetAudioTrack(e.Position); _player.Release();
But when i use the same code to add subtitles nothing appends :

Code: Select all

_VlcOptionSubtiles.SetItemChecked(e.Position, true); _mediaPlayer.SetSpuTrack(e.Position); _player.Release();

Do i need to do something more ? Like adding a view, or something with VlcVout ?

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

Re: Set subtitles from video

Postby Rémi Denis-Courmont » 14 Mar 2016 21:50

That depends on what your LibVLC wrapper API expects.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

tilleke
New Cone
New Cone
Posts: 7
Joined: 08 Jul 2010 20:57

Re: Set subtitles from video

Postby tilleke » 20 Mar 2016 18:43

This might help (android example):

Code: Select all

private SurfaceView mSubtitlesSurface = null; //in onCreate() if (HWDecoderUtil.HAS_SUBTITLES_SURFACE) { final ViewStub stub = (ViewStub) findViewById(R.id.subtitles_stub); mSubtitlesSurface = (SurfaceView) stub.inflate(); mSubtitlesSurface.setZOrderMediaOverlay(true); mSubtitlesSurface.getHolder().setFormat(PixelFormat.TRANSLUCENT); } //in onStart() final IVLCVout vlcVout = mMediaPlayer.getVLCVout(); vlcVout.setVideoView(mVideoSurface); if (mSubtitlesSurface != null) vlcVout.setSubtitlesView(mSubtitlesSurface); vlcVout.attachViews(); mMediaPlayer.getVLCVout().addCallback(this);

mowpy
New Cone
New Cone
Posts: 3
Joined: 14 Mar 2016 11:07

Re: Set subtitles from video

Postby mowpy » 21 Mar 2016 17:23

Hi,

I'm using this to get vlc on my app : https://github.com/martijn00/VlcXamarin (from nuget)

tilleke : thx for answering i'll try as soon as possible :)


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 16 guests