Skip to content

Instantly share code, notes, and snippets.

View Chopinsky's full-sized avatar

Jacob Zuo Chopinsky

View GitHub Profile
@Chopinsky
Chopinsky / unusual_vol.py
Last active July 24, 2022 00:07
An example python program to crawl and summarize unusual activity stocks from W3Data.io
import datetime
import requests
import re
import json
import os.path
from collections import defaultdict
DEFAULT_FILE_LOC = './unusual_activity.json'
REMOVER = re.compile('<.*?>')
@Chopinsky
Chopinsky / livestream
Last active September 2, 2015 15:58 — forked from deandob/livestream
Node.JS function to remux mp4/h.264 video from an IP camera to a HTML5 video tag using FFMPEG
// Live video stream management for HTML5 video. Uses FFMPEG to connect to H.264 camera stream,
// Camera stream is remuxed to a MP4 stream for HTML5 video compatibility and segments are recorded for later playback
var liveStream = function (req, resp) { // handle each client request by instantiating a new FFMPEG instance
// For live streaming, create a fragmented MP4 file with empty moov (no seeking possible).
var reqUrl = url.parse(req.url, true)
var cameraName = typeof reqUrl.pathname === "string" ? reqUrl.pathname.substring(1) : undefined;
if (cameraName) {
try {
cameraName = decodeURIComponent(cameraName);