Skip to content

Instantly share code, notes, and snippets.

View sinkers's full-sized avatar

Andrew Sinclair sinkers

View GitHub Profile
@sinkers
sinkers / gist:0739bba6faca0f43888e
Created September 10, 2014 06:07
Working Silverlight MPD
http://wams.edgesuite.net/media/SintelTrailer_Smooth_from_WAME_720p_Main_Profile_CENC/CENC/sintel_trailer-720p.ism/manifest(format=mpd-time-csf)
<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013" xmlns:mspr="urn:microsoft:playready" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" mediaPresentationDuration="PT52.208S" minBufferTime="PT3S">
<Period>
<AdaptationSet id="1" group="1" profiles="ccff" bitstreamSwitching="true" segmentAlignment="true" contentType="video" mimeType="video/mp4" codecs="avc1.4D4020" maxWidth="1280" maxHeight="720" startWithSAP="1">
<ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="10000000-1000-1000-1000-100000000001" />
<ContentProtection schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95" value="2.0" cenc:default_KID="10000000-1000-1000-1000-100000000001">
<mspr:p
@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 / 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:b2478e0233508de5280f
Created September 8, 2014 03:52
Silverlight working mpd with PlayReady
<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013" xmlns:mspr="urn:microsoft:playready" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" mediaPresentationDuration="PT52.208S" minBufferTime="PT3S">
<Period>
<AdaptationSet id="1" group="1" profiles="ccff" bitstreamSwitching="true" segmentAlignment="true" contentType="video" mimeType="video/mp4" codecs="avc1.640028" maxWidth="1920" maxHeight="1080" startWithSAP="1">
<ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="10000000-1000-1000-1000-100000000001" />
<ContentProtection schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95" value="2.0" cenc:default_KID="10000000-1000-1000-1000-100000000001">
<mspr:pro>ngMAAAEAAQCUAzwAVwBSAE0ASABFAEEARABFAFIAIAB4AG0AbABuAHMAPQAiAGgAdAB0AHAAOgAvAC8AcwBjAGgAZQBtAGEAcwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwBEA
@sinkers
sinkers / XML
Last active August 29, 2015 14:06
Envivio mpd working
<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" type="static" mediaPresentationDuration="PT25.959S" availabilityStartTime="2012-12-17T15:56:16Z" maxSegmentDuration="PT2.080S" minBufferTime="PT2.001S" profiles="urn:mpeg:dash:profile:isoff-live:2011"><
Period id="0">
<AdaptationSet mimeType="video/mp4" segmentAlignment="true" startWithSAP="1" maxWidth="640" maxHeight="360" maxFrameRate="30000/1001" par="16:9">
<SegmentTemplate presentationTimeOffset="9498" timescale="90000" initialization="seg_$RepresentationID$_init.m4s" media="seg_$RepresentationID$_t$Time$.m4s">
<SegmentTimeline><S t="12012" d="180180" r="11"/>
<S t="2174172" d="174174"/>
</SegmentTimeline>
@sinkers
sinkers / gist:170b1a35cc1114adac88
Created September 8, 2014 02:04
Not working PR Android request response
http://playready.directtaps.net/pr/svc/rightsmanager.asmx?PlayEnablers=786627D8-C2A6-44BE-8F88-08AE255B01A7
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<AcquireLicense xmlns="http://schemas.microsoft.com/DRM/2007/03/protocols">
<challenge>
<Challenge xmlns="http://schemas.microsoft.com/DRM/2007/03/protocols/messages">
<LA xmlns="http://schemas.microsoft.com/DRM/2007/03/protocols" Id="SignedData" xml:space="preserve">
<Version>1</Version>
<ContentHeader>
@sinkers
sinkers / gist:6fabe057ee9a966a621a
Created September 8, 2014 02:03
Working PR Android License request and response
http://playready.directtaps.net/pr/svc/rightsmanager.asmx?PlayEnablers=786627D8-C2A6-44BE-8F88-08AE255B01A7
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<AcquireLicense xmlns="http://schemas.microsoft.com/DRM/2007/03/protocols">
<challenge>
<Challenge xmlns="http://schemas.microsoft.com/DRM/2007/03/protocols/messages">
<LA xmlns="http://schemas.microsoft.com/DRM/2007/03/protocols" Id="SignedData" xml:space="preserve">
<Version>1</Version>
<ContentHeader>
@sinkers
sinkers / gist:b82afb75ccc78404f60e
Created September 7, 2014 07:15
Created Bento but not working
mp4info --verbose init.mp4
File:
major brand: isom
minor version: 200
compatible brand: isom
compatible brand: iso2
compatible brand: avc1
compatible brand: mp41
compatible brand: iso6
@sinkers
sinkers / check_keyframes.py
Last active November 16, 2019 19:56
Checking keyframe alignment using ffprobe
import re
import subprocess
import logging
import math
import json
import pygal
import sys
logger = logging.getLogger(__name__)
'''
@sinkers
sinkers / tasks.py
Created September 5, 2014 02:36
Celery chord issue
# 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):