User:Saul/Raspberry Pi

From Organic Design wiki
< User:Saul
Revision as of 17:38, 20 February 2020 by Saul (talk | contribs) (Streaming Video)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Useful Links

Camera

To take an image run:

raspistill -o image.jpg


To take a video run:

raspivid -o video.h264 -t TIME


For more options:

raspistill
raspivid

Streaming Video

Make sure NetCat (nc) and mplayer is installed.

To listen for the Pi's stream run (on another computer):

nc -l -p 5001 | mplayer -fps 60 -cache 1024

And to stream to the computer from the Pi run (on the Pi), be sure to replace ADDR with your computers address:

raspivid -t 999999 -o - | nc ADDR 5001

Low Latency (Outdated)

The lowest latency I was able to achieve was from setting up the Pi in an Ad-Hoc configuration and using gstreamer to stream the video.

Install (PC)

To install gstreamer:

sudo apt-get install python-gi python3-gi \
    gstreamer1.0-tools \
    gir1.2-gstreamer-1.0 \
    gir1.2-gst-plugins-base-1.0 \
    gstreamer1.0-plugins-good \
    gstreamer1.0-plugins-ugly \
    gstreamer1.0-plugins-bad \
    gstreamer1.0-libav

And listen for a stream:

gst-launch-1.0 -v tcpclientsrc host=PI_IP_ADDR port=5000  ! gdpdepay !  rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false

Install (Pi)

Take from Here.

Add the required repo:

echo "deb http://vontaene.de/raspbian-updates/ . main" >> /etc/apt/sources.list

Install gstreamer:

sudo apt-get update
sudo apt-get install gstreamer1.0

Then start streaming using:

raspivid -t 999999 -h 720 -w 1080 -fps 25 -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse !  rtph264pay config-interval=1 pt=96 ! gdppay ! tcpserversink host=PI_IP_ADDR port=5000

Disabling Camera LED

Edit the /boot/config.txt file and ensure there is the following line at the bottom:

disable_camera_led=1

Converting h264 to mp4

MP4Box -add vid.h264 output.mp4

Android SSH

Use app juicessh

See also