Git Product home page Git Product logo

vlc-example-streamplayer's Introduction

vlc-example-streamplayer

Release

Example code how to play a stream with VLC.

Use this endpoint for test:

rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov

Consider using the latest official compiled VLC version:

https://mvnrepository.com/artifact/org.videolan.android/libvlc-all

https://code.videolan.org/videolan/vlc-android#build-application

Gradle

Compile my wrapper:

allprojects {
  repositories {
    maven { url 'https://jitpack.io' }
  }
}
dependencies {
  compile 'com.github.pedroSG94.vlc-example-streamplayer:pedrovlc:2.5.14v3'
}

Compile only VLC (version 2.5.14):

allprojects {
  repositories {
    maven { url 'https://jitpack.io' }
  }
}
dependencies {
  compile 'com.github.pedroSG94.vlc-example-streamplayer:libvlc:2.5.14v3'
}

vlc-example-streamplayer's People

Contributors

pedrosg94 avatar yashvanzara avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vlc-example-streamplayer's Issues

support libvlc-android:2.1.12

Hello,
I cannot make the library work when I add
compile 'de.mrmaffen:libvlc-android:2.1.12@aar'
instead of
compile 'de.mrmaffen:vlc-android-sdk:2.0.6'

When I press "Start player", only static image (may be just first frame from camera) is shown, but it is not updated anymore (RTSP stream plays is ok with version 2.0.6) - I wanted to try new version because stop() function hangs sometimes for few seconds, when I call it after the connections is dropped (like VLC is waiting for some timeout and VLCVideoLibrary.player.stop(); is being blocked for some time), so I wanted to try if it is fixed

How to calculate network latency

Hi, Mr. Sánchez!

Is there any way to extract the timestamp from the RTP packets sent by the server after being received at the client using this library? My goal is to calculate network latency.

Thank you very much in advance.

Reconnecting

How can i reconnecting it back if the host streaming has some interruption?

I try to initalize everything again but got this error E/VLC: [00000075cd32e890/399a] libvlc decoder: failed to create video output

Problem with connection player.

Hi, I have problem as below. It happen when I try start play stream with delay. My app works like VideoChat, I call to other user and waiting on his connection, when user response, app should start play his stream, but it not working as well, but when user call to me and stream is already existing the problem disappears. I tried start player with delay but it still not works.

2021-01-18 09:46:59.067 2851-3852/com.datezoneapp E/VLC: [00000076c11fbc90/f0c] libvlc input: Your input can't be opened
2021-01-18 09:46:59.067 2851-3852/com.datezoneapp E/VLC: [00000076c11fbc90/f0c] libvlc input: VLC is unable to open the MRL 'rtsp://93.179.237.166:8086/live/vc49eca4981af52bffd8390331751fefa3'. Check the log for details.

Images stuck

The screen will get stuck when the phone is locked.How do you do that?

it

it can not work, i download the demo and run on android device. And use the address"rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov" under the code ,but it can not work...

surfaceview can not be full on SCREEN_ORIENTATION_LANDSCAPE

Hi I have a surfaceView which has been set Match_Parent for both width and height
but when I rotate the layout with the below function:

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

the frame inside the surfaceView can not be full, please help me to solve this issue, thank you

Recording Video

Hi,
Thanks a lot for the project. The code is working. What should i do if i want to record the video? Thanks a lot.

The app realse is to big

my app is 4 mb , after add library 'com.github.pedroSG94.vlc-example-streamplayer:pedrovlc:2.5.14v3'
it become 60 mb why ?

Getting Current Frame

Is there a way to grab the current rendered frame by VLC (on a TextureView or SurfaceView)?

I was directed to inject an OpenGL ES code snippet to where the VLC is rendering in order to get the current frame into a ByteBuffer using for example, GLES20.glReadPixels(...), then parsing that buffer into a Bitmap. However, it seams that VLC is making the rendering process in a native way where i searched the vlc-android sdk for OpenGL usages in java and i found nothing.

Thanks.

How to record streaming in player?

I am using pedro vlc to live stream rtsp url from cp-plus ip camera.
How can I record the live stream and save it to local device?
Can you please guide?

Video capture

very thanks for your demo about vlc , i have a problem about video capture , how can i do get video capture or where can i get rtsp fream ,thank u!

Could be possible to set VlcOptions

On class VlcVideoLibrary

We could pass VlcOptions as a parameter like

public VlcVideoLibrary(Context context, VlcListener vlcListener, SurfaceView surfaceView, ArrayList<String> defaultOptions)

Here we have option of add some flags

Video stops as soon as app goes to background

Hello,

Currently as soon as the app goes to background, the video stops and does not resume when app comes into foreground again. The only way currently is to stop the video in onPause of activity and restart in onResume. Is there a way to keep the video playing in background? I checked and the libVLC supports playing video in background since version 1.x. How can we enable the vlc provided feature?

Thanks

terminating with uncaught exception of type St9bad_alloc: std::bad_alloc" failed

Hii,
RTMP video playing is stop after some time and I get following error and after app close.
And i uses Nexus 5(Marshmallow 6.0.1) for testing.

A/libc: /usr/local/google/buildbot/src/android/ndk-r14-release/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:74: void abort_message(const char *, ...): assertion "terminating with uncaught exception of type St9bad_alloc: std::bad_alloc" failed

Video size not adapting to fill view

Hi,
I've a recycler view with multiple cameras.
I've managed to get the various rtsp streams and display them. My problem is that the videos don't fill the SurfaceView, but are resized in the left-bottom corner of the view. How can I fill the view with the videos, maintaining their aspect ratio?
Thanks

Missing License?

I played around with this code today and it works quite well. However, it would be nice if a license was made available. I'm currently using this code for learning purposes, and personal use only.

How to set 'center crop' video

I am working on live streaming application like facebook live
I want to stream video without black border like same as 'center crop' image.
Please help me to show video like this.

I have tried aspect ration but not getting proper output.

After sometimes of streaming, the app is stopping to stream

Hi,

could anyone help how to fix below issue.

Scenario-1:
After sometimes of streaming, the app is stopping to stream and giving below error.
Scenario-2:
If surface view made View.INVISIBLE for 5 mins, the same issue is happening.

Please check the log.

2021-09-17 16:47:46.011 17065-17655/com.test.cam D/VLC: [dab8a530/44f7] libvlc decoder: killing decoder fourcc `hevc'
2021-09-17 16:47:46.011 17065-17655/com.test.cam D/VLC: [dab8a530/44f7] libvlc decoder: removing module "avcodec"
2021-09-17 16:47:46.063 17065-17655/com.test.cam D/VLC: [bf1ca9f0/44f7] libvlc generic: saving a free vout
2021-09-17 16:47:46.063 17065-17655/com.test.cam D/VLC: [bf1ca9f0/44f7] libvlc generic: reusing provided vout
2021-09-17 16:47:46.064 17065-17655/com.test.cam D/VLC: [dab8acb0/44f7] libvlc packetizer: removing module "hevc"
2021-09-17 16:47:46.064 17065-17655/com.test.cam D/VLC: [d7784230/44f7] libvlc video output: destroying useless vout
2021-09-17 16:47:46.064 17065-17669/com.test.cam D/VLC: [bf289030/4505] libvlc vout display: removing module "gles2"
2021-09-17 16:47:46.065 17065-17669/com.test.cam D/VLC: [bf2f4cb0/4505] libvlc gl: removing module "egl_android"
2021-09-17 16:47:46.068 17065-17655/com.test.cam D/VLC: [bedf2530/44f7] libvlc spu text: removing module "freetype"
2021-09-17 16:47:46.070 17065-17655/com.test.cam D/VLC: [b2c21b30/44f7] libvlc scale: removing module "yuvp"
2021-09-17 16:47:46.070 17065-17655/com.test.cam D/VLC: [bedf6b30/44f7] libvlc scale: removing module "swscale"
2021-09-17 16:47:56.291 17065-17655/com.test.cam W/VLC: [dab197d0/44f7] libvlc demux: no data received in 10s, eof ?
2021-09-17 16:47:56.291 17065-17655/com.test.cam D/VLC: [bf057830/44f7] libvlc input: EOF reached
2021-09-17 16:47:56.292 17065-17655/com.test.cam D/VLC: [dab197d0/44f7] libvlc demux: removing module "live555"
2021-09-17 16:47:56.296 17065-17655/com.test.cam D/VLC: [bf057830/44f7] libvlc input: Program doesn't contain anymore ES

Support for streamed video recording

Hello, I tried this library and works pretty well for rtsp videos. Is there any option for recording the streaming video from the library itself?
Thanks

缓冲值

如何设置缓冲值呢?How do I set the buffer value?

Support for RTSP/TCP ?

HI :)

I notice that your RTSP stream rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov is an RTSP/UDP, will you player support RTSP/TCP streams as well, like the one coming out of red5 servers

Thanks a lot

libvlc video output: picture is too late to be displayed (missing 30 ms)

I am using android studio 3.5.2 on Windows 10.
Deploying this app to my Samsung Android Galaxy , Android version 6.0.1.

I am viewing from a stream created on another Android by "IP Webcam" server.
It transmits rtsp live feed.
There is about 3 seconds latency from the object appearing in front of Camera and the player displaying the new object.
If I view the same url via it's web page, it shows it instantly, on the same Android where I am running this player.
This proves that there no latency either on the server, nor network issues on the player side either.
How can I eliminate the latency or the delayed response of the client?
vlc_client.log
MainActivity.txt

Get current playing content media info

Hey,

How to get media info such as codec, fps, resolution, bitrate? I tried player.getCurrentVideoTrack(). but no result. I am getting only codec info. rest all set to zero.

Please tell me how to get those information

3:4 Aspect ratio issue

@pedroSG94 I am playing video having aspect ratio 3:4 using surface view and its stretching video. Can you help me how can I play all type of aspect ratios.

Does this project support Adaptive Bitrate Streaming?

I have set up the "Stream Group Name" of Transcoder on the Wowza Streaming Engine server to provide the SMIL files to playback client. Does this VLC player automatically apply the "auto changing resolution and fps"? Thank you.

KLV data extraction

Is there any way I can access input data of your Player. I need to extract KLV values and I can not find a way to access input stream.

mute/unmute audio

Is there a way to toggle audio level (mute/unmute) while its playing?

Thanks!

FindClass(org/videolan/libvlc/Media$Track) failed

Hi,
I hope you have an awesome day.

As soon as I download my app with your library from the Play Store (Alpha-Release) I get an error that says:

2019-03-20 16:35:49.803 7092-7092/? E/VLC/JNI/VLCObject: FindClass(org/videolan/libvlc/Media$Track) failed
2019-03-20 16:35:49.804 7092-7092/? E/VLC: VLCJNI_OnLoad failed
2019-03-20 16:35:49.804 7092-7092/? E/VLC/LibVLC: Can't load vlcjni library: java.lang.UnsatisfiedLinkError: JNI_ERR returned from JNI_OnLoad in "/data/app/com.agenturueberall.gfa4-1n32F-JstKjstSILMXci-w==/lib/arm64/libjniloader.so"

  1. Is this a proguard error and can you give me the proguard rules for this library?
  2. Why doesn't it happen with my locally installed release version?
  3. Do you have an idea how to solve the problem?

All the best and thank you,
Emanuel

Use vlc on a specific network

Hey,

I'm using this in-app and trying to connect to an RTSP wifi camera whilst being still connected to 4g/cellular network.
If I run this by default it doesn't connect to the camera, if I use ConnectivityManager and call mConnectivityManager.bindProcessToNetwork(network); when network is the wifi network of the RTSP camera, I do get the stream but the rest of the app is not working (all transport goes through wifi) while it should use 4g. Any way to use VLC on a specific network? Maybe setting the socket itself, Tried looking into the lib code but ended up on a dead end when reached the JNI calls.

Any help with this?
Much appreciated!

Update:
Tried to use iface and iface-addr options but no luck for me, should it work?

no data received in 10s. Switching to TCP

When I try to load a rtsp stream from one of my camera it will take long time and then play it after mentioning "switching to TCP". After this line its quick to load the video

2019-07-02 18:09:22.086 W/VLC: [c37681d0/52ce] libvlc demux: no data received in 10s. Switching to TCP
2019-07-02 18:09:22.102 W/VLC: [c37681d0/52ce] libvlc demux: Password in a URI is DEPRECATED
2019-07-02 18:09:23.913 E/VLC: [cd209430/52ce] libvlc decoder: buffer deadlock prevented
2019-07-02 18:09:24.460 W/VLC: [cd209430/52ff] libvlc decoder: Exception occurred in MediaCodecInfo.getCapabilitiesForType
2019-07-02 18:09:24.462 W/VLC: [cd209430/52ff] libvlc decoder: Exception occurred in MediaCodecInfo.getCapabilitiesForType
2019-07-02 18:09:24.464 W/VideoCapabilities: Unrecognized profile 2130706433 for video/avc
2019-07-02 18:09:24.464 W/VideoCapabilities: Unrecognized profile 2130706434 for video/avc
2019-07-02 18:09:24.528 E/VLC: [949fd330/5305] libvlc window: request 1 not implemented
2019-07-02 18:09:24.528 E/VLC: [949fd330/5305] libvlc window: request 1 not implemented
2019-07-02 18:09:24.566 E/VLC: [949fd330/5305] libvlc window: request 0 not implemented
2019-07-02 18:09:24.566 E/VLC: [949fd330/5305] libvlc window: request 0 not implemented
2019-07-02 18:09:24.566 E/VLC: [949fd330/5305] libvlc window: request 1 not implemented
2019-07-02 18:09:24.617 E/VLC: [949fd330/5305] libvlc window: request 1 not implemented
2019-07-02 18:09:24.636 E/VLC: [949fd330/5305] libvlc window: request 0 not implemented
2019-07-02 18:09:24.636 E/VLC: [949fd330/5305] libvlc window: request 0 not implemented
2019-07-02 18:09:24.636 E/VLC: [949fd330/5305] libvlc window: request 0 not implemented
2019-07-02 18:09:24.667 E/VLC: [949fd330/5305] libvlc window: request 1 not implemented
2019-07-02 18:09:25.642 E/VLC: [949fd330/5305] libvlc window: request 3 not implemented
2019-07-02 18:09:27.503 W/VLC: [cd59d730/5305] libvlc video output: picture is too late to be displayed (missing 97 ms)
2019-07-02 18:09:27.503 W/VLC: [cd59d730/5305] libvlc video output: picture is too late to be displayed (missing 28 ms)
2019-07-02 18:09:33.782 W/VLC: [cd59d730/5305] libvlc video output: picture is too late to be displayed (missing 23 ms)
2019-07-02 18:09:34.470 W/VLC: [cd59d730/5305] libvlc video output: picture is too late to be displayed (missing 665 ms)
2019-07-02 18:09:34.509 W/VLC: [cd59d730/5305] libvlc video output: picture is too late to be displayed (missing 634 ms)
2019-07-02 18:09:34.575 W/VLC: [cd59d730/5305] libvlc video output: picture is too late to be displayed (missing 640 ms)
2019-07-02 18:09:34.644 W/VLC: [cd59d730/5305] libvlc video output: picture is too late to be displayed (missing 651 ms)
2019-07-02 18:09:34.710 W/VLC: [cd59d730/5305] libvlc video output: picture is too late to be displayed (missing 644 ms)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.