Skip to content

Instantly share code, notes, and snippets.

@mike-zhang
mike-zhang / udpProxy.go
Created October 8, 2012 15:58
Implementation of a UDP proxy in Golang
// Implementation of a UDP proxy
package main
import (
"flag"
"fmt"
"log"
"net"
"os"
#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p
#EXTINF:-1,BBC - Radio 2
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p
#EXTINF:-1,BBC - Radio 3
http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-aac-lc-a/format/pls/vpid/bbc_radio_three.pls
#EXTINF:-1,BBC - Radio 4
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p
#EXTINF:-1,BBC - Radio 5 live
@crisidev
crisidev / grafana-dashboard-exporter
Created October 7, 2015 20:35
Command to export all grafana 2 dashboard to JSON using curl
KEY=XXXXXXXXXXXX
HOST="https://metrics.crisidev.org"
mkdir -p dashboards && for dash in $(curl -k -H "Authorization: Bearer $KEY" $HOST/api/search\?query\=\& |tr ']' '\n' |cut -d "," -f 5 |grep slug |cut -d\" -f 4); do
curl -k -H "Authorization: Bearer $KEY" $HOST/api/dashboards/db/$dash > dashboards/$dash.json
done
@Brainiarc7
Brainiarc7 / VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
Last active March 26, 2024 18:18
This gist contains instructions on setting up FFmpeg and Libav to use VAAPI-based hardware accelerated encoding (on supported platforms) for H.264 (and H.265 on supported hardware) video formats.

Using VAAPI's hardware accelerated video encoding on Linux with Intel's hardware on FFmpeg and libav

Hello, brethren :-)

As it turns out, the current version of FFmpeg (version 3.1 released earlier today) and libav (master branch) supports full H.264 and HEVC encode in VAAPI on supported hardware that works reliably well to be termed "production-ready".

@w495
w495 / pyav_example.py
Last active June 15, 2019 21:20
Пример работы с видео в Python. В примере из видео достают кадры и конвертируют их в numpy-вектора размером `32 X 32`. После из полученных векторов собирают новое видео. Создано по мотивам http://ru.stackoverflow.com/questions/519636/#551344
import av
from av.video.frame import VideoFrame
from av.video.stream import VideoStream
# В этом списке будем хранить кадры в виде numpy-векторов.
array_list = []
# Откроем контейнер на чтение
input_container = av.open('input.mp4')
@takeshixx
takeshixx / ubuntu-xenial-armfh-qemu.md
Last active October 22, 2023 12:14
Running Ubuntu 16.04.1 armhf on Qemu

Running Ubuntu 16.04.1 armhf on Qemu

This is a writeup about how to install Ubuntu 16.04.1 Xenial Xerus for the 32-bit hard-float ARMv7 (armhf) architecture on a Qemu VM via Ubuntu netboot.

The setup will create a Ubuntu VM with LPAE extensions (generic-lpae) enabled. However, this writeup should also work for non-LPAE (generic) kernels.

The performance of the resulting VM is quite good, and it allows VMs with >1G ram (compared to 256M on versatilepb and 1G on versatile-a9/versatile-a15). It also supports virtio disks whereas versatile-a9/versatile-a15 only support SD cards via the -sd argument.

Get netboot files

@Jiab77
Jiab77 / ffmpeg.md
Last active June 27, 2024 21:14
This gist will help you to compile ffmpeg with NVENC, QSV, VAAPI, VDPAU, and OpenCL support.

Compilation FFMpeg / NVENC + NVRESIZE + QSV + VAAPI + VDPAU + OpenCL

This gist will help you to compile ffmpeg with NVENC, QSV, VAAPI, VDPAU, and OpenCL support.

nVidia nvresize patch is outdated and not more compatible to the latest version of FFmpeg, so it's not included in this documentation.

(even if I've passed a lot of time at trying to make it compile... without any success)

Please don't rely on this page: https://developer.nvidia.com/ffmpeg, the implementation is a hack and was never been added to the main FFmpeg tree.

@ekwoodrich
ekwoodrich / DVRIP-Sonia Reference Codes.md
Last active April 30, 2024 20:24
Reference codes for the DVRIP/Sonia TCP protocol used by the Net Surveillance ActiveX plugin

DVRIP/Sonia Protocol

DVRIP/Sonia TCP protocol used by the Net Surveillance ActiveX plugin

1. Response Codes

Return code Definition
100 Success
101 Unknown error
102 Version not supported
103 Illegal request
@w495
w495 / pyav_rtmp_example.py
Last active June 15, 2019 21:15
Пример работы с видео в Python. Есть RTMP-поток и RTMP-сервер, на который нужно отправить этот поток. Создано по мотивам https://ru.stackoverflow.com/a/664973/203032
# -*- coding: utf8 -*-
import av
# Откроем ресурс на чтение
input_resource = av.open(
'rtmp://src_stream:1935/play'
)
# Откроем ресурс на запись.
output_resource = av.open(