Skip to content

Instantly share code, notes, and snippets.

@pinge
pinge / mobile.video.encoding.md
Last active March 19, 2024 20:06
Video and audio encoding for playback in Android and iOS devices

Video and audio encoding for playback in Android and iOS devices

This document aims to provide an easy way encode video optimized for playback in mobile devices that use the Android or the iOS operating systems.

libx264 is used for (single or two-pass) video encoding and libfdk_aac for audio encoding.

ffmpeg, libx264 and libfdk_aac settings are optimized for playback quality and compatibility on Android and iOS. There is extensive documentation and references for each of the settings used and contributions are very welcome :)

@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active July 15, 2024 09:31
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@benwaffle
benwaffle / cv.py
Created January 8, 2015 01:17
edge detection in python
#!/usr/bin/env python2
from cv2 import *
cap = VideoCapture(0)
namedWindow('frame', flags=WINDOW_NORMAL)
createTrackbar('threshold', 'frame', 0, 1024, lambda x: x)
while(True):
ret, frame = cap.read()
x = getTrackbarPos('threshold','frame')
@honjo2
honjo2 / metersToEquatorPixels.java
Created October 8, 2013 00:03
metersToEquatorPixels
float meters = 100.f;
double latRadians = lat * Math.PI / 180;
double metersPerPixel = 40075016.68 / (256 * Math.pow(2, zoom);
float equatorPixels = (float) (meters / Math.cos(latRadians) / metersPerPixel);
@kl
kl / yotsubato.rb
Last active December 19, 2015 15:28
Yotsubato TTS downloader
#encoding: utf-8
require 'fileutils'
require 'open-uri'
require 'sanitize'
#require 'pry'
class YotsubatoDownloader
API = ARGV[1] || "http://208.109.168.116/GetAudio1.ashx?speaker=302&content="
@masak
masak / explanation.md
Last active July 9, 2024 17:07
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.