-
Notifications
You must be signed in to change notification settings - Fork 0
/
mjpeg_decode.sh
33 lines (27 loc) · 1.42 KB
/
mjpeg_decode.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
#Simple decode script for OpenHD (h265)
function execute_kmsDecodeMPP {
local plane=$1
local mode=$2
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="$plane" force-modesetting="$mode"
}
function execute_PeteVideoDecode {
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 config-interval=1 ! video/x-h265,stream-format=byte-stream,alignment=au ! fdsink fd=1 | openhd_vid >/dev/tty1
}
function execute_FPVueVideoDecode {
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 config-interval=1 ! video/x-h265,stream-format=byte-stream,alignment=au ! fdsink fd=1 | fpvue --rmode 10
}
function execute_FPVueVideoDecode2 {
fpvue --gst-udp-port 5600 --rmode 5 --h265
}
# Detect Platform
if [ -f "/boot/openhd/rock-rk3566.txt" ] || [ -f "/boot/openhd/openhd/rock-rk3566.txt" ]; then
#execute_PeteVideoDecode
execute_FPVueVideoDecode2
fi
if [ -f "/boot/openhd/rock-5b.txt" ]; then
execute_kmsDecodeMPP 54 false
fi
if [ -f "/boot/openhd/rock-5a.txt" ]; then
execute_kmsDecodeMPP 68 false
fi