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
# tasks.py | |
from celery import task, Celery, subtask, group | |
import time | |
REDIS_SERVER = 'redis://localhost:6379' | |
celery = Celery("app", broker=REDIS_SERVER, backend=REDIS_SERVER) | |
@task() | |
def task1(input): |
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
# First part is a unit test script effectively, this code would go in the Flask app | |
from celery import Celery | |
# There needs to be a seperate tasks module, see below | |
import tasks | |
# Celery uses redis to commuicate between tasks | |
celery = Celery("app", broker='redis://localhost:6379',backend='redis://localhost:6379') | |
# This submits the task to run via Celery |
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
from tornado.wsgi import WSGIContainer | |
from tornado.httpserver import HTTPServer | |
from tornado.ioloop import IOLoop | |
import tornado.netutil | |
import requests | |
import os | |
import netifaces | |
from worker import app | |
from worker import register |
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
#!/usr/bin/python | |
# Script to encode HLS and DASH from a multi TS mezzanine file | |
# Places encoded files in a folder of the same name as the source input | |
# Steps | |
# 1. Check file with mediainfo (optional) | |
# 2. Encode to resolutions as mp4 | |
# 3. Split into TS segments and create playlists | |
# 4. Create variant playlist | |
import subprocess |
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
#!/usr/bin/python | |
''' | |
Script to monitor live streams and send an Amazon SNS if the stream is down (and possibly take restorative action) | |
Future: | |
Black detect: ffmpeg -i out.mp4 -vf blackdetect -f null - | |
Note the following doesn't seem to fully work without looking at the debug logs | |
On live ffmpeg -y -i rtmp://cp30129.live.edgefcs.net/live/videoops-videoops@50541 -vf blackdetect -t 10 -loglevel debug -f null - | |
''' |
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
#!/bin/sh | |
# encode_bitrate_overlay.sh | |
# | |
# | |
# Created by Andrew Sinclair on 11/07/2014. | |
# | |
#!/bin/bash | |
VIDSOURCE=$1 | |
OUTNAME=$2 |
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
#!/bin/sh | |
# encode_bitrate_overlay.sh | |
# | |
# | |
# Created by Andrew Sinclair on 11/07/2014. | |
# | |
#!/bin/bash | |
VIDSOURCE=$1 | |
OUTNAME=$2 |
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
#!/bin/bash | |
VIDSOURCE=$1 | |
OUTNAME=$2 | |
RESOLUTION1="320x180" | |
RESOLUTION2="512x288" | |
RESOLUTION3="640x360" | |
RESOLUTION4="960x540" | |
RESOLUTION5="1024x576" | |
RESOLUTION6="1280x720" | |
RESOLUTION7="1920x1080" |
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
<adRequest networkId="90750" version="1" profile="90750:ooyala_android"> | |
<capabilities> | |
<supportsSlotTemplate /> | |
<supportsAdUnitInMultipleSlots /> | |
<supportNullCreative /> | |
<supportsSlotCallback /> | |
<requiresVideoCallbackUrl /> | |
<supportsFallbackAds /> | |
<expectMultipleCreativeRenditions /> | |
<requiresRendererManifest /> |
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 requests | |
import random | |
import xml.dom.minidom | |
''' | |
Simple script to simulate what needs to go in a Freewheel ad request | |
This example is for VMAP but what needs to be requested is similar on other response types e.g. FW Smart XML | |
To use Smart XML response just change the resp parameter to "xml" | |
''' |