Refactor video scripts

This commit is contained in:
Vasily Evseenko 2022-12-01 01:20:33 +03:00
parent e2fbeae9ac
commit eae59f2fcf
3 changed files with 14 additions and 8 deletions

View File

@ -1,5 +0,0 @@
#!/bin/bash
set -e
set -o pipefail
gst-launch-1.0 udpsrc port=5600 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! 'video/x-h264,stream-format=byte-stream' ! fdsink | fpv_video
#gst-launch-1.0 udpsrc port=5600 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! h264parse disable-passthrough=true config-interval=1 ! queue ! mmalh264dec ! mmalvideosink sync=false

View File

@ -5,11 +5,11 @@ After=network-online.target
[Service]
## Pipeline for PI camera
ExecStart=/bin/sh -c "gst-launch-1.0 v4l2src do-timestamp=true io-mode=mmap device=/dev/video0 extra-controls="controls,rotate=180,image_stabilization=1,h264_profile=4,h264_i_frame_period=60,h264_level=11,power_line_frequency=1,exposure_metering_mong=1,exposure_dynamic_framerate=0,scene_mode=0,video_bitrate_mode=1,video_bitrate=4000000,repeat_sequence_header=1" ! video/x-h264,profile=high,width=1280,height=720,framerate=30/1,stream-format=byte-stream ! h264parse disable-passthrough=true ! rtph264pay config-interval=1 pt=96 ! udpsink host=127.0.0.1 port=5602 sync=false"
ExecStart=/bin/sh -c "gst-launch-1.0 v4l2src do-timestamp=true io-mode=mmap device=/dev/video0 extra-controls="controls,rotate=180,image_stabilization=1,h264_profile=4,h264_i_frame_period=60,h264_level=11,power_line_frequency=1,exposure_metering_mong=1,exposure_dynamic_framerate=0,scene_mode=0,video_bitrate_mode=1,video_bitrate=4000000,repeat_sequence_header=1" ! video/x-h264,profile=high,width=1280,height=720,framerate=30/1,stream-format=byte-stream ! h264parse disable-passthrough=true ! rtph264pay config-interval=1 pt=96 mtu=1400 aggregate-mode=zero-latency ! udpsink host=127.0.0.1 port=5602 sync=false"
##
## Pipeline for Logitec C920 camera
# ExecStart=/bin/sh -c "gst-launch-1.0 uvch264src device=/dev/video0 initial-bitrate=4000000 average-bitrate=4000000 iframe-period=1000 name=src auto-start=true src.vidsrc ! queue ! video/x-h264,width=1920,height=1080,framerate=30/1 ! h264parse ! rtph264pay ! udpsink host=127.0.0.1 port=5602 sync=false"
# ExecStart=/bin/sh -c "gst-launch-1.0 uvch264src device=/dev/video0 initial-bitrate=4000000 average-bitrate=4000000 iframe-period=1000 name=src auto-start=true src.vidsrc ! video/x-h264,width=1280,height=720,framerate=30/1 ! h264parse disable-passthrough=true ! rtph264pay config-interval=1 pt=96 mtu=1400 aggregate-mode=zero-latency ! udpsink host=127.0.0.1 port=5602 sync=false"
##
## Pipeline for IP Camera

View File

@ -3,7 +3,18 @@ Description=FPV video
After=network-online.target
[Service]
ExecStart=/usr/bin/fpv_video.sh
# RTP legacy
ExecStart=/bin/sh -c "gst-launch-1.0 udpsrc port=5600 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! 'video/x-h264,stream-format=byte-stream' ! fdsink | fpv_video"
# RTSP legacy
#ExecStart=/bin/sh -c "gst-launch-1.0 rtspsrc latency=0 location="rtsp://127.0.0.1:8554/wfb" ! rtph264depay ! 'video/x-h264,stream-format=byte-stream' ! fdsink | fpv_video"
# RTP MMAL
#ExecStart=/bin/sh -c "gst-launch-1.0 udpsrc port=5600 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! h264parse disable-passthrough=true config-interval=1 ! queue ! mmalh264dec ! mmalvideosink sync=false"
# RTSP MMAL
#ExecStart=/bin/sh -c "gst-launch-1.0 rtspsrc latency=0 location="rtsp://127.0.0.1:8554/wfb" ! rtph264depay ! h264parse disable-passthrough=true config-interval=1 ! queue ! mmalh264dec ! mmalvideosink sync=false"
Type=simple
Restart=always
RestartSec=1s