Ticker

6/recent/ticker-posts

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::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: picturedmagazine - 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).


إرسال تعليق

0 تعليقات