B4J Question webcam stream live video (B4J Server)

Douglas Farias

Licensed User
Longtime User
Hi all.

I'm working on a website where on a page there will be the option to turn on the webcam and start a live stream.

On another page I must show the live stream for other people to watch, show the video and the audio too ...

I searched the forum and found the example of CCTV. however I noticed in some comments that it is only for low fps and also does not transmit the audio, only the video (image).

Is there any way to make a live stream on B4J (server) with audio and good image quality?


If it is possible, could you guide me on which way to go?
should I save the images / audios in a database for later viewing?

What would be the correct way to do this?

note: the live stream will start via the browser, html5 supports turning on the webcam and transmitting audio and images, my question is, how to receive html data (webcam) save to b4j (db) to display on the site soon after, in real time.
I noticed in some examples on the internet that html5 uses canvas, but I was confused on how to save this in a db.

thanks, any help is welcome!


B4X founder
Staff member
Licensed User
Longtime User
The MJPEG server (https://www.b4x.com/android/forum/threads/73792/#content) creates a MJPEG stream. This is a stream of individual frames without audio.

A real video requires more sophisticated encoding. You might be able to use FFMPEG as an external tool controlled with jShell.
Upvote 0


Licensed User
Longtime User

Upvote 0