Skip to content

Instantly share code, notes, and snippets.

View asquared's full-sized avatar

Andrew Armenia asquared

View GitHub Profile
@asquared
asquared / pi_streamer.sh
Last active February 9, 2018 21:31
Raspberry Pi H.264 streaming over TCP
#!/bin/bash
apt-get install xinetd
cat > /etc/xinetd.d/camera << 'EOF'
service camera
{
type = UNLISTED
socket_type = stream
protocol = tcp
wait = no
FFMPEG=/home/armena/ffmpeg/ffmpeg
ARCHIVE=/mnt/video1-volume1/Archive
# List of all the encodes we want for a production.
%.all: %-400.mp4 %-800.mp4 %-1200.mp4 %-2000.mp4 %-2800.mp4 %-3200.mp4 %-4400.mp4
echo "encode done!"
# create files that point to the original source file, this works around
# make's inability to create implicit rules for multiple file types
%.in: $(ARCHIVE)/%.mxf
@asquared
asquared / doge.js
Created March 12, 2014 03:26
Much animation. Such keyer. wow.
/*
* test of V8 keyer animation
*/
({
assets: [
load_asset("/opt/exacore/test_files/doge.png"),
load_asset("/opt/exacore/test_files/such_keyer.png"),
load_asset("/opt/exacore/test_files/much_animation.png"),
load_asset("/opt/exacore/test_files/wow.png")
],
@asquared
asquared / phase_vocoder_simple.cpp
Created April 7, 2013 03:08
Speed up or slow down audio without changing the pitch. Uses the fftw FFT library. Compile with g++ -std=c++11 -g -W -Wall -o phase_vocoder_simple phase_vocoder_simple.cpp -lfftw3f. Run with ./phase_vocoder_simple < raw_floating_point_samples > output_raw_floating_point_samples.
/*
* Copyright (C) 2013 Andrew Armenia
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@asquared
asquared / broken_template_minimal.cpp
Created April 5, 2013 00:26
More fun with non-working templates.
template <typename T>
class B {
};
template <typename T>
class A {
public:
template <typename U> B<U> *alloc_B( );
};
@asquared
asquared / broken_templates.cpp
Last active December 15, 2015 20:00
If you define BREAK_IT, this doesn't compile. I'm not sure why.
#include <iostream>
using namespace std;
template <typename T>
class A;
template <typename T>
class B;
template <typename T>
@asquared
asquared / 96i.cpp
Created March 30, 2013 03:19
Talk to the Yamaha 01v96i from Linux! Record and play back 16-channel 24-bit raw audio. This program pipes its standard input to the mixer, and pipes the mixer's output to standard output.
/*
* Copyright 2013 Exavideo LLC.
*
* This is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of