Explorer/RaspberryPi/Softwares

From PaparazziUAV
Revision as of 10:15, 22 June 2020 by Xp31 (talk | contribs)
Jump to navigation Jump to search
  • Install softwares
sudo apt-get update
sudo apt-get upgrade
(20 minutes)
sudo apt-get install gstreamer1.0-plugins-base -y
sudo apt-get install gstreamer1.0-plugins-good -y
sudo apt-get install gstreamer1.0-plugins-bad -y
sudo apt-get install gstreamer1.0-plugins-ugly -y
sudo apt-get install gstreamer1.0-libav -y
sudo apt-get install gstreamer1.0-omx -y
sudo apt-get install gstreamer1.0-tools -y
  • Check installation with camera unicast
                      | --> camera1 (x-h264) 
raspivid (x-h264) --> |   
                      | omxh264dec --> camera2 (x-raw,I420) 

Server:

raspivid -t 0 -w 640 -h 480 -fps 30/1 -b 3000000 -g 5 -vf -hf -cd H264 -n -fl -ih -o - 
  | gst-launch-1.0 fdsrc 
  ! h264parse 
  ! video/x-h264,stream-format=byte-stream 
  ! tee name=streams 
  ! omxh264dec 
  ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=0 
  ! shmsink socket-path=/tmp/camera2 wait-for-connection=false sync=false streams. 
  ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=0 
  ! shmsink socket-path=/tmp/camera1 wait-for-connection=false sync=false
gst-launch-1.0 shmsrc socket-path=/tmp/camera1 do-timestamp=true 
  ! video/x-h264,stream-format=byte-stream,alignment=au 
  ! rtph264pay name=pay0 pt=96 config-interval=1 
  ! udpsink host=CLIENTIP port=5000
gst-launch-1.0 shmsrc socket-path=/tmp/camera2 do-timestamp=true is-live=true 
 ! video/x-raw,format=I420,width=640,height=480,framerate=15/1 
 ! omxh264enc 
 ! video/x-h264,profile=high 
 ! rtph264pay name=pay0 pt=96 config-interval=1 
 ! udpsink host=CLIENTIP port=5100

Client: (port 5000 and 5100)

gst-launch-1.0 udpsrc port=5000 
 ! application/x-rtp, encoding-name=H264,payload=96 
 ! rtph264depay 
 ! h264parse 
 ! avdec_h264 
 ! videoconvert 
 ! autovideosink sync=false
  • Install Server-RTP
sudo apt-get install libglib2.0 -y
sudo apt-get install libgstreamer1.0-dev -y
sudo apt-get install libgstreamer-plugins-base1.0-dev -y
gst-launch-1.0 --version
=> gst-launch-1.0 version 1.14.4
wget http://gstreamer.freedesktop.org/src/gst-rtsp-server/gst-rtsp-server-1.14.4.tar.xz
tar -xf gst-rtsp-server-1.14.4.tar.xz
rm gst-rtsp-server-1.14.4.tar.xz
cd gst-rtsp-server-1.14.4/
./configure
~/gst-rtsp-server-1.14.4/examples/test-launch.c 
patched with second stream 
 GstRTSPMediaFactory *factory2;
 factory2 = gst_rtsp_media_factory_new ();
 gst_rtsp_media_factory_set_launch (factory2, argv[2]);
 gst_rtsp_mount_points_add_factory (mounts, "/test2", factory2);
cd ~/gst-rtsp-server-1.14.4
make
sudo make install
  • Check installation with camera unicast