Showing posts with label stream video. Show all posts
Showing posts with label stream video. Show all posts

Friday, January 1, 2021

Raspberry Pi stream camera video using raspivid in rtsp protocol, view in Android using VLC app.

Work on Raspberry Pi 4B/8G running Raspberry Pi OS (32 bit), stream video from Camera Module to port 8000 in rtsp protocol, enter the command:

$ raspivid -o - -t 0 -n -w 800 -h 600 -fps 30| cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8000/}' :demux=h264

where:
-w 800 : width=800
-h 600 : height=600
-fps 30 : 30 frame per second
8000 : the port to stream video

Open VLC App, Open Network Stream
rtsp://<Raspberry Pi IP>:8000/
e.g. rtsp://192.168.1.30:8000/

Thursday, February 7, 2019

Raspberry Pi: Stream video to VLC player, using rtsp protocol.

Stream Camera Module video to network and play the streaming video using VLC player, using rtsp protocol.


In this video:
I enter Raspberry Pi command via VNC Viewer running on Windows 10 to control Raspberry Pi Zero W with VNC enabled, to stream camera video to network using rtsp protocol. In PC side, view the streaming video using VLC Media Player.

In Raspberry Pi side:
Setup under test:
board: Raspberry Pi Zero W
Camera Module: Raspberry Pi Camera Rev 1.3
OS: Raspbian Stretch with desktop and recommended software, release 2018-11-13

Enter the command:
$raspivid -o - -t 0 -n -w 320 -h 240 -fps 30| cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8000/}' :demux=h264

where
-w 320 : width=320
-h 240 : height=240
-fps 30 : 30 frame per second
8000 : the port to stream video

PC side:
OS: Windows 10
Player: VLC Media Player 3.0.6

Open VLC Media Player, click Media > Open Network Stream... > Select Network tab, enter: rtsp://192.168.1.13:8000/

where
192.168.1.13 : the IP of the Raspberry Pi
8000 : the streaming port set at Raspberry Pi side


Tested again@2021-01-01:

Tuesday, August 22, 2017

Tuesday, May 5, 2015

Stream Raspberry Pi Camera Module video using raspivid and vlc

Here show how to stream video from Raspberry Pi Camera Module to network using raspivid and vlc.
Run on Raspberry Pi 2/Raspbian
View on desktop Ubuntu with VLC Media Player
- for sure, you have to enable camera module in your Raspberry Pi/Raspbian setup.

- install vlc:
$ sudo apt-get install vlc

- Run the command in Terminal, or you can make a sh file (remember to make it runnable):
$ raspivid -o - -t 99999 -w 640 -h 360 -fps 25|cvlc stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8090}' :demux=h264

Where 99999 is the length of the video, 99.999 seconds. You can change that to whatever you like. If you change it to 0 (zero) it will carry on indefinitely. (And CTRL+C to kill it at any time).

8090 is the port you assign.

Now you can play the stream video at http:<Raspberry Pi IP>:8090

(reference: http://raspi.tv/2013/how-to-stream-video-from-your-raspicam-to-your-nexus-7-tablet-using-vlc)

In my case, report error of "Invalid PCR value in ES_OUT_SET_(GROUP_)PCR !" Just ignore it, the stream video is playing, and show on RPi main monitor.



Tested on desktop Ubuntu, it can be played with VLC Media Player. On Android devices, Nexus 7 (2012) running Android 5.1, and Samsung Galaxy S3 running Android 4.3, it can be played using MX Player, but not VLC Player (black screen).

If you can develop Android app, you can play it on VideoView. Refer to my another blog: Android-er - Play stream video (from Raspberry Pi) on VideoView, with APK download.



Updated@2016-07-06:
- Re-test on Raspberry Pi 3 + Camera Module V2 NoIR + Raspbian Jessie, play in Windows 10 + VLC Media Player and Android App with VideoView (with APK download).