Skip to content

Instantly share code, notes, and snippets.

@hdkmraf
hdkmraf / timelapse.md
Created Jun 3, 2020 — forked from alexellis/timelapse.md
ffmpeg time-lapse
View timelapse.md

Convert sequence of JPEG images to MP4 video

ffmpeg -r 24 -pattern_type glob -i '*.JPG' -i DSC_%04d.JPG -s hd1080 -vcodec libx264 timelapse.mp4

  • -r 24 - output frame rate
  • -pattern_type glob -i '*.JPG' - all JPG files in the current directory
  • -i DSC_%04d.JPG - e.g. DSC_0397.JPG
  • -s hd1080 - 1920x1080 resolution

Slower, better quality

View text_to_mp3.sh
#!/bin/bash
# Converts txt files to mp3, output goes into same directory as input
# Usage:
# ./text_to_mp3.sh input_file
# Requirements:
# say, ffmpeg
# $1 - filepath
echo "Input text $1"
say -f $1 -o "$1.aiff"
View hierarchichal_aggregation.py
import itertools
import MySQLdb
import pp
from operator import truediv, mul
from itertools import starmap
from functools import reduce
def writeCreateQuery (tableId, columns, table_name, connect_data, label):
conn = MySQLdb.connect (connect_data[0], connect_data[1], connect_data[2], connect_data[3])