Skip to content

Instantly share code, notes, and snippets.

View alif's full-sized avatar

Ali Faiz alif

View GitHub Profile
@alif
alif / head nod detection
Created November 22, 2020 03:33 — forked from smeschke/head nod detection
Detection of Head Nods using OpenCV in Python
import cv2
import numpy as np
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('/home/sm/Desktop/nodcontrol.avi',fourcc, 20.0, (640,480))
#dinstance function
def distance(x,y):
import math
return math.sqrt((x[0]-y[0])**2+(x[1]-y[1])**2)
@alif
alif / ffmpeg_examples.md
Created November 11, 2020 19:04 — forked from tomasinouk/ffmpeg_examples.md
ffmpeg examples for streaming full screen

ffmpeg -f avfoundation -i "1" -vcodec libx264 -r 10 -tune zerolatency -b:v 500k -bufsize 300k -f rtp rtp://localhost:1234

ffmpeg -f avfoundation -i "1" -vcodec libx264 -r 10 -tune zerolatency -b:v 500k -bufsize 300k -f rtp udp://127.0.0.1:1234

ffmpeg -f avfoundation -i "1" -vcodec libx264 -r 10 -tune zerolatency -b:v 500k -bufsize 300k -f mpegts udp://127.0.0.1:1234

ffmpeg -f avfoundation -i "1" -vcodec libx264 -r 10 -pix_fmt uyvy422 -tune zerolatency -b:v 500k -bufsize 300k -f mpegts udp://192.168.88.38:1234

@alif
alif / gist:f8b2fef9bc9c4d92aa5e7e568dede8bc
Last active November 11, 2020 18:45 — forked from MaTriXy/gist:b773d9fce498dc4b07f45cea7cb80f60
streaming desktop to rtmp using ffmpeg
$ git clone https://github.com/iizukanao/node-rtsp-rtmp-server
$ coffee -c .
$ node server.js
$ ffmpeg -f avfoundation -i "0" -vcodec libx264 -tune zerolatency -s 320x480 -vf crop=320:480:0:0 -f flv rtmp://0.0.0.0/live/desktop
$ ffmpeg -f avfoundation -framerate 30 -i "0:0" -vcodec libx264 -tune zerolatency -s 500:500 -f flv "rtmp://localhost:1935/live/desktop flashver=FMLE/3.0\20(compatible;\20FMSc/1.0) live=true pubUser=user pubPasswd=pwd"
# stream on ios device
@alif
alif / gist:ca9e96359c13739b3cae
Created November 2, 2015 04:52
Mac bluetooth
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist