This file contains hidden or 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
for f in *.mp4; do echo file $f >> list.txt; done | |
ffmpeg -f concat -safe 0 -i list.txt -c copy output.mp4 |
This file contains hidden or 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
def validate_param(param_name): | |
""" | |
Validating OS environment variables | |
""" | |
if param_name not in os.environ: | |
raise ValueError("missing environment variable " + param_name) | |
return os.environ[param_name] | |
if __name__ == "__main__": |
This file contains hidden or 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 tensorflow as tf | |
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input | |
from tensorflow.keras.preprocessing.image import img_to_array | |
from tensorflow.keras.models import load_model | |
import numpy as np | |
import imutils | |
import cv2 | |
import os | |
import time | |
import chrysalis |
This file contains hidden or 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
def validate_param(param_name): | |
""" | |
Validating OS environment variables | |
""" | |
if param_name not in os.environ: | |
raise ValueError("missing environment variable " + param_name) | |
return os.environ[param_name] | |
if __name__ == "__main__": | |
port = validate_param('chrys_port') |
This file contains hidden or 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
def add_face_markers(frame): | |
""" | |
Adding face markers onto a single frame | |
""" | |
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) | |
rects = detector(gray, 0) | |
for (i, rect) in enumerate(rects): | |
shape = predictor(gray, rect) | |
shape = face_utils.shape_to_np(shape) |
This file contains hidden or 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 os | |
import cv2 | |
import dlib | |
from imutils import face_utils | |
import chrysalis | |
# get the display | |
os.environ['DISPLAY'] = ":0" |
This file contains hidden or 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
raspivid -t 0 -w 640 -h 480 -fps 15 -hf -b 1000000 -o - | \ | |
> gst-launch-1.0 fdsrc ! h264parse config-interval=2 ! flvmux ! rtmpsink location='rtmp://127.0.0.1/live live=1' |
This file contains hidden or 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
created - A container that has been created (e.g. with docker create) but not started | |
restarting - A container that is in the process of being restarted | |
running - A currently running container | |
paused - A container whose processes have been paused | |
exited - A container that ran and completed ("stopped" in other contexts, although a created container is technically also "stopped") | |
dead- A container that the daemon tried and failed to stop (usually due to a busy device or resource used by the container) |
This file contains hidden or 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
# (tested on Ubuntu 18.04 Desktop) | |
# Stream your own desktop to RTMP | |
ffmpeg -f x11grab -s 1920x1200 -framerate 15 -i :0.0 -c:v libx264 -preset fast -pix_fmt yuv420p -s 1280x800 -threads 0 -f flv "rtmp://127.0.0.1/live/mystreamkey" | |
# Broadcasting Examples | |
ffmpeg -f dshow -i video="Virtual-Camera" -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -f mpegts udp://127.0.0.1:1234 | |
ffmpeg -f dshow -i video="screen-capture-recorder":audio="Stereo Mix (IDT High Definition" \ |
This file contains hidden or 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
private static final key = "mailgun_key" | |
public static boolean isSignatureValid(String token , long timestamp, String signature) { | |
try { | |
Mac hmac = Mac.getInstance("HmacSHA256"); | |
SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(), "HmacSHA256"); | |
hmac.init(signingKey); | |
String signed = Hex.encodeHexString(hmac.doFinal((timestamp + token).getBytes())); | |
if (signed.equals(signature)) { | |
return true; | |
} |
NewerOlder