Skip to content

Instantly share code, notes, and snippets.

View rowntreerob's full-sized avatar

robert rowntree rowntreerob

  • san francisco, ca.
View GitHub Profile
@rowntreerob
rowntreerob / heroku-ffmpeg-java
Last active December 9, 2015 20:38
ffmpeg on heroku in Java using static, precompiled binary ( vulcan NOT REQUIRED ). Include the linux x64 executable in the project and change the app's PATH to include that binary.
//statically linked binary at http://dl.dropbox.com/u/24633983/ffmpeg/index.html <-- get the executable from the tgz here
cd to project dir
mkdir -p vendor/bin
cd vendor/bin
cp ${download}/ffmpeg . <-- copy exec file to the project
chmod 775 ffmpeg
modify java to test ffmpeg execution:
##
List<String> command = new ArrayList<String>();
command.add("ffmpeg");
@rowntreerob
rowntreerob / heroku-ffmpeg
Created December 24, 2012 22:10
vulcan not used because you can get a statically built binary 'ffmpeg' on their download page and simply include the executable in your project. Update the heroku path to include your bin directory and it should run OK.
ffmpeg on heroku using precompiled,static binary for linux-64 ( vulcan not required, just include ffmpeg exec with project )
download the bin file from http://ffmpeg.org/download.html
include it in a 'vendor/bin' folder in your project.
heroku config:set PATH=/app/.jdk/bin:/usr/local/bin:/usr/bin:/bin:/app/vendor/bin <-- so you can invoke 'ffmpeg'
call ffmpeg from the script below installed with project to heroku
#!/bin/bash
@rowntreerob
rowntreerob / heroku-ffmpeg
Created December 24, 2012 22:10
vulcan not used because you can get a statically built binary 'ffmpeg' on their download page and simply include the executable in your project. Update the heroku path to include your bin directory and it should run OK.
ffmpeg on heroku using precompiled,static binary for linux-64 ( vulcan not required, just include ffmpeg exec with project )
download the bin file from http://ffmpeg.org/download.html
include it in a 'vendor/bin' folder in your project.
heroku config:set PATH=/app/.jdk/bin:/usr/local/bin:/usr/bin:/bin:/app/vendor/bin <-- so you can invoke 'ffmpeg'
call ffmpeg from the script below installed with project to heroku
#!/bin/bash
@rowntreerob
rowntreerob / heroku-ffmpeg
Created December 24, 2012 22:20
ffmpeg on heroku using static linked executable ( vulcan not required )
download the static binary for linux-64 from ffmpeg/downloads page and include in heroku project
insert following bash script into heroku project
push to heroku
alter heroku PATH to include the new binaries ( script, ffmpeg )
run the script
#!/bin/bash
# get 2 input files ( jpg , wav ) and use them in 2pass ffmpeg to create an .mp4 output file
shopt -s globstar
@rowntreerob
rowntreerob / gist:8809779
Last active August 29, 2015 13:56
marionette layout that should ALWAYS init it's regions. throws undef error on special condition @ line 113
/*global define, $*/
define(['marionette', 'vent', 'tpl!./templates/layout.html', './views/Header', './views/Footer', './views/ActiveCount',
'./views/RoleListCompositeView', './views/RoleRoleListCompositeView', './views/RoleUserListCompositeView', './views/EmptyRoleListView', './collections/RoleList', './models/Role', 'Parse'
],
function (Marionette, vent, layoutTemplate, HeaderView, FooterView, ActiveCountView, RoleListCompositeView, RoleRoleListCompositeView, RoleUserListCompositeView, EmptyRoleListView, RoleList, Role, Parse) {
"use strict";
return Marionette.Layout.extend({
template: layoutTemplate,
@rowntreerob
rowntreerob / header.js
Last active August 29, 2015 13:57
parse add user to role
/*global define*/
define(['marionette', 'vent', 'tpl!../templates/header.html', '../collections/UserList',
'../models/User', '../models/Role', 'Parse'], function (Marionette, vent, header, UserList, User, Role, Parse) {
"use strict";
return Marionette.ItemView.extend({
template : header,
ui : {
input : '#new-todo'
//in your main app where is main view
loadViews(savedInstanceState);
lt = new LooperThread();
lt.start();
class LooperThread extends Thread {
public Handler handler0;
public void run() {
Looper.prepare();
// Based on Muaz Khan's RecordRTC Repository
//
// https://github.com/muaz-khan/RecordRTC
//
// www.MuazKhan.com
// To address the ios 11 issue of 'no data' in audio
// related to issue of in recording, the 'context/scriptNode' never calling 'onAudioProcess()'
// IF YOU ARE ON IOS and are getting what looks like a valid audio blob on the outside , but
// that has NO DATA in it then you should look very carefully for a sequence where ALL the
// required steps from allocate audioContext thru final disposition of the raw, microphone
@rowntreerob
rowntreerob / gcs-client.js
Created April 4, 2019 21:33
cloud-speech stream continuous - node express client-side
import io from 'socket.io-client';
const socket = io(Config.api.hostgcsio);
let streamStreaming = false;
//=================== recorder lifecycle ===============
recorder = new Recorder({
monitorGain: 0,
numberOfChannels: 1,
bitRate: 44000,
encoderSampleRate: 16000,
originalSampleRateOverride: 16000,
<html>
<button> Start </button>
<audio controls></audio>
<br>
<a id="download">download your file</a>
<script>
var b = document.querySelector("button");
var clicked = false;
var chunks = [];
var recorder;