Because I'll forget how to do this...
crop=w:h:x:y
ffmpeg -i in.mp4 -filter:v "crop=900:700:0:50" out.mp4
/* post-fx pass by blending a solid white fullscreen quad, no texture required */ | |
/*uniform*/ float fmin = 0.7; | |
void main(void) | |
{ | |
float fmod = mod(gl_FragCoord.y, 2.0); | |
float fstep = fmin + (1.0 - fmin) * fmod; | |
gl_FragColor = vec4(1.0, 1.0, 1.0, fstep); | |
} |
#version 120 | |
#extension GL_EXT_gpu_shader4 : require | |
void main(){ | |
gl_FragColor = gl_Color; | |
} |
/** | |
* MOTION_VECTOR | |
* | |
* Calculates motion vector using ffmpeg and libavcodec. | |
* | |
* @authors First modifications by Victor Hsieh. | |
* Second modifications by Jiasi Chen. | |
* Third modifications by Ilya Nikitin <[email protected]>. | |
* | |
* @date: 2014.05.10 23:30:13 |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
var p1={ | |
x:0, | |
y:0 | |
}; | |
var p2={ | |
x:0, | |
y:1 | |
}; |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
Playing around with Boids-style flocking. Click to add more, coloring by movement colors each boid by a moving average of its acceleration magnitude.
See also: Particle tentacles
More boids:
boids by Hugh Kennedy
boids-canvas by Mike Christensen
boids demo by Anoop Elias
flocking in Processing by Daniel Shiffman
#!/usr/bin/env python | |
############################################################################### | |
# $Id$ | |
# | |
# Project: GDAL2Tiles, Google Summer of Code 2007 & 2008 | |
# Global Map Tiles Classes | |
# Purpose: Convert a raster into TMS tiles, create KML SuperOverlay EPSG:4326, | |
# generate a simple HTML viewers based on Google Maps and OpenLayers | |
# Author: Klokan Petr Pridal, klokan at klokan dot cz | |
# Web: http://www.klokan.cz/projects/gdal2tiles/ |