Live Video Streaming From Remote Location Using Raspberry Pi
Live Video Streaming From Remote Location Using Raspberry Pi
Indian Journal of Science and Technology, Vol 10(38), DOI: 10.17485/ijst/2017/v10i38/116967, October 2017 ISSN (Online) : 0974-5645
Abstract
Objectives: Through this paper, design of a reliable real-time (Live) video streaming and surveillance system is proposed,
which can be broadcasted over a Local-Area Network (LAN/ WLAN) with remote access. Methods/Statistical Analysis:
Proposed system design features Raspberry Pi along with night-vision camera, programmed using Python programming
language. Raspberry Pi’s IP address is fetched and VNC server is setup to create virtual desktop on host device for remote-
user. Host device is a Personal Computer/Smartphone connected to same LAN/ WLAN on which Raspberry Pi is connected.
VLC media player serves as source for live streaming on host device running a VNC viewer.
Findings: Previously, live video surveillance meant massive machinery, restricted to larger spaces and usually involved
Closed-circuit television cameras. The technological advancements, ease of access and usability in Latter-day gadgets
brought forth easier connectivity, bridging the gap between virtual and the real worlds. This makes dealing with
indispensable concepts like security and surveillance much convenient, even for a remote user. Keeping in mind all these
concepts, an effective; simple yet powerful design for a live video streaming and surveillance system has been proposed.
For effective implementation of the design, Raspberry Pi 3 Model B along with a Raspberry Pi NoIR camera V2 module has
been used and VLC media player acts as the streaming medium for the live video broadcast, initiated by the code written
in Python. VNC server and viewer are used for remote connections over the Local-Area Network. And since a night-vision
camera is being utilized, it allows the user to keep an eye on the area even in dark and low light conditions with ease.
Application/Improvements: The system proposed offers numerous amounts of applications due to its versatility.
Through this design, a hassle-free live video streaming/surveillance may be effortlessly availed even by an average user.
Keywords: Live Streaming, Python, Raspberry Pi, Video Surveillance, Virtual Network Computing, VLC Media Player
1. Introduction etc. has become much easier for the user, also providing
far-flung accessibility. Earlier, video surveillance came
Having an effective video surveillance system is not only with bulky set up which was only confined to larger
beneficial but also adds a sense of surety and comfort to spaces, and conventional set up involved CCTV cameras.
the user1. There may be no better reassurance than hav- Efficient use of the technology and resources can reduce
ing a visual proof. Video monitoring and surveillance all this hassle. The main aim of the proposed design is
have now become much affordable to an average user, to offer easy surveillance of an area, to a distant user via
with widespread technologies providing great usability2. live video streaming on the VLC media player over LAN/
Modern day technology offers devices which are easy to WLAN3. Raspberry Pialong with a night-vision camera
install and convenient to handle. Hence, managing and module is used in design implementation4,5. The code
monitoring the behaviour in spaces like homes, super- for programming the Raspberry Pi and initiating the live
markets, factories, hospitals, hotels, banks, and schools
video, broadcast to the VLC media player is written using effective, credit-card sized computer that connects to a
Python programming language. Further, Virtual Network computer monitor or a TV, and uses a standard mouse
Computing is employed to establish remote connections and keyboard. Raspberry Pi 3 is the third generation
between Raspberry Pi set up and the host device, for Raspberry Pi which replaced Raspberry Pi 2 Model B in
remote accessibility over a Local-Area Network6. Feb’2016. It is one of the most versatile pieces of technol-
ogy. Features offered are7:
• Broadcom BCM2837 64-bit ARMv8 Quad Core
2. System Design and Architecture Processor,
Block diagram of the proposed system is shown in Figure • 1.2GHz speed,
1. Raspberry Pi is interfaced with the camera module and • BCM43143 Wi-Fi with IEEE 802.11b/g/n support,
then VNC server is enabled on it as well as host machine. • Bluetooth,
Authenticated remote user will now be able to access • 1GB RAM, and
the Raspberry Pi’s desktop from a host device i.e. a PC • 40pin extended GPIO.
or a Smartphone running a VNC viewer; connected over
LAN/WLAN.Once the code (Python script) for the live Raspberry Pi is the primary module; initially plugged to a
video stream is initiated, VLC media player starts broad- monitor, connected to the LAN/WLAN for the first boot
casting the HD video over the Local-Area Network. and then its IP address is configured, which is later on used
for establishing remote connections via VNC i.e. Virtual
2.1 Overview of Raspberry Pi Network Computing. Once the VNC server is setup,
Raspberry Pi along with the camera module can now be
The proposed system is implemented using a Raspberry
accessed on a host device with VNC viewer. Raspberry
Pi 3 Model B shown in Figure 2. Raspberry Pi is a cost-
Pi 3 runs on the Raspbian OS and is programmed using
Python.
2 Vol 10 (38) | October 2017 | www.indjst.org Indian Journal of Science and Technology
S. Neha Vimala, M. Veda Chary and K. Ravi Kiran
Vol 10 (38) | October 2017 | www.indjst.org Indian Journal of Science and Technology 3
Live Video Streaming from Remote Location Using Raspberry Pi
4 Vol 10 (38) | October 2017 | www.indjst.org Indian Journal of Science and Technology
S. Neha Vimala, M. Veda Chary and K. Ravi Kiran
Vol 10 (38) | October 2017 | www.indjst.org Indian Journal of Science and Technology 5
Live Video Streaming from Remote Location Using Raspberry Pi
USB power supply or an equivalent battery pack. Once nected to same LAN/WLAN on which Raspberry Pi
the Raspbian operating system is installed, the initial is connected. The Raspberry Pi can now be connected
boot completes as shown in Figure 7. The Raspberry remotely without being plugged into a monitor. In order
Pi is then connected to the internet over LAN/WLAN to access the Raspberry Pi’s desktop on a host device,
and Pi’s IP address is fetched; camera interface, as well the user needs to login to the VNC viewer by providing
as VNC server, is enabled. In order to establish the the previously set password. The device authenticated is
remote connections over VNC server, the user needs listed by the name ‘Raspberry Pi’ by default; clicking on
to sign up for the service by providing working email it and providing the password establishes the connection
address and a secure password for authentication. Now between Raspberry Pi and the host device. Once the con-
that the VNC server is setup as shown in Figure 8. VNC nection is established, the Raspberry Pi’s GUI appears
viewer is downloaded on the host device for accessing on a window on the host machine, as shown in Figure
the Raspberry Pi’s desktop remotely. The VNC server 9. For the camera to start the live stream and broadcast
creates a virtual desktop onto the VNC viewer which it over the Local-Area Network on a VLC media player,
only exists in Raspberry Pi’s memory. Now, VLC media the equivalent code needs to be run on the Pi terminal,
player which is the streaming medium for the live to command VLC to start accessing camera for the same.
video broadcasted over Local-Area Network is down- The code for design execution is implemented in Python
loaded on both Raspberry Pi as well as the host device. programming language. Functional flow chart is repre-
The host device can be any PC or Smartphone con- sented in Figure 10.
6 Vol 10 (38) | October 2017 | www.indjst.org Indian Journal of Science and Technology
S. Neha Vimala, M. Veda Chary and K. Ravi Kiran
Vol 10 (38) | October 2017 | www.indjst.org Indian Journal of Science and Technology 7
Live Video Streaming from Remote Location Using Raspberry Pi
5. Results and Discussions commanding it to start streaming the data coming in,
into the 8160 port on Raspberry Pi’s IP address; and the
The Raspberry Pi board is interfaced with the camera mod- output is encoded in h264, which is a format used high
ule, powered up using a battery pack is set in the location definition video files. Finally, VLC media player is opened
for remote surveillance over WLAN. It is then connected on the host device and the Raspberry Pi’s IP address along
to the host machine through VNC server. Raspberry Pi’s with HTTP protocol is fed into the network stream bar;
desktop is then accessed on the host running with VNC then hitting ‘play’ starts the live stream.
server. The code for initiating the live stream onto the The proposed system is implemented and the results
VLC media player is entered in Raspberry Pi terminal. have been reported. The results have been verified on
Once the code is run, Raspberry Pi’s ‘vid’ command is both PC operating on Windows and an Android operated
used to start using the camera for video capture with zero Smartphone as host machines as shown in Figure 11. The
delay, following which the captured image is flipped verti- VNC server and the VLC media player are downloaded
cally with a width of 800pixels and a height of 400pixels from the Google App Store when Smartphone is the host
with 20fps i.e. 20 consecutive images are captured per as shown in Figure 12.
second. Then, its output is sent to the VLC media player
8 Vol 10 (38) | October 2017 | www.indjst.org Indian Journal of Science and Technology
S. Neha Vimala, M. Veda Chary and K. Ravi Kiran
Vol 10 (38) | October 2017 | www.indjst.org Indian Journal of Science and Technology 9
Live Video Streaming from Remote Location Using Raspberry Pi
10 Vol 10 (38) | October 2017 | www.indjst.org Indian Journal of Science and Technology