This file contains 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
#!/usr/bin/python | |
#based on the ideas from http://synack.me/blog/implementing-http-live-streaming | |
# Run this script and then launch the following pipeline: | |
# gst-launch videotestsrc pattern=ball ! video/x-raw-rgb, framerate=15/1, width=640, height=480 ! jpegenc ! multipartmux boundary=spionisto ! tcpclientsink port=9999 | |
from Queue import Queue | |
from threading import Thread | |
from socket import socket | |
from select import select | |
from wsgiref.simple_server import WSGIServer, make_server, WSGIRequestHandler |
This file contains 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 ast | |
from cStringIO import StringIO | |
import sys | |
INFSTR = '1e308' | |
def interleave(inter, f, seq): | |
seq = iter(seq) | |
try: | |
f(next(seq)) |