Skip to content

Instantly share code, notes, and snippets.

View derpeter's full-sized avatar
🖖

derpeter derpeter

🖖
  • planet earth, milkiway
View GitHub Profile
@derpeter
derpeter / gist:306452b1b6a8c569690a43de49145d8b
Last active October 22, 2017 09:41
reencode unsupported audio codec to a second audio track
ffmpeg -y -i in.mkv -map 0:v -c:v copy -map 0:a:0 -c:a:0 copy -map 0:a:0 -c:a:0 ac3 out.mkv
#!/usr/bin/python3
import sys
import time
import threading
import os
import stat
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstNet', '1.0')
from gi.repository import Gst, GstNet
@derpeter
derpeter / media-dl.sh
Last active December 22, 2017 11:54
Download a conference from media.ccc.de
#!/bin/sh
curl https://media.ccc.de/c/gpn17/podcast/mp4.xml | awk -F '"' '/url="/{print $2}' | wget -c -i -
#!/bin/sh
confdir="`dirname "$0"`/../"
. $confdir/default-config.sh
if [ -f $confdir/config.sh ]; then
. $confdir/config.sh
fi
ffmpeg -y -nostdin \
-i - \
-ac 2 \
for i in "*.m4a"; do echo ffmpeg -i $i -ab 192k "$(basename -s .m4a $i).mp3"; done
or
for i in *.m4a; do out=`echo $i | cut -d '.' -f1`; ffmpeg -i $i -ab 192k $out.mp3; done
// Uses Adalight protocol and is compatible with Boblight, Prismatik etc
// "Magic Word" for synchronisation is 'Ada' followed by LED High, Low and Checksum
// source http://thai-fighter.blogspot.de/2014/05/arduino-adalight-clone-with-any-led.html
//
#include <FastLED.h>
///// User definitions /////
// Define the number of LED Controllers
#define NUM_LEDS 30
# Modified adalight arduino version which uses the FastLED ( http://fastled.io/ ) library.
# I found this code at https://forums.adafruit.com/viewtopic.php?f=47&t=59464#p301431 .
# For me it works much more smooth then the original code using SPI.h .
# It works pretty well with Colorswirl boblight and hyperion
#include "FastLED.h"
#include <hsv2rgb.h>
#include <platforms.h>
#include <fastspi_types.h>
#include <colorpalettes.h>