How to stream live video from one PC to an Apache server on a second PC

STRAYDOG0626

So I'm new to Apache servers and LAMP stacks in general.

I'm working on a home website that's gonna show room temperatures and a few other functions using a MySQL server.

I have a Raspberry Pi with a USB camera at my front door and I want to stream it to my Apache server to display the camera's live feed on my website. The PC is running Ubuntu 16.04.5.

confetti

1. Install mjpg-streamer on the Raspberry Pi

Install git: sudo apt-get install git

Clone mjpg-streamer-experimental: git clone https://github.com/jacksonliam/mjpg-streamer/tree/master/mjpg-streamer-experimental - The experimental version worked way better for me on my Raspberry Pi than the regular one, that's why I recommend using it.

Compile it: cd mjpg-streamer-experimental && ./config && make

Create a script that will start the streaming automatically on every boot: nano onboot.sh

#!/bin/bash
cd /home/pi/mjpg-streamer-experimental
./mjpg_streamer -i "input_uvc.so -d /dev/video0 -t pal -r 720x576" -o "output_http.so -w ./www -p 8740"

Replace video0 with your video interface, pal with ntsc if your camera uses ntsc and 720x576 with the resolution of your camera. Then hit CTRL + O to save the file.

You can now run bash ./onboot.sh to test if the streaming works.

We will now use cron (should be pre-installed) to make this script run everytime on boot:

Run crontab -e to edit the current user's crontab and append the following line into it:

@reboot bash /path/to/mjpg-streamer-experimental/onboot.sh

Again CTRL + O to save the file and apply it.

2. On your apache webserver

Now this is very simple. You are able to access mjpg-streamer's interface using http://<your-raspberry-pi-IP>:8740 on any machine in the network. In order to embed the live scream into your website, simple put the following code on the site where you want the stream to be:

<img src="http://<raspberry-pi-IP>:8740/?action=stream" />

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to improve the performance of HoloLens when live streaming video from PC to HoloLens?

One Server, Multiple Websites from a different PC

Apache2 server video streaming compatibility with mobile devices and PC

How to get package list from one PC and install that on another PC?

How to stream a live video from a URL?

How to stream live video from camera in iOS

How to use 4 monitors from one PC

How to move Jenkins from one PC to another

How to access Ubuntu Server from local PC?

Map a drive on one PC from a remote PC

Instagram upload video from pc

How can you get a fast video live stream from your iPhone to a server?

How to stream live video frames from client to flask server and back to the client?

load image from PC as stream

Best way to live stream video from java server to android client?

How to play video discs on PC

How can i access a second laravel app from another pc

ZeroMQ server and client on one PC

How to stream videos over local network to TV from PC

Record pc screen from a second pc with Ubuntu installed and launch an script

How to stream live video from DJI Professional 3 camera?

How to stream live video from android to Wowza via RTMP

How to simply stream video from a remote server?

Server(AndroidWebServer) not reachable from pc

how to transfer a home-dir structure from one linux PC to another linux PC

Live Video Stream on a Node.js Server

How to Transfer Umbraco CMS from One PC to Another

How to copy all programs from one Windows PC to another?

No video from video card or onboard video in new pc build