Skip to content

Instantly share code, notes, and snippets.

View sinkers's full-sized avatar

Andrew Sinclair sinkers

View GitHub Profile
@sinkers
sinkers / livestreammonitor.py
Created July 14, 2014 04:50
Script for live video streaming monitoring with notifications
#!/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 -
'''
@sinkers
sinkers / advanced_bipbop.m3u8
Created September 9, 2014 00:00
Apple HLS Advanced Sample
#EXTM3U
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="bipbop_audio",LANGUAGE="eng",NAME="BipBop Audio 1",AUTOSELECT=YES,DEFAULT=YES
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="bipbop_audio",LANGUAGE="eng",NAME="BipBop Audio 2",AUTOSELECT=NO,DEFAULT=NO,URI="alternate_audio_aac_sinewave/prog_index.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",DEFAULT=YES,AUTOSELECT=YES,FORCED=NO,LANGUAGE="en",CHARACTERISTICS="public.accessibility.transcribes-spoken-dialog, public.accessibility.describes-music-and-sound",URI="subtitles/eng/prog_index.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English (Forced)",DEFAULT=NO,AUTOSELECT=NO,FORCED=YES,LANGUAGE="en",URI="subtitles/eng_forced/prog_index.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="Français",DEFAULT=NO,AUTOSELECT=YES,FORCED=NO,LANGUAGE="fr",CHARACTERISTICS="public.accessibility.transcribes-spoken-dialog, public.accessibility.describes-music-and-sound",URI="subtitles/fra/prog_index.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="Français (F
@sinkers
sinkers / gist:c4d39960018bca3540d4
Created July 11, 2014 04:12
Script for multiple bitrate encoding with text on each bitrate for testing
#!/bin/sh
# encode_bitrate_overlay.sh
#
#
# Created by Andrew Sinclair on 11/07/2014.
#
#!/bin/bash
VIDSOURCE=$1
OUTNAME=$2
Thu Apr 2 12:54:58 2020 kern.notice kernel: [ 0.000000] Linux version 3.18.44 (app@runner-DsCEGNRx-project-141-concurrent-1) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r40569) ) #1 Fri Mar 13 09:37:25 UTC 2020
Thu Apr 2 12:54:58 2020 kern.debug kernel: [ 0.000000] MyLoader: sysp=511b6c54, boardp=e6f2066e, parts=9bcd964c
Thu Apr 2 12:54:58 2020 kern.info kernel: [ 0.000000] bootconsole [early0] enabled
Thu Apr 2 12:54:58 2020 kern.info kernel: [ 0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
Thu Apr 2 12:54:58 2020 kern.info kernel: [ 0.000000] SoC: Atheros AR9344 rev 3
Thu Apr 2 12:54:58 2020 kern.info kernel: [ 0.000000] Determined physical RAM map:
Thu Apr 2 12:54:58 2020 kern.info kernel: [ 0.000000] memory: 08000000 @ 00000000 (usable)
Thu Apr 2 12:54:58 2020 kern.info kernel: [ 0.000000] Initrd not found or empty - disabling initrd
Thu Apr 2 12:54:58 2020 kern.warn kernel: [ 0.000000] Zone ranges:
Thu Apr 2 12:54:58 2020 kern.warn kernel: [ 0.000000] N
@sinkers
sinkers / soil_moisture.c
Last active February 7, 2020 08:02
soil_moisture.c
#define voltageFlipPin1 6
#define voltageFlipPin2 7
#define voltageFlipPin3 4
#define voltageFlipPin4 5
#define sensorPin A1
#define SENSOR_PIN_SOIL_VIN A2
#define SENSOR_PIN_TEMP A0
#define NUM_READS 10
@sinkers
sinkers / gist:5cc2854e01a05a2db650
Created July 11, 2014 07:07
Creating multiple DASH renditions with a bitrate text overlay, using ffmpeg and Bento
#!/bin/sh
# encode_bitrate_overlay.sh
#
#
# Created by Andrew Sinclair on 11/07/2014.
#
#!/bin/bash
VIDSOURCE=$1
OUTNAME=$2
@sinkers
sinkers / gist:148a39f8d926a443501a
Created July 11, 2014 01:42
Simple script for encoding files for use with Akamai HD and generating a SMIL file
#!/bin/bash
VIDSOURCE=$1
OUTNAME=$2
RESOLUTION1="320x180"
RESOLUTION2="512x288"
RESOLUTION3="640x360"
RESOLUTION4="960x540"
RESOLUTION5="1024x576"
RESOLUTION6="1280x720"
RESOLUTION7="1920x1080"
@sinkers
sinkers / dash-pr.mpd
Created September 8, 2014 04:44
Android DASH + PlayReady working mpd
http://playready.directtaps.net/media/dash/DASHHDH264AAC/sintel_trailer.HD.adapt.dash_ond.mpd
<MPD
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dolby="http://www.dolby.com/ns/online/DASH"
xmlns="urn:mpeg:DASH:schema:MPD:2011"
xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011"
type="static"
mediaPresentationDuration="PT0H0M52.218S"
minBufferTime="PT1.2S"
@sinkers
sinkers / gist:cfffec1acf879b1a524d
Created September 16, 2014 04:18
IIS DASH sample manifest
<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" mediaPresentationDuration="PT52.250S" minBufferTime="PT4S" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static">
<Period>
<AdaptationSet bitstreamSwitching="true" codecs="mp4a.40.2" contentType="audio" group="5" id="1" lang="en" mimeType="audio/mp4" profiles="ccff" segmentAlignment="true">
<SegmentTemplate initialization="QualityLevels($Bandwidth$)/Fragments(audio_eng=i,format=mpd-time-csf)" media="QualityLevels($Bandwidth$)/Fragments(audio_eng=$Time$,format=mpd-time-csf)" timescale="10000000">
<SegmentTimeline>
<S d="20201360" />
<S d="20201361" />
<S d="20201360" />
<S d="20201361" />
mediastreamvalidator http://ovo-media.s3-website-ap-southeast-2.amazonaws.com/audi/ovoultimategtexperience/master.m3u8
mediastreamvalidator: Beta Version 1.1(150608)
Validating master playlist http://ovo-media.s3-website-ap-southeast-2.amazonaws.com/audi/ovoultimategtexperience/master.m3u8
Validating media playlist video-600k-_iframe.m3u8 [ 5.16 Mbits/sec]
Validating media playlist video-400k-_iframe.m3u8 [ 3.49 Mbits/sec]
Validating media playlist video-600k-_v4.m3u8 [766.00 kbits/sec]
Validating media playlist video-400k-_v4.m3u8 [484.00 kbits/sec]
Validating media playlist audio-64k-_v4.m3u8 [74.00 kbits/sec]
Validating alternate rendition playlist audio-64k-_v4.m3u8