mirror of
https://github.com/DrHo1y/orangepi-build.git
synced 2026-03-24 09:36:43 +07:00
Add hdmirx_mpph265enc.sh for opi5plus
This commit is contained in:
25
external/packages/bsp/orangepi5plus/usr/bin/hdmirx_mpph265enc.sh
vendored
Executable file
25
external/packages/bsp/orangepi5plus/usr/bin/hdmirx_mpph265enc.sh
vendored
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
trap 'onCtrlC' INT
|
||||
function onCtrlC () {
|
||||
echo 'Ctrl+C is captured'
|
||||
killall gst-launch-1.0
|
||||
exit 0
|
||||
}
|
||||
|
||||
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 2>&1 > /dev/null
|
||||
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}')
|
||||
|
||||
es8388_card=$(aplay -l | grep "es8388" | cut -d ':' -f 1 | cut -d ' ' -f 2)
|
||||
hdmi0_card=$(aplay -l | grep "hdmi0" | cut -d ':' -f 1 | cut -d ' ' -f 2)
|
||||
hdmi1_card=$(aplay -l | grep "hdmi1" | cut -d ':' -f 1 | cut -d ' ' -f 2)
|
||||
hdmiin_card=$(arecord -l | grep "hdmiin" | cut -d ":" -f 1 | cut -d ' ' -f 2)
|
||||
|
||||
gst-launch-1.0 -e v4l2src device=$device_id ! videoconvert ! video/x-raw,format=NV12,width=${width},height=${heigh} ! mpph265enc ! h265parse ! queue ! mpegtsmux ! filesink location="/home/orangepi/hdmiin_video_$(date +"%Y%m%d_%H%M%S").ts"
|
||||
|
||||
while true
|
||||
do
|
||||
sleep 10
|
||||
done
|
||||
Reference in New Issue
Block a user