Skip to content

Instantly share code, notes, and snippets.

@robobe
robobe / mavlink.lua
Created December 28, 2023 15:26
lua mavlink ardupilot
@robobe
robobe / dynamic_comp.py
Created December 24, 2023 17:17
python gst compositor dynamic
import gi
import logging
gi.require_version("Gst", "1.0")
from gi.repository import GObject, Gst
from threading import Thread, Event
from dataclasses import dataclass
from fastapi import FastAPI
log = logging.getLogger(__name__)
Gst.init(None)
@robobe
robobe / tmux.conf
Last active May 6, 2023 05:26
tmux conf file #settings
# unbind
unbind C-b
unbind '"'
unbind %
# base1 numbering
set -g base-index 1
setw -g pane-base-index 1
#bind ctrl-a as a prefix
@robobe
robobe / test_zmq_img_transport.py
Created October 19, 2021 17:35
test transport image using zmq and pickel #zmq
"""install
python -m pip install opencv-python
python -m pip install pyzmq
"""
import multiprocessing
import cv2
import numpy as np
import zmq
import time
import pickle
@robobe
robobe / gen_image.py
Created July 2, 2021 14:23
Generated image from numpy array
import cv2
import numpy as np
import time
from timeit import default_timer as timer
HEIGHT=480
WIDTH=640
FONT=cv2.FONT_HERSHEY_SIMPLEX
bottomLeftCornerOfText = (100,100)
@robobe
robobe / gst_clock.py
Created March 29, 2020 10:02
gstreamer clock #gst
import gi
gi.require_version('Gst', '1.0')
import traceback
import sys
from gi.repository import Gst, GObject
import multiprocessing
class base():
def __init__(self, name):
self.pipeline = None
@robobe
robobe / cv2gst_pipe
Created December 31, 2019 20:06
send opencv frame over gstreamer pipe using python # python #gst
#!/usr/bin/env python3
import sys
import os
import cv2
import gi
import signal
import threading
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GObject
@robobe
robobe / udp_recv.py
Created August 23, 2019 07:20
recieve image over udp socket, decode from jpeg work with sample from udp_sender gist
import socket
import sys
import struct
import cv2
import numpy as np
BUFFER_SIZE = 1024
ADDR = ("127.0.0.1", 5252)
HEADER_START = b"START"
@robobe
robobe / udp_sender.py
Created August 23, 2019 07:19
send capture image over udp socket
import cv2
import socket
import struct
from datetime import datetime
cap = cv2.VideoCapture(1)
fps = cap.get(cv2.CAP_PROP_FPS)
font = cv2.FONT_HERSHEY_SIMPLEX
JPEG_QUALITY = 70
encode_param = [int(cv2.IMWRITE_JPEG_QUALITY), JPEG_QUALITY]
@robobe
robobe / logging.json
Created July 31, 2019 17:46
Python logging json config file #python #config
{
"logging": {
"version": 1,
"disable_existing_loggers": true,
"formatters": {
"single-line": {
"class": "logging.Formatter",
"style": "{",
"datefmt": "%I:%M:%S",
"format": "{levelname:8s}; {asctime:s}; {name:<15s} {lineno:4d}; {message:s}"