Page 1 of 1

Set subtitles from video

Posted: 14 Mar 2016 11:21
by mowpy
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 ?

Re: Set subtitles from video

Posted: 14 Mar 2016 21:50
by RĂ©mi Denis-Courmont
That depends on what your LibVLC wrapper API expects.

Re: Set subtitles from video

Posted: 20 Mar 2016 18:43
by tilleke
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);

Re: Set subtitles from video

Posted: 21 Mar 2016 17:23
by mowpy
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 :)