From 074bd624087555bbe1874c9d88ee928b6f2504c4 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Tue, 2 Apr 2024 19:42:04 +0200 Subject: [PATCH] improve/export decoding pipelines --- package.sh | 17 ++--------------- systemd/h264_decode.service | 14 ++++++++++++++ systemd/h265_decode.service | 14 ++++++++++++++ systemd/rock3_h264_decode.service | 13 ------------- systemd/rock3_h265_decode.service | 14 -------------- systemd/rock3_mjpeg_decode.service | 14 -------------- systemd/rock5_h264_decode.service | 14 -------------- systemd/rock5_h264a_decode.service | 14 -------------- systemd/rock5_h265_decode.service | 14 -------------- systemd/rock5_h265a_decode.service | 14 -------------- systemd/rock5_mjpeg_decode.service | 14 -------------- systemd/rock5_mjpega_decode.service | 14 -------------- systemd/rpi_h264_decode.service | 18 ------------------ systemd/x86_ubuntu_h264_decode.service | 15 --------------- systemd/x86_ubuntu_h265_decode.service | 15 --------------- systemd/x86_ubuntu_mjpeg_decode.service | 15 --------------- 16 files changed, 30 insertions(+), 203 deletions(-) create mode 100644 systemd/h264_decode.service create mode 100644 systemd/h265_decode.service delete mode 100644 systemd/rock3_h264_decode.service delete mode 100644 systemd/rock3_h265_decode.service delete mode 100644 systemd/rock3_mjpeg_decode.service delete mode 100644 systemd/rock5_h264_decode.service delete mode 100644 systemd/rock5_h264a_decode.service delete mode 100644 systemd/rock5_h265_decode.service delete mode 100644 systemd/rock5_h265a_decode.service delete mode 100644 systemd/rock5_mjpeg_decode.service delete mode 100644 systemd/rock5_mjpega_decode.service delete mode 100644 systemd/rpi_h264_decode.service delete mode 100644 systemd/x86_ubuntu_h264_decode.service delete mode 100644 systemd/x86_ubuntu_h265_decode.service delete mode 100644 systemd/x86_ubuntu_mjpeg_decode.service diff --git a/package.sh b/package.sh index a6866e479..33fd41960 100755 --- a/package.sh +++ b/package.sh @@ -57,17 +57,16 @@ ls -a release/ echo "here we should have built the file correctly" cp release/QOpenHD /tmp/qopenhd/usr/local/bin/ || exit 1 +cp systemd/h264_decode.service /tmp/qopenhd/etc/systemd/system/ || exit 1 +cp systemd/h265_decode.service /tmp/qopenhd/etc/systemd/system/ || exit 1 # copying services if [[ "${PACKAGE_ARCH}" = "armhf" ]]; then PACKAGE_NAME=qopenhd cp systemd/rpi_qopenhd.service /tmp/qopenhd/etc/systemd/system/qopenhd.service || exit 1 -cp systemd/rpi_h264_decode.service /tmp/qopenhd/etc/systemd/system/h264_decode.service || exit 1 elif [[ "${PACKAGE_ARCH}" = "arm64" ]]; then mkdir -p /tmp/qopenhd/etc/systemd/system/ cp systemd/rock3_qopenhd.service /tmp/qopenhd/etc/systemd/system/qopenhd.service -# cp systemd/rock3_h264_decode.service /tmp/qopenhd/etc/systemd/system/h264_decode.service -# cp systemd/rock3_h265_decode.service /tmp/qopenhd/etc/systemd/system/h265_decode.service PACKAGE_NAME=qopenhd_rk3566 else PACKAGE_NAME=qopenhd @@ -103,28 +102,16 @@ elif [[ "${PACKAGE_ARCH}" = "arm64" ]]; then ${PLATFORM_PACKAGES} || exit 1 #Rock5Package - rm /tmp/qopenhd/etc/systemd/system/qopenhd.service - # rm /tmp/qopenhd/etc/systemd/system/h264_decode.service - # rm /tmp/qopenhd/etc/systemd/system/h265_decode.service - cp systemd/rock5_qopenhd.service /tmp/qopenhd/etc/systemd/system/qopenhd.service - # cp systemd/rock5_h264_decode.service /tmp/qopenhd/etc/systemd/system/h264_decode.service - # cp systemd/rock5_h265_decode.service /tmp/qopenhd/etc/systemd/system/h265_decode.service fpm -a ${PACKAGE_ARCH} -s dir -t deb -n qopenhd_rk3588 -v ${VERSION} -C ${TMPDIR} \ -p qopenhd_rk3588_VERSION_ARCH.deb \ --after-install after-install.sh \ ${PLATFORM_PACKAGES} || exit 1 #Rock5aPackage - rm /tmp/qopenhd/etc/systemd/system/qopenhd.service - rm /tmp/qopenhd/etc/systemd/system/h264_decode.service - rm /tmp/qopenhd/etc/systemd/system/h265_decode.service - cp systemd/rock5_qopenhd.service /tmp/qopenhd/etc/systemd/system/qopenhd.service - cp systemd/rock5_h264a_decode.service /tmp/qopenhd/etc/systemd/system/h264_decode.service - cp systemd/rock5_h265a_decode.service /tmp/qopenhd/etc/systemd/system/h265_decode.service fpm -a ${PACKAGE_ARCH} -s dir -t deb -n qopenhd_rk3588a -v ${VERSION} -C ${TMPDIR} \ -p qopenhd_rk3588a_VERSION_ARCH.deb \ diff --git a/systemd/h264_decode.service b/systemd/h264_decode.service new file mode 100644 index 000000000..2b2093168 --- /dev/null +++ b/systemd/h264_decode.service @@ -0,0 +1,14 @@ +[Unit] +Description=rock_h264_decode + +[Service] +User=root + +# Video decode via mpp, started by QOpenHD if needed (and stopped if needed) +ExecStart=/usr/local/bin/h265.sh + +Restart=always +RestartSec=2 + +[Install] +WantedBy=multi-user.target diff --git a/systemd/h265_decode.service b/systemd/h265_decode.service new file mode 100644 index 000000000..dcb412a33 --- /dev/null +++ b/systemd/h265_decode.service @@ -0,0 +1,14 @@ +[Unit] +Description=rock_h265_decode + +[Service] +User=root + +# Video decode via mpp, started by QOpenHD if needed (and stopped if needed) +ExecStart=/usr/local/bin/h265.sh + +Restart=always +RestartSec=1 + +[Install] +WantedBy=multi-user.target diff --git a/systemd/rock3_h264_decode.service b/systemd/rock3_h264_decode.service deleted file mode 100644 index 150be5c3a..000000000 --- a/systemd/rock3_h264_decode.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=rock_h264_decode - -[Service] -User=root - -# Video decode via mpp, started by QOpenHD if needed (and stopped if needed) -ExecStart=/bin/sh -c "gst-launch-1.0 udpsrc port=5600 caps='application/x-rtp, payload=(int)96, clock-rate=(int)90000, media=(string)video, encoding-name=(string)H264' ! rtph264depay ! h264parse ! mppvideodec format=23 fast-mode=true ! queue ! kmssink plane-id=54 force-modesetting=false" -Restart=always -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/systemd/rock3_h265_decode.service b/systemd/rock3_h265_decode.service deleted file mode 100644 index 51a1f50f4..000000000 --- a/systemd/rock3_h265_decode.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=rock_h265_decode - -[Service] -User=root - -# Video decode via mpp, started by QOpenHD if needed (and stopped if needed) -ExecStart=/bin/sh -c "gst-launch-1.0 udpsrc port=5600 caps='application/x-rtp, payload=(int)96, clock-rate=(int)90000, media=(string)video, encoding-name=(string)H265' ! rtph265depay ! h265parse ! mppvideodec format=23 fast-mode=true ! queue ! kmssink plane-id=54 force-modesetting=false" - -Restart=always -RestartSec=1 - -[Install] -WantedBy=multi-user.target diff --git a/systemd/rock3_mjpeg_decode.service b/systemd/rock3_mjpeg_decode.service deleted file mode 100644 index a281d9362..000000000 --- a/systemd/rock3_mjpeg_decode.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=rock_mjpeg_decode - -[Service] -User=root - -# Video decode via mpp, started by QOpenHD if needed (and stopped if needed) -ExecStart=/bin/sh -c "gst-launch-1.0 udpsrc port=5600 caps='application/x-rtp, payload=(int)26, clock-rate=(int)90000, media=(string)video, encoding-name=(string)JPEG' ! rtpjpegdepay ! jpegdec ! queue ! kmssink plane-id=54 force-modesetting=false" - -Restart=always -RestartSec=1 - -[Install] -WantedBy=multi-user.target diff --git a/systemd/rock5_h264_decode.service b/systemd/rock5_h264_decode.service deleted file mode 100644 index 819b69801..000000000 --- a/systemd/rock5_h264_decode.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=rock_h264_decode - -[Service] -User=root - -# Video decode via mpp, started by QOpenHD if needed (and stopped if needed) -ExecStart=/bin/sh -c "gst-launch-1.0 udpsrc port=5600 caps='application/x-rtp, payload=(int)96, clock-rate=(int)90000, media=(string)video, encoding-name=(string)H264' ! rtph264depay ! h264parse ! mppvideodec format=23 fast-mode=true width=1920 height=1080 ! queue ! kmssink plane-id=54" - -Restart=always -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/systemd/rock5_h264a_decode.service b/systemd/rock5_h264a_decode.service deleted file mode 100644 index 098cf26ac..000000000 --- a/systemd/rock5_h264a_decode.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=rock_h264_decode - -[Service] -User=root - -# Video decode via mpp, started by QOpenHD if needed (and stopped if needed) -ExecStart=/bin/sh -c "gst-launch-1.0 udpsrc port=5600 caps='application/x-rtp, payload=(int)96, clock-rate=(int)90000, media=(string)video, encoding-name=(string)H264' ! rtph264depay ! h264parse ! mppvideodec format=23 fast-mode=true width=1920 height=1080 ! queue ! kmssink plane-id=68" - -Restart=always -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/systemd/rock5_h265_decode.service b/systemd/rock5_h265_decode.service deleted file mode 100644 index f3ff59140..000000000 --- a/systemd/rock5_h265_decode.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=rock_h265_decode - -[Service] -User=root - -# Video decode via mpp, started by QOpenHD if needed (and stopped if needed) -ExecStart=/bin/sh -c "gst-launch-1.0 udpsrc port=5600 caps='application/x-rtp, payload=(int)96, clock-rate=(int)90000, media=(string)video, encoding-name=(string)H265' ! rtph265depay ! h265parse ! mppvideodec format=23 fast-mode=true widt=1920 height=1080 ! queue ! kmssink plane-id=54" - -Restart=always -RestartSec=1 - -[Install] -WantedBy=multi-user.target diff --git a/systemd/rock5_h265a_decode.service b/systemd/rock5_h265a_decode.service deleted file mode 100644 index bf272a215..000000000 --- a/systemd/rock5_h265a_decode.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=rock_h265_decode - -[Service] -User=root - -# Video decode via mpp, started by QOpenHD if needed (and stopped if needed) -ExecStart=/bin/sh -c "gst-launch-1.0 udpsrc port=5600 caps='application/x-rtp, payload=(int)96, clock-rate=(int)90000, media=(string)video, encoding-name=(string)H265' ! rtph265depay ! h265parse ! mppvideodec format=23 fast-mode=true widt=1920 height=1080 ! queue ! kmssink plane-id=68" - -Restart=always -RestartSec=1 - -[Install] -WantedBy=multi-user.target diff --git a/systemd/rock5_mjpeg_decode.service b/systemd/rock5_mjpeg_decode.service deleted file mode 100644 index e35c317ef..000000000 --- a/systemd/rock5_mjpeg_decode.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=rock_mjpeg_decode - -[Service] -User=root - -# Video decode via mpp, started by QOpenHD if needed (and stopped if needed) -ExecStart=/bin/sh -c "gst-launch-1.0 udpsrc port=5600 caps='application/x-rtp, payload=(int)26, clock-rate=(int)90000, media=(string)video, encoding-name=(string)JPEG' ! rtpjpegdepay ! jpegdec ! queue ! kmssink plane-id=54 force-modesetting=true" - -Restart=always -RestartSec=1 - -[Install] -WantedBy=multi-user.target diff --git a/systemd/rock5_mjpega_decode.service b/systemd/rock5_mjpega_decode.service deleted file mode 100644 index 2822131a4..000000000 --- a/systemd/rock5_mjpega_decode.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=rock_mjpeg_decode - -[Service] -User=root - -# Video decode via mpp, started by QOpenHD if needed (and stopped if needed) -ExecStart=/bin/sh -c "gst-launch-1.0 udpsrc port=5600 caps='application/x-rtp, payload=(int)26, clock-rate=(int)90000, media=(string)video, encoding-name=(string)JPEG' ! rtpjpegdepay ! jpegdec ! queue ! kmssink plane-id=68 force-modesetting=true" - -Restart=always -RestartSec=1 - -[Install] -WantedBy=multi-user.target diff --git a/systemd/rpi_h264_decode.service b/systemd/rpi_h264_decode.service deleted file mode 100644 index 72389cda3..000000000 --- a/systemd/rpi_h264_decode.service +++ /dev/null @@ -1,18 +0,0 @@ -[Unit] -Description=rpi_h264_decode - -[Service] -User=root - -# This way we get params from qopenhd (which starts this service) -# EnvironmentFile = /tmp/decode_service_params.txt - - -# Video decode via omx, started by QOpenHD if needed (and stopped if needed) -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_video0.bin /dev/stdin" - -Restart=always -RestartSec=1 - -[Install] -WantedBy=multi-user.target diff --git a/systemd/x86_ubuntu_h264_decode.service b/systemd/x86_ubuntu_h264_decode.service deleted file mode 100644 index 622b936be..000000000 --- a/systemd/x86_ubuntu_h264_decode.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=ubuntu x86 h264 decode service - -[Service] -User=root - -# Video decode via mpp, started by QOpenHD if needed (and stopped if needed) -ExecStart=/bin/sh -c "gst-launch-1.0 -v udpsrc port=5600 caps = "application/x-rtp, media=(string)video, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink" - -Restart=always -RestartSec=2 - -[Install] -WantedBy=multi-user.target - diff --git a/systemd/x86_ubuntu_h265_decode.service b/systemd/x86_ubuntu_h265_decode.service deleted file mode 100644 index 5e262f964..000000000 --- a/systemd/x86_ubuntu_h265_decode.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=ubuntu x86 h264 decode service - -[Service] -User=root - -# Video decode via mpp, started by QOpenHD if needed (and stopped if needed) -ExecStart=/bin/sh -c "gst-launch-1.0 -v udpsrc port=5600 caps = "application/x-rtp, media=(string)video, encoding-name=(string)H265" ! rtph265depay ! decodebin ! videoconvert ! autovideosink" - -Restart=always -RestartSec=2 - -[Install] -WantedBy=multi-user.target - diff --git a/systemd/x86_ubuntu_mjpeg_decode.service b/systemd/x86_ubuntu_mjpeg_decode.service deleted file mode 100644 index 5402fcd8e..000000000 --- a/systemd/x86_ubuntu_mjpeg_decode.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=ubuntu x86 h264 decode service - -[Service] -User=root - -# Video decode via mpp, started by QOpenHD if needed (and stopped if needed) -ExecStart=/bin/sh -c "gst-launch-1.0 -v udpsrc port=5600 caps = "application/x-rtp, media=(string)video, encoding-name=(string)mjpeg" ! rtpjpegdepay ! decodebin ! videoconvert ! autovideosink" - -Restart=always -RestartSec=2 - -[Install] -WantedBy=multi-user.target -