Components Required

  • Raspberry Pi 2
  • Wi-Fi module
  • Camera module

Softwares Required

VLC media player or Quicktime media player

Steps

  1. Connect Camera to Raspberry Pi.
  2. Enable Camera in Raspberry Pi Configuration file.
  3. Establish a local wireless network and connect the Raspberry Pi to it.
  4. Install VLC program on Raspberry Pi
  5. Executing Streaming command specifying communication protocol (RTSP) and port.
  6. Now you can see the streaming on any Client connected to the same network.

Real Time Streaming Protocol (RTSP)

The Real Time Streaming Protocol (RTSP) is a network control protocol designed for use in entertainment and communications systems to control streaming media servers. The protocol is used for establishing and controlling media sessions between end points. Clients of media servers issue VCR-style commands, such as play and pause, to facilitate real-time control of playback of media files from the server.

The transmission of streaming data itself is not a task of the RTSP protocol. Most RTSP servers use the Real-time Transport Protocol (RTP) in conjunction with Real-time Control Protocol (RTCP) for media stream delivery, however some vendors implement proprietary transport protocols. The RTSP server software from Real Networks, for example, also used Real Networks’ proprietary Real Data Transport (RDT).

The RTSP (Real Time Streaming Protocol) protocol is a client-server multimedia presentation control protocol, designed to address the needs for efficient delivery of streamed multimedia over IP networks. It leverages existing web infrastructure (for example, inheriting authentication and PICS from HTTP) and works well both for large audiences as well as single-viewer media-on-demand.

Real Networks, Netscape Communications and Columbia University jointly developed RTSP within the MMUSIC working group of the Internet Engineering Task Force (IETF). In April 1998, it was published as a Proposed Standard by the IETF.

VLC media Player

Streaming The Camera Video Using RTSP

Enter the following command to start the streaming:

raspivid -o - -t 0 -n | cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/}' :demux=h264
  • raspivid is used to capture the video
  • “-o -” causes the output to be written to stdout
  • “-t 0” sets the timeout to disabled
  • “-n” stops the video being previewed (remove if you want to see the video on the HDMI output)
  • cvlc is the console vlc player
  • “-vvv” and its argument specifies where to get the stream from
  • “-sout” and its argument specifies where to output it to

Options available

Specifying the camera resolution

raspivid -o - -t 0 -n -w 600 -h 400 -fps 12 | cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/}' :demux=h264
  • -w Width available range: 64 to 1920
  • -h Height available range: 64 to 1080
  • -fps Frames per second: 2 to 30

Viewing the RTSP Stream over the Network

You need a player which supports RTSP, for instance VLC, QuickTime, etc.  Open a network stream using

rtsp://<Raspberry Pi IP Address>:8554/
Categories: Electronics

2 Comments

Mark Villela · July 3, 2017 at 6:42 pm

Hi Mandar. I couldn’t make this work on my RPi3. I noticed that some of your dashes are longer than the standard dash: “–” versus “-“. VLC behaved better after I made the swap, and the server has no error messages, but I was still not able to display the stream on the client.

    Mandar Gogate · July 6, 2017 at 7:18 am

    Hi Mark,

    1. Did you debug the camera to see if it’s working?
    2. Is the stream working when you connect RPi with client using Ethernet?
    3. Did you establish a local wireless network between RPi and client? Sometimes wireless router restricts p2p connection.

Leave a Reply

Related Posts

Electronics

Air Mouse | Gesture Mouse | STM32 + IMU + Bluetooth | DIY Wireless Mouse

Motivation Since the invention of the computer mouse interface, there have been no major changes in its design. The way we interact with computers through keyboards and mice are still the same as they first Read more…

Electronics

Advanced Compilers for Embedded Systems

Authors: Mandar Gogate, Abhishek Taur Abstract The increasing complexity and high-efficiency needs of embedded systems call for the need of better compiler design for embedded systems. Conventional compilers don’t meet the basic needs of embedded systems Read more…

Electronics

Review of Clustering Protocols in Wireless Sensor Networks

Abstract Over the past decade, there has been significant rise in the interests for the potential utilization of wireless sensor networks(WSNs) in an extensive variety of applications and it has turned into a widely researched Read more…

%d bloggers like this: