Skip to content

Instantly share code, notes, and snippets.

vo / Makefile
Last active May 24, 2019
Makefile to fix broken mp4 files
View Makefile
# This makefile finds all .mp4 files and attempts to repair their indexes without re-encoding.
# It's a makefile so you can use "make -jN" to take advantage of N cores on your computer finish many quickly
MP4:=$(wildcard *.mp4)
FAST:=$(patsubst %.mp4,${OUTDIR}/,${MP4})
REKEYED:=$(patsubst %.mp4,${OUTDIR}/%.rekeyed.mp4,${MP4})
@echo "Use 'make fast' to do a fast file index rebuild"
vo /
Last active Apr 20, 2019
send and recv udp python
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(('', 5005))
while True:
data, addr = sock.recvfrom(65536)
print("received: %d" % len(data))
vo /
Created Aug 26, 2018
Publish incoming serial Mavlink to ZeroMQ
#include <iostream>
#include <csignal>
#include <cstring>
#include <fcntl.h>
#include <unistd.h>
#include <termios.h>
#include <zmq.h>
#include "mavlink/ardupilotmega/mavlink.h"
inline bool set_baud(termios *cfg, speed_t baud)
vo / example.cpp
Created Aug 24, 2018
Read two Mavlink streams in same loop
View example.cpp
#include <iostream>
#include <cstring>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <thread>
#include "ardupilotmega/mavlink.h"
int open_socket(uint16_t port)
vo /
Last active Aug 20, 2018
Creating Custom Mavlink Message

Creating a Custom Mavlink Message

Download the Mavlink Toolchain

git clone

Create a message defintion

Create a file named custom.xml with these contents:

vo /
Created Aug 17, 2018
basic replacement for telem_ctrl
import socket
import sys
STM32_HOST = ''
STM32_PORT = 5015
vo / request1.proto
Last active Jul 26, 2018
Protobuf serialize/deserialize test
View request1.proto
syntax = "proto3";
package request1;
message Request {
Type type = 1;
AmazingCommand amazingCommand = 2;
BeautifulCommand beautifulCommand = 3;
CharmingCommand charmingCommand = 4;
DashingCommand dashingCommand = 5;
vo /
Last active May 22, 2020
Raspberry Pi 3 B+ Auvidea B101 Gstreamer Pipeline Example
gst-launch-1.0 udpsrc port=5801 ! 'application/x-rtp,payload=96,encoding-name=H264,clock-rate=(int)90000' ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! autovideosink sync=false
#!/usr/bin/env python
# Usage:
# ./ [key] [value]
import re
vo /
Last active May 22, 2020
mavlink packet inspector
from pymavlink import mavutil
import threading
connection = mavutil.mavlink_connection("udp:")
local = mavutil.mavlink_connection("udpout:")
def on_msg_from_uas(msg):
buf = msg.get_msgbuf()