Skip to content

Instantly share code, notes, and snippets.

View mmcc's full-sized avatar
📺
Movin vidja bits

Matthew McClure mmcc

📺
Movin vidja bits
View GitHub Profile
@mmcc
mmcc / live_stream.rb
Created January 22, 2013 21:46
Really simple Ruby script to make a basic Live request to Zencoder with a few HLS outputs.
require 'rubygems'
require 'zencoder'
# Change these settings
s3_bucket = ''
Zencoder.api_key = ''
# Quick test to make sure the variables above are set...
if s3_bucket == '' || Zencoder.api_key == ''
puts "It appears you haven't set your S3 bucket or Zencoder API key..."
@mmcc
mmcc / stream_to_akamai.md
Last active January 12, 2018 11:27
Stream directly to Akamai

Directly push to Akamai with FMLE

Assuming you already have the appropriate Akamai credentials, you should have some information like this:

Primary: rtmp://p.ep12345.i.akamaientrypoint.net/EntryPoint
Backup:  rtmp://b.ep12345.i.akamaientrypoint.net/EntryPoint
User: ######
Pass: ******
Stream: [EVENT_ANGLE_BITRATE]@12345

Playback: http://zencoder_hd1_1-lh.akamaihd.net/[EVENT_ANGLE_BITRATE]@12345

@mmcc
mmcc / index.html
Last active December 17, 2015 12:29
Video.js example cue plugin for Spree Conf.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link href="http://vjs.zencdn.net/4.0/video-js.css" rel="stylesheet">
@mmcc
mmcc / request.json
Last active December 17, 2015 16:38
Live CDN example
{
"live_stream": true,
"outputs": [
{
"label": "rtmp300",
"size": "480x270",
"video_bitrate": 300,
"live_stream": true
},
{
@mmcc
mmcc / encrypted.md
Last active August 31, 2022 07:20
Encrypt / Decrypt MP3

Request

You can create an encrypted mp3 using Zencoder's encryption settings:

{
  "input": "s3://my-bucket/super-secret.mp3",
  "output": [
    {
      "format":"mp3",

"url":"s3://my-bucket/super-secret-encrypted.mp3",

@mmcc
mmcc / user-preferences.sublime
Created August 15, 2013 05:04
sublime preferences
{
"color_scheme": "Packages/Base16/base16-eighties.dark.tmTheme",
"detect_indentation": true,
"draw_white_space": "selection",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
".tags*",
"*.pyc",
@mmcc
mmcc / progress.js
Created November 29, 2013 15:05
Bootstrap Zencoder progress
var jobId = 12345;
var jobProgress = 0;
function poll() {
setTimeout(function() {
$.ajax({
url: 'https://app.zencoder.com/api/v2/jobs/' + jobId + '/progress',
type: 'GET',
headers: { "Zencoder-Api-Key": 'ZENCODER READ ONLY API KEY' },
//dataType: 'json',
@mmcc
mmcc / live-cdn.js
Last active January 2, 2016 14:48
Live stream to Zencoder CDN. Requires cdn feature flag to be enabled on the account.
// require Zencoder integration library
var zencoder = require('zencoder')()
, colors = require('colors');
console.log('Sending API request...'.blue);
// send a request
zencoder.Job.create({
"live_stream": true,
"event_length": 600,
@mmcc
mmcc / vjs.less
Created January 21, 2014 22:55
VJS optional slider handles
/*!
Video.js Default Styles (http://videojs.com)
Version GENERATED_AT_BUILD
Create your own skin at http://designer.videojs.com
*/
// To customize the player skin, change the values of the variables or edit the
// CSS below.
// (This file uses LESS. Learn more at http://lesscss.org/)
@mmcc
mmcc / bc-play-converter.js
Created January 24, 2014 21:35
Convert some BC Play videos.
var zc = require('zencoder')()
, request = require('request')
, options = {};
function initialize(output_location) {
var timestamp = new Date();
options.folder = timestamp.toISOString() + '/';
options.base_url = "s3://zencoder-jobs/"
console.log("Files will be placed in " + options.folder);
getRenditions();