|
发表于 2022-4-20 18:15:36
只看该作者
沙发
daijh@DESKTOP-KSQM7RK:~/sdk/ubuntu-build/overlay/post/debug/usr/local/bin$ cat test_hdmirx.sh
#!/bin/bash
device_id=$(v4l2-ctl --list-devices | grep -A1 hdmirx | grep -v hdmirx | awk -F ' ' '{print $NF}')
v4l2-ctl -d $device_id --set-dv-bt-timings query
width=$(v4l2-ctl -d $device_id --get-dv-timings | grep "Active width" |awk -F ' ' '{print $NF}')
heigh=$(v4l2-ctl -d $device_id --get-dv-timings | grep "Active heigh" |awk -F ' ' '{print $NF}')
trap 'onCtrlC' INT
function onCtrlC () {
echo 'Ctrl+C is captured'
killall gst-launch-1.0
exit 0
}
export XDG_RUNTIME_DIR=/run/user/1000
gst-launch-1.0 alsasrc device=hw:2,0 ! audioconvert ! audioresample ! queue ! alsasink device="hw:1,0" &
gst-launch-1.0 v4l2src device=$device_id ! queue ! video/x-raw,format=RGB ! capssetter replace = true caps="video/x-raw,format=BGR,width=$width,height=$heigh" ! glimagesink &
echo "[Ctrl + C] exit"
while true
do
sleep 10
done
|
|