Android video streaming example -


I want to implement video streaming in my project. So, is there a tutorial that works? Videos are stored on the server side. Therefore, using the URL to play video on android. I tried some examples, but I got an error, "Sorry, this video can not be played" I am trying to use the MP3.

I had the same problem, but in the end I found the way.

1 - Install VLC on your computer (Server) and go to Media-> Streaming (Ctrl + S)

2- Choose a file to stream or if you want to Want to stream a webcam or ... click on the "Capture Device" tab and click on the "Stream" button. 3- Here you must do the streaming server configuration, just go to the "Options" tab and paste the following command:

 : sout = # transcode {vcodec = mp4v, Vb = 400, fps = 10, width = 176, height = 144, acodec = mp4a, ab = 32, channel = 1, sample = 22050}: rtp {sdp = rtsp: // YOURCOMPUTER_SERVER_IP_ADDR: 5544 /}   

Note: YOURCOMPUTER_SERVER_IP_ADDR with your computer's IP address or any server that is running VLC ...

Note: You can see, the video The codec is MP4V which is supported by Android.

4- To create and create a new project, media playback Create a VideoView object and write some code in the OnCreate () function:

  mVideoView = (VideoView ) FindViewById (R.id.surface_view); MVideoView.setVideoPath ("RTSP: // YOURCOMPUTER_SERVER_IP_ADDR: 5544 /"); MVideoView.setMediaController (new MediaController (this)); 5- Run an APK on the device (not a simulator, I did not check it) and wait for the playback to start. Please note that the buffering process will take approximately 10 seconds ...  

Question: Anyone know about reducing buffering time and making video almost live?

Comments