Page 1 of 1

libVLC on Android: can't see video.

Posted: 16 Sep 2014 20:59
by nirhal
Hi,
I'm trying to use the libVLC for playing a video file.
i have working audio but i can't see picture on the SurfaceView.
LogCat says: yuv_rgb_neon filter: can't get output picture.
also I've notice that the original VLC app doesn't load the yuv_rgb_neon filter, but my app does load it.
what is this filter? how can I disable this filter?

my Code:

Code: Select all

try { mLibVLC = VLCInstance.getLibVlcInstance(); } catch (LibVlcException e) { // faild return; } VLCInstance.updateLibVlcSettings(null); // aout = 1; vout = 0; deblocking = -1; hardwareAcceleration = 2; final SurfaceView mSurface = (SurfaceView) findViewById(R.id.player_surface); SurfaceHolder mSurfaceHolder = mSurface.getHolder(); mSurfaceHolder.setFormat(PixelFormat.RGBX_8888); mSurfaceHolder.addCallback(mSurfaceCallback); //mLibVLC.setHardwareAcceleration(LibVLC.HW_ACCELERATION_FULL); mLibVLC.eventVideoPlayerActivityCreated(true);
my SurfaceHolder Callback:

Code: Select all

private final SurfaceHolder.Callback mSurfaceCallback = new Callback() { @Override public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { if(mLibVLC != null) mLibVLC.attachSurface(holder.getSurface(), MainActivity.this); } @Override public void surfaceCreated(SurfaceHolder holder) { } @Override public void surfaceDestroyed(SurfaceHolder holder) { if(mLibVLC != null) mLibVLC.detachSurface(); } };
playing a Video:

Code: Select all

mLibVLC.setMediaList(); String mLocation = "file:///storage/extSdCard/a.mp4"; mLibVLC.getMediaList().add(new Media(mLibVLC, mLocation)); int savedIndexPosition = mLibVLC.getMediaList().size() - 1; mLibVLC.playIndex(savedIndexPosition); mLibVLC.play(); mSurface.setKeepScreenOn(true);
thanks. :D

Re: libVLC on Android: can't see video.

Posted: 16 Sep 2014 22:29
by Rémi Denis-Courmont
yuv_rgb_neon converts YUV video to RGB colour space with the NEON vector unit. It is there because your application requests RGB format.

Re: libVLC on Android: can't see video.

Posted: 08 Jul 2015 17:14
by ebr
Was there ever a resolution to this actual issue (the video not showing)?

I'm getting the same error trying to integrate libVLC into an Android app. Thx.

Re: libVLC on Android: can't see video.

Posted: 09 Jul 2015 17:31
by ebr
As further information - the first fishy thing I see in the log is this warning:

Code: Select all

W/VLC﹕ [5d1e0d0c] core video output: Not enough display buffers in the pool, requested 3 got 1
Next is:

Code: Select all

E/VLC﹕ [5d0ade94] core vout display: Failed to change zoom
And then it starts producing these:

Code: Select all

W/VLC﹕ [5d26acbc] yuv_rgb_neon filter: can't get output picture

Re: libVLC on Android: can't see video.

Posted: 09 Jul 2015 20:32
by Rémi Denis-Courmont
This means that, for whatever reasons, YUV to RGB conversion was necessary, and the conversion filter was unable to allocate an output buffer.

Re: libVLC on Android: can't see video.

Posted: 09 Jul 2015 21:37
by ebr
Okay, so what could be some of those reasons?

Have I not initialized something properly?

Can you give me any pointers for where to look in my logic flow?

Thanks for your help.

Re: libVLC on Android: can't see video.

Posted: 09 Jul 2015 22:41
by Rémi Denis-Courmont
I don't know.

Re: libVLC on Android: can't see video.

Posted: 11 Jul 2015 18:24
by ebr
For anyone else that has this issue, I solved it - at least for my case.

It turned out to be an order of operations problem. I was calling init() on my LibVlc instance before I had set options like hardware acceleration, etc.

Setting these options first and then calling the init solved the problem.

Re: libVLC on Android: can't see video.

Posted: 15 Jul 2015 23:18
by Jean-Baptiste Kempf
For anyone else that has this issue, I solved it - at least for my case.

It turned out to be an order of operations problem. I was calling init() on my LibVlc instance before I had set options like hardware acceleration, etc.

Setting these options first and then calling the init solved the problem.
Those options should now be on the media level.

Re: libVLC on Android: can't see video.

Posted: 16 Jul 2015 13:53
by ebr
Can you please explain what you mean? Looking at the source here:

https://github.com/simonlinj/vlc-androi ... tance.java

All of those options are set when the libVlc instance is created.

Re: libVLC on Android: can't see video.

Posted: 16 Jul 2015 14:38
by Jean-Baptiste Kempf
This is not the source of VLC/Android.

Re: libVLC on Android: can't see video.

Posted: 16 Jul 2015 18:56
by ebr
Okay. Is there a repo with the official source?

Re: libVLC on Android: can't see video.

Posted: 16 Jul 2015 21:16
by Jean-Baptiste Kempf

Re: libVLC on Android: can't see video.

Posted: 16 Jul 2015 22:20
by ebr
Thanks very much.