Page 1 of 1

Android LibVLC

Posted: 11 Feb 2024 00:06
by Gzozo
Hello!

I am building an android app that can play video files remotely. I want to stream video files using SFTP, because it was the easiest and fastest to set up, because i already had an SSH connection to the server. In the official VLC app, both on windows and android plays the file just fine, no issues. But in my app when using libvlc, it just does not work. It keeps stalling, because it seems like it can't load the image according to the log:

Code: Select all

libvlc video output: picture is too late to be displayed (missing 206 ms) libvlc video output: picture is too late to be displayed (missing 82 ms)
I changed almost nothing from the sample:

Code: Select all

@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final ArrayList<String> args = new ArrayList<>(); args.add("-vvv"); mLibVLC = new LibVLC(this, args); mMediaPlayer = new MediaPlayer(mLibVLC); mVideoLayout = findViewById(R.id.video_layout); } @Override protected void onStart() { super.onStart(); mMediaPlayer.attachViews(mVideoLayout, null, ENABLE_SUBTITLES, USE_TEXTURE_VIEW); final Media media = new Media(mLibVLC, Uri.parse(fileUri)); mMediaPlayer.setMedia(media); media.release(); mMediaPlayer.play(); }
I tried almost everything i could find on the internet, enabling/disabling HW decoder, but can't figure out why does this happen. Again, there is no problem with the file, or my network, because from the windows application it streams it fine.
I would really appreciate if someone could help me.

i am using org.videolan.android:libvlc-all:4.0.0-eap14 package

EDIT: One last thing i tried is to test the app on a phone, not just in the emulator, and as it turns out, only the emulator could not keep up, on the phone it worked fine. It's strange, because like 3 weeks ago it worked on emulator too.

Re: Android LibVLC

Posted: 12 Feb 2024 08:31
by unidan
Hi, can you try with 3.6.0-eap11 instead? https://mvnrepository.com/artifact/org. ... .6.0-eap11.

The 4.0.0-* package is the development (unstable) package for VLC and there is roughly 30 000 additional changes between them.

The 3.6.0 package is the one used by VLC Android.