B4A Library vlcb4a - a B4A wrapper of VLC (Android)

vlcb4a - a B4A wrapper of VLC (Android)

NOTE: As of August 2019, this library is not compliant with Google Play store's latest requirements which require native 64bits libs. It is still useable for apps not being distributed on Google Play Store though. If I can find my original sources and if it is not too complicated, I will try to recompile the sources in order to provide 64bit native libs. That said, things have changed over time and personally I would probably use the ExoPlayer (search the forum) these days unless you have codec-issues. Alternatively, you can use my Vitamio5 library/wrapper which has ARM64 and which is just as powerful as VLC.

This is the 2nd experimental release (Work in progress) of my library attempting to wrap VLC for Android (or parts of it) and its underlying libraries (so-files) and the most important properties/methods of VLC in order to provide a VideoView-object for B4A.

What is VLC for Android?
VLC media player is a free and open source cross-platform multimedia player that plays most multimedia files as well as discs, devices, and network streaming protocols. This is the port of VLC media player to the Android™ platform. VLC for Android can play any video and audio files, as well as network streams and DVD ISOs, like the desktop version of VLC.
VLC for Android is a full audio player, with a complete database, an equalizer and filters, playing all weird audio formats.

The official VLC Android app can be found here:
https://play.google.com/store/apps/details?id=org.videolan.vlc

As mentioned above, the vlcb4a wrapper is not the full Android VLC app but more an attempt to wrap the underlying libraries (so-files) and the most important properties/methods of VLC (its engine) to provide a VideoView-object for B4A. Apparently they are/were planning to write a VideoView-class but there has not been any development on this class for ages and all there is, is a "skeleton-class" of no use since even the related MediaPlayer-class is incomplete.

This wrapper provides its own VideoView class which I have written and compiled into the original VLC-sources based on SDK 3. The SDK can be found here: https://code.videolan.org/videolan/vlc-android/tree/master

This release (version 0.77 of June 27, 2016) adds and includes more features and also fixed some issues (see below for details). I have noted that the vlcb4a plays nearly everything I throw at it.

This is still a "Work in progress" and ETAs for new versions cannot be given. However, I think it should be OK for production by now.

In this moment, I have only compiled the so-sources for ARM but I could compile them also for other platforms such as ARM64, X86 and MIPS. Might add them later though.

The minimum SDK version is 7 (although I have not tried it if it works on such old devices).

See the second post for a current summary of methods, properties and events supported.

You can download the wrapper from here:
https://www.dropbox.com/s/i4d9bul243fc1o4/vlcb4aLIBS_v077.zip?dl=0

I also attach a sample-project (vlcdemo.zip) for B4A.

Note: use a real device
Note2: always use the VideoView object in its own activity. Within this activity, you can then add panels, subtitles and so on as usual. See sample project.

Changes in vlcb4a version 0.77 (June 27, 2016):
  • -added native subtitle support
  • -added possibility to change between 6 different video-sizes
  • -added support for selecting different audio-tracks
  • -added a MediaController (uses the standard Android one for now)
  • -added possibility to add VLC-options. You can add logging,
    OpenSL ES, audio time stretching and more. You can find many more options by googling.

  • added volume controls
  • bug fixes
Please report any bugs and/or post general feedback (negative/positive). This will help to keep me motivated and work on the library further.


Good luck!
 

Attachments

  • vlcdemo.zip
    8.8 KB · Views: 1,462
Last edited:

aidymp

Well-Known Member
Licensed User
Longtime User
Hi, I have just tested this library and its actually impressive, I use vitamino, and FFmpeg, but they both dont seem to play video fullscreen (from streams) this however plays them all fullscreen and if not, centres the output as a TV would! it does seem to crash on occasion (as to be expected as its a pre-release) but very impressive! Well done @moster67

Thanks

Aidy
 

Yngveh58

Member
Licensed User
Longtime User
Hello Monster67
RTSP stream close the program.
Works with VLC Video View 3.VideoURI = "rtsp://192.168.0.122:554/HighResolutionVideo"
Does not VLCVideoview4.VideoURI = "rtsp://192.168.0.123:554/11"
May '/ 11' cause the crash?
"/ 11" indicates 1280x720. "/ 12" indicates the resolution 640x352.

Sincerely Yngve
 

moster67

Expert
Licensed User
Longtime User
Hej,

it should work with /11 or /12 or whatever.
Try with official VLC android app and see if you have same problems and post back.
In any case, this is a wrapper over the latest VLC SDK (version 3) while current VLC Android app is still using SDK version 2 so maybe there are things not working 100% in SDK 3.
Also, my wrapper is experimental and in early stage of development. One bug seems to be that it might not release the resources properly when stopping a stream and then starting a new one. I noted that you wrote VLCVideoview4 and VLCVideoview3 in your post. Make sure, for now, to launch one stream at a time.
 

moster67

Expert
Licensed User
Longtime User
Hello Moster67,
Any idea when you will release the next version? Every week I keep looking in the hope for an update and a solution for the bugs that I described in thread #11 and #12, but so far helas. I wish you lots of success with the next version!
I haven't forgotten...but in this moment I simply don't have available time. It's on my list so I will get there.....
 

Yngveh58

Member
Licensed User
Longtime User
Hej,

it should work with /11 or /12 or whatever.
Try with official VLC android app and see if you have same problems and post back.
In any case, this is a wrapper over the latest VLC SDK (version 3) while current VLC Android app is still using SDK version 2 so maybe there are things not working 100% in SDK 3.
Also, my wrapper is experimental and in early stage of development. One bug seems to be that it might not release the resources properly when stopping a stream and then starting a new one. I noted that you wrote VLCVideoview4 and VLCVideoview3 in your post. Make sure, for now, to launch one stream at a time.
Hej,

it should work with /11 or /12 or whatever.
Try with official VLC android app and see if you have same problems and post back.
In any case, this is a wrapper over the latest VLC SDK (version 3) while current VLC Android app is still using SDK version 2 so maybe there are things not working 100% in SDK 3.
Also, my wrapper is experimental and in early stage of development. One bug seems to be that it might not release the resources properly when stopping a stream and then starting a new one. I noted that you wrote VLCVideoview4 and VLCVideoview3 in your post. Make sure, for now, to launch one stream at a time.

Hello
With VLV player ver 5818104 it works ok.
The program stops when VLCVideoview4.Start executed.
Program closes without error messages so I can not catch exceptions.
I only use one VLCVideoview.
Yngve
 

moster67

Expert
Licensed User
Longtime User
Maybe a resolution issue? Are you using the same codec for /11 and /12?
Unfortunately the version posted here in this thread does not output logfiles from the VLC-engine although the new one I am working on does show them properly. Anyway, take a look if you see something in the unfiltered logs although I doubt it.

You can send me a PM with the streaming link if you wish (just make sure I can access it from remote) and I can take a look.
 

hzytsoft

Member
Licensed User
Longtime User
Hello @Monster67
this lib is goodjob
but can not play sony web cam stream
like this link
rtsp://122.224.143.75/video81

this stream can play by vlc and ffmpeg
when i play with ffmpeg use
ffplay -rtsp_transport tcp rtsp://122.224.143.75/video81

so how to set -rtsp_transport tcp on VLCb4a

Sincerely jim
 

MarcoRome

Expert
Licensed User
Longtime User
Hi dear Mike.
As discussed in this thread with Erel
Your library is great because you can use the same in "services" and is much faster than the Mediaplayerstream
Streamed mediaplayerstream takes about 7 seconds VS 1 second VLC ( and not dependent on the bitrate I tried 64 bit rate and 320 bit rate does not change anything ).
All work without problem, but lost a essential function --> Management Volume.
Can you implement this essential function ?
 

moster67

Expert
Licensed User
Longtime User
New version of vlcb4a:

Changes in vlcb4a version 0.77 (June 27, 2016):
  • -added native subtitle support
  • -added possibility to change between 6 different video-sizes
  • -added support for selecting different audio-tracks
  • -added a MediaController (uses the standard Android one for now)
  • -added possibility to add VLC-options. You can add logging,
    OpenSL ES, audio time stretching and more. You can find many more options by googling.

  • added volume controls
  • bug fixes
Please report any bugs and/or post general feedback (negative/positive). This will help to keep me motivated and work on the library further.
 

moster67

Expert
Licensed User
Longtime User
FYI I didn't update any codecs. They are the same as in the first release.
 

moster67

Expert
Licensed User
Longtime User
@Rick Harris

Like I wrote in the first thread when I first published the wrapper, I will probably publish the sources when I feel it's complete, not before. Beware that the videoview object is mostly my own work and the VideoLan team has asked me if I can publish it when it's ready which I have gladly said I will. In this way, other Java and Android developers will benefit and not only b4a-developers. What regards the wrapper, which is also my work, I have not decided.

So I suggest you to contact VLC if you want further information and an answer to your question. It's up to you if you want to use the wrapper or not. Maybe you need to publish your sources too? I strongly suggest you to do that so you can give back something in return for everything you have had for free and which have been happily provided by other developers including myself. Don't you think?

PS,
You're not spoiling any euforia. I get that for other more important things in the world. Definitely not for a wrapper

Ps2,
What regards Vitamio, already from version 4 a license was required if you were making money out of it. The last free version was version 3.

Ps3,
I have had enough of you by now and I will put you in my ignore list. It will be hard to verify but from now on you are not welcome to use my work.
 
Last edited:

mvera

Active Member
Licensed User
Longtime User
hi thanks for your work.

download vlcdemo.zip but ask me a library that can not find
FLV video displays.?

regards
 

moster67

Expert
Licensed User
Longtime User
In the first post there is a dropbox link for the library.

VLC plays lots of formats so hopefully it will work.
 

scsjc

Well-Known Member
Licensed User
Longtime User
Hello moster, great work ... thanks for share !

one question, i try to play a... m3u audiostream with this library, and dont work.
you think is possible??? or another way to play m3u audiostream???

Thanks
 

moster67

Expert
Licensed User
Longtime User
I have never tried an m3u audiostream. If you want, you can send me a link of a stream by PM and I will try this evening when I'm back from work.
 
Top