Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.
brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
/** | |
* Get the intersection points between a line segment and a rectangle with rounded corners. | |
* @param x0 The x-axis coordinate of the segment's starting point. | |
* @param y0 The y-axis coordinate of ththe segment's ending point. | |
* @param x1 The delta-x of the ray. | |
* @param y1 The delta-y of the ray. | |
* @param x The x-axis coordinate of the rectangle. | |
* @param y The y-axis coordinate of the rectangle. | |
* @param w The width of the rectangle. |
height: 600 |
// Adapted from: http://stackoverflow.com/questions/563198/how-do-you-detect-where-two-line-segments-intersect/1968345#1968345 | |
function line_intersects(p0_x, p0_y, p1_x, p1_y, p2_x, p2_y, p3_x, p3_y) { | |
var s1_x, s1_y, s2_x, s2_y; | |
s1_x = p1_x - p0_x; | |
s1_y = p1_y - p0_y; | |
s2_x = p3_x - p2_x; | |
s2_y = p3_y - p2_y; | |
var s, t; |
var p1 = { | |
x: 20, | |
y: 20 | |
}; | |
var p2 = { | |
x: 40, | |
y: 40 | |
}; |