Skip to content

Instantly share code, notes, and snippets.

View ozthekoder's full-sized avatar

osman ozdemir ozthekoder

View GitHub Profile
" 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
@ilyesgouta
ilyesgouta / chromecast.js
Created March 26, 2015 22:16
A node.js snippet to stream media files to a Chromecast device
// 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');
@ddennedy
ddennedy / dash-avc264 command lines
Last active July 27, 2022 03:44
Use ffmpeg and mp4box to prepare DASH-AVC/264 v1.0 VoD
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.
@joshuapinter
joshuapinter / video_file_extensions.rb
Created June 20, 2014 19:00
Video File Extensions.
VIDEO_FILE_EXTENSIONS = ['.264',
'.3g2',
'.3gp',
'.3gp2',
'.3gpp',
'.3gpp2',
'.3mm',
'.3p2',
'.60d',
'.787',
@mjackson
mjackson / color-conversion-algorithms.js
Last active June 8, 2024 01:27
RGB, HSV, and HSL color conversion algorithms in JavaScript
/**
* 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