This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var zmq = require('zeromq'); | |
/* ZMQ Router */ | |
var router_addr = 'tcp://0.0.0.0:5554' | |
var router_options = { | |
identity: "SourceFrame" | |
} | |
var router = zmq.socket('router', router_options); | |
router.bindSync(router_addr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
./zmqrouter | |
identity: SinkFrame | |
msg: Connect | |
identity: SinkFrame | |
msg: Connect | |
identity: SinkFrame | |
msg: Connect | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eux | |
echo "setting 27 inch 4K monitor" | |
xrandr --output DisplayPort-0 --mode 3840x2160 --scale "1.5x1.5" --rate 60 --primary | |
echo "setting 24 inch 1080p monitor" | |
xrandr --output HDMI-A-0 --mode 1920x1080 --scale "2x2" --pos 5760x0 | |
echo "setting global scaling to 2x" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import time | |
def measureDecodeTimeMs(src): | |
cap = cv2.VideoCapture(src) | |
for i in range(10): | |
a = time.time() | |
ok, frame = cap.read() | |
if not ok: | |
print("Error: Unable to read frame") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eux | |
cd /tmp | |
rm -rfv docker* | |
wget -O /tmp/docker.tgz https://download.docker.com/linux/static/stable/aarch64/docker-20.10.6.tgz | |
tar xvf docker.tgz | |
mv -v docker/* /usr/bin | |
rm -rfv docker* | |
# sed 's/exit 0/dockerd\&\nexit 0/' /etc/rc.local >> /etc/rc.local | |
echo "Done." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# i.MX 8M Plus | |
# USB camera h264 RTP stream | |
# Sending | |
gst-launch-1.0 -v v4l2src ! video/x-h264,width=1920,height=1080,framerate=30/1 ! queue ! vpudec ! queue ! clockoverlay ! queue ! vpuenc_h264 ! h264parse ! rtph264pay config-interval=10 pt=96 ! udpsink host=192.168.1.214 port=5000 sync=false | |
# Receiving | |
gst-launch-1.0.exe -vvv udpsrc port=5000 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, packetization-mode=(string)1, payload=(int)96" ! rtph264depay ! decodebin ! autovideosink | |
# Convert image sequence (.jpg files) into an mkv | |
gst-launch-1.0 multifilesrc location="%d.jpg" index=0 ! image/jpeg,width=1920,height=1080,framerate=25/1 ! jpegdec ! videoconvert ! videorate ! queue ! vpuenc_h264 ! h264parse ! matroskamux ! filesink location="2220_imx8mp.mkv" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyaudio | |
import math | |
import struct | |
import playsound | |
CHUNK = 2048 | |
THRESHOLD = 70 | |
REFERENCE_LEVEL = 0.00005 | |
def rms( data ): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tflite_runtime import interpreter | |
import numpy as np | |
import time | |
i = interpreter.Interpreter("mobilenet_v1_1_224.tflite") | |
input_details = i.get_input_details() | |
output_details = i.get_output_details() | |
input_shape = input_details[0]['shape'] | |
input_data = np.array(np.random.random_sample(input_shape), dtype=np.float32) | |
i.set_tensor(input_details[0]['index'], input_data) | |
t1=time.time(); i.invoke(); t2=time.time(); print(f"Warm-up time: {1000.0*(t2-t1)} ms") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# heavily borrowed from mdegans/docker-tegra-ubuntu | |
set -eux | |
wget https://repo.download.nvidia.com/jetson/jetson-ota-public.asc -O /etc/apt/trusted.gpg.d/jetson-ota-public.asc | |
chmod 644 /etc/apt/trusted.gpg.d/jetson-ota-public.asc | |
apt-get update && apt-get install -y --no-install-recommends ca-certificates | |
echo "deb https://repo.download.nvidia.com/jetson/common r32.4 main" > nvidia-l4t-apt-source.list | |
echo "deb https://repo.download.nvidia.com/jetson/t194 r32.4 main" >> nvidia-l4t-apt-source.list | |
mv nvidia-l4t-apt-source.list /etc/apt/sources.list.d/ | |
apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let interval = setInterval(()=>{ | |
let img = document.getElementsByTagName("img").item(0); | |
img.src = img.src; | |
console.log("Reloaded. Next reload in 5s."); | |
}, 5000); |
OlderNewer