Skip to content

Instantly share code, notes, and snippets.

View TheWatcher's full-sized avatar
💭
⛏️ Down t'code mines

Chris TheWatcher

💭
⛏️ Down t'code mines
  • England
View GitHub Profile
@TheWatcher
TheWatcher / timelapse.sh
Last active October 22, 2018 21:18
Timelapse generator
#!/bin/bash
# A script to process a series of movies generated by a RoadHawk DC-2
# or similar dashcam into a timelapse.
#
# timelapse.sh <movie directory> <date base> <temp image dir> <output movie>
#
# eg: timelapse.sh tripname 1006 images 20181006.mp4
DIR=$1 # The directory containing the source movie files
#/bin/bash
rm -f video.mp4 files.txt
for i in *.jpg; do
echo "file '$i'" >> files.txt
done
echo "Processing" `cat files.txt | wc -l` "files..."
ffmpeg -r 20 -f concat -i files.txt -vcodec libx264 video.mp4
@TheWatcher
TheWatcher / timelapse.sh
Created April 30, 2016 12:47
Dashcam timelapse generator
#!/bin/bash
echo "Extracting 1 second frames..."
cd source
for i in *.MP4; do
BASE=`basename $i .MP4`
if [ ! -d "../timelapse/${BASE}" ]; then
echo "Converting $BASE..."
mkdir "../timelapse/${BASE}"
ffmpeg -i $i -vf fps=1 -threads 1 "../timelapse/${BASE}/%03d.jpg"
if($subscription -> {"id"}) {
# Note: herein lies a problem. At this point, we have a pre-existing subscription, that
# may or may not be a user's. If it is a user's, it may be active, or have an inactive
# alternate email associated with it - potentially sharing an email with an email-only
# subscription. Consider the following:
#
# Anonymous User sets up subscription s0 to f0, f1 using email e0, system sends auth
# code to e0, user activates it to prove ownership.
# Anonymous user later gets an account, but it is set up to use email e1. User logs in,
# and creates subscription s1 to f1 and f2 using alternate email e0, system sends auth
@TheWatcher
TheWatcher / gist:0a60db0fab9e6421ce8c
Created September 22, 2014 21:30
русский Perl!
#!/usr/bin/perl
use v5.12;
use utf8;
sub имя_функции {
my $параметр = shift;
print "переменная: $параметр\n";
}