Android Question Video Streaming with HTTPServer

Ibrahim Saleh

Member
Licensed User
Longtime User
Hello Community,
I have been researching this for a while now, but could not find any solution in B4A. I would like to stream a video found on users phone using http server. Now i think the HTTPServer lib is limited some how cuz it doesnt allow me to access the outputstream. Also this stream must be capable to handle seek using range header sent to the local Server. If anyone can help me with this i would appreciate it very much.
 

moster67

Expert
Licensed User
Longtime User
I have tested streaming a video stored on a user's phone to another phone with good results.

For streaming the source, I used my ffmpegencoder library. For showing the video in real-time on the receiving phone, I used my Vitamio5 library but you could probably use another video player depending on the codec and transport protocol you have set up to use with FFmpeg.
 
Upvote 0

moster67

Expert
Licensed User
Longtime User
Here is a quick demo video using ffmpegencoder and vitamio as mentioned in my earlier post.

I am using TeamViewer to access my device from which I am streaming using ffmpeg and then I show the video with Vitamio using the emulator.
The video on the emulator has some artifacts due to the fact that my PC is using nearly all my RAM and also I didn't center the video in Vitamio.
It works and the video is shown perfectly using a real device.

Edit: By the way, the usage of TeamViewer was only to let me make a screencast and make a demo so I could send it up to YouTube. TeamViewer is not necessary for this solution.

This solution works fine in a LAN. To use it outside of a LAN, I think you will either need to use a VPN (a private tunnel) or set up some port forwarding on your rooter. However, you could use a server in the middle. There might be other networking solutions too.

 
Last edited:
Upvote 0

Ibrahim Saleh

Member
Licensed User
Longtime User
Thank you for the quick reply guys.
Altho what i really wanted is to play the video from byte array. And the only solution to that is to use a local server and stream the video using that. This is a reference link in stackoverflow on how to do it in java. I need to do this using b4a.
 
Upvote 0

CyberDroidWare

Member
Licensed User
Anyone had luck with streaming live video? Can you access the binary of the camera input and work with it directly? Alternatively, if you can record to MPEG, would the file be locked to avoid you from opening it in another thread and taking the binary directly from the file in frames to stream?
 
Upvote 0
Top