This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Converts an RGB color value to HSL. Conversion formula | |
* adapted from http://en.wikipedia.org/wiki/HSL_color_space. | |
* Assumes r, g, and b are contained in the set [0, 255] and | |
* returns h, s, and l in the set [0, 1]. | |
* | |
* @param Number r The red color value | |
* @param Number g The green color value | |
* @param Number b The blue color value | |
* @return Array The HSL representation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VIDEO_FILE_EXTENSIONS = ['.264', | |
'.3g2', | |
'.3gp', | |
'.3gp2', | |
'.3gpp', | |
'.3gpp2', | |
'.3mm', | |
'.3p2', | |
'.60d', | |
'.787', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See my DASH-IF presentation from October, 2014: | |
https://s3.amazonaws.com/misc.meltymedia/dash-if-reveal/index.html#/ | |
1. encode multiple bitrates with keyframe alignment: | |
ffmpeg -i ~/Movies/5D2_Portrait.MOV -s 1280x720 -c:v libx264 -b:v 1450k -bf 2 \ | |
-g 90 -sc_threshold 0 -c:a aac -strict experimental -b:a 96k -ar 32000 out.mp4 | |
My input was 30 fps = 3000 ms. If it were 29.97, then a GOP size of 90 frames will yield a base segment | |
size of 3003 milliseconds. You can make the segment size some multiple of this, e.g.: 6006, 9009, 12012. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A node.js snippet to stream media files to a Chromecast device. | |
// An ac3 or dts audio stream in matroska containers is transcoded to mp3 | |
// using ffmeg. Seeking using left and right keys won't be available. | |
var Client = require('castv2-client').Client; | |
var DefaultMediaReceiver = require('castv2-client').DefaultMediaReceiver; | |
var mdns = require('mdns'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" general | |
m = mark position (eg ma then 'a will go back to that position) | |
cW/cw = change word | |
cB/cb = change till begining of word | |
C = change till end of line (delete from curser to end and go into insert mode) | |
A = insert at end of line | |
dd = del line | |
D = delete till end of line | |
I = go into insert mode at begining of line (before first non-whitespace chars) | |
L = goto bottom of screen |