Skip to content

Instantly share code, notes, and snippets.

View msurguy's full-sized avatar

Maksim Surguy msurguy

View GitHub Profile
#!/bin/sh
# ------------------------------------------------------------------------------
# Uses FFmpeg to create an H.264 encoded MPEG-4 movie at 30 fps from
# an image sequence; filesize/quality can be tuned with the second parameter.
#
# ------------------------------------------------------------------------------
# Usage:
# > sh makemovie.sh imageFolder 20
# - imageFolder is a folder containing the images
# - 20 is an optional constant rate factor value,
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><style data-href="/styles.494db61b6ee6b0adfe5f.css">.comments-module--comments--23mG5{padding:91.125px}.comments-module--comments--23mG5 h1{text-transform:uppercase;font-family:sans-serif;font-size:12px}.comments-module--comment--29KbI{font-size:18px;line-height:1.5em;margin-bottom:136.6875px;display:block}.comments-module--comment--29KbI p{max-width:540px}.comments-module--comment--29KbI h1,.comments-module--comment--29KbI h2,.comments-module--comment--29KbI h3,.comments-module--comment--29KbI pre{font-size:18px}.comments-module--header--3yRmu{display:block;text-transform:uppercase;font-family:sans-serif;font-size:12px}.comments-module--user--1iX8T{font-weight:700;color:#000}body,html{margin:0;padding:0;width:100%;height:100%}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:1em}.index-module--page--3hrmN{padding-bottom:91.12
@msurguy
msurguy / ffmpeg.md
Created November 4, 2019 06:32 — forked from dvlden/ffmpeg.md
Convert video files to MP4 through FFMPEG

This is my personal list of functions that I wrote for converting mov files to mp4!

Command Flags

Flag Options Description
-codec:a libfaac, libfdk_aac, libvorbis Audio Codec
-quality best, good, realtime Video Quality
-b:a 128k, 192k, 256k, 320k Audio Bitrate
-codec:v mpeg4, libx264, libvpx-vp9 Video Codec
@msurguy
msurguy / timelapse.md
Created July 21, 2019 21:14 — forked from alexellis/timelapse.md
ffmpeg time-lapse

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

@msurguy
msurguy / about.md
Created April 8, 2019 23:53 — forked from mattdesl/about.md
A Browser and Node.js compatible canvas-sketch script for generative and parametric 3D geometry.

Generative Geometry in Browser + Node.js

Here is a script that can be run with canvas-sketch to generate OBJ files from a parametric/algorithmic 3D ThreeJS geometry.

Hitting "Cmd + S" from the canvas-sketch tool will export a PNG and OBJ file of the scene.

If the same script is run from Node, it will simply render the OBJ to stdout, or write to the filename argument if given.

@msurguy
msurguy / .block
Created February 22, 2019 07:36 — forked from getflourish/.block
D3 + Vue.js
license: mit
@msurguy
msurguy / osm.py
Created November 29, 2017 23:17 — forked from fogleman/osm.py
AxiDraw + OpenStreetMap
from imposm.parser import OSMParser
from shapely import geometry, ops
import axi
import math
import sys
# put your lat/lng here
LAT, LNG = 0, 0
@msurguy
msurguy / index.html
Created October 26, 2017 04:48 — forked from bellbind/index.html
[html5][devicemotion]live demo of devicemoton event
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>devicemotion event</title>
<script src="script.js"></script>
</head>
<body>
<h1>devicemotion event demo</h1>
<p>
@msurguy
msurguy / SevenTest.ino
Created March 10, 2017 19:46 — forked from FredDrago/SevenTest.ino
Arduino demo for seven segment display by PetitStudio
#include <Adafruit_NeoPixel.h>
// Adapted from the Adafruit NeoPixel test example.
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_RGB Pixels are wired for RGB bitstream
// NEO_GRB Pixels are wired for GRB bitstream
// NEO_KHZ400 400 KHz bitstream (e.g. FLORA pixels)
@msurguy
msurguy / chase
Created March 7, 2016 17:53 — forked from jwhendy/chase
#include "FastLED.h"
// must use fastLED 3.1: https://github.com/FastLED/FastLED/tree/FastLED3.1
// fast led constants and initialize
#define DATA_PIN 9
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
#define NUM_LEDS 48
CRGB leds[NUM_LEDS];