Skip to content

Instantly share code, notes, and snippets.

View khaledmdiab's full-sized avatar

Khaled Diab khaledmdiab

View GitHub Profile
@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.
# Add the Oracle JDK Repos
UBUNTU_VERSION=precise
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu ${UBUNTU_VERSION} main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu ${UBUNTU_VERSION} main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
DEBIAN_FRONTEND="noninteractive" apt-get update
# Accept the Oracle License
echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 boolean true" > /tmp/oracle-license-debconf
/usr/bin/debconf-set-selections /tmp/oracle-license-debconf
@bordaigorl
bordaigorl / USAmap.tex
Last active January 20, 2024 13:24
USA TikZ map
%% Imported from https://upload.wikimedia.org/wikipedia/commons/3/32/Blank_US_Map.svg
%% Translated to TikZ using Inkscape 0.48
\tikzset{USA map/.cd,
state/.style={fill, draw=white, ultra thick},
HI/.style={}, AK/.style={}, FL/.style={}, NH/.style={}, MI/.style={}, MI/.style={}, VT/.style={}, ME/.style={}, RI/.style={}, NY/.style={}, PA/.style={}, NJ/.style={}, DE/.style={}, MD/.style={}, VA/.style={}, WV/.style={}, OH/.style={}, IN/.style={}, IL/.style={}, CT/.style={}, WI/.style={}, NC/.style={}, DC/.style={}, MA/.style={}, TN/.style={}, AR/.style={}, MO/.style={}, GA/.style={}, SC/.style={}, KY/.style={}, AL/.style={}, LA/.style={}, MS/.style={}, IA/.style={}, MN/.style={}, OK/.style={}, TX/.style={}, NM/.style={}, KS/.style={}, NE/.style={}, SD/.style={}, ND/.style={}, WY/.style={}, MT/.style={}, CO/.style={}, ID/.style={}, UT/.style={}, AZ/.style={}, NV/.style={}, OR/.style={}, WA/.style={}, CA/.style={}}
\tikzset{
every state/.style={USA map/state/.style={#1}},
HI/.style={USA map/HI/.style={#1}}, AK/.
@prabirshrestha
prabirshrestha / docker-fig.txt
Last active May 25, 2017 04:53
docker and fig
http://code.tutsplus.com/tutorials/easily-deploy-redis-backed-web-apps-with-docker--cms-20405
vagrant box add ubuntu12 http://files.vagrantup.com/precise64.box
vagrant box init ubuntu12
vagrant box up
vagrant ssh
sudo apt-get update
sudo apt-get install -y curl
curl -s https://get.docker.io/ubuntu/ | sudo sh
@apajak
apajak / smoothscroll
Last active August 29, 2015 13:57
Creates a smooth scrolling. Based off http://tinyurl.com/smoothscrollingjs. Added features: Use the smooth scroll for only specific anchor tags, and keeps the #anchor name for future linking purposes.
var jump=function(e){
//prevent the "normal" behaviour which would be a "hard" jump
e.preventDefault();
//Get the target
var target = $(this).attr("href");
//perform animated scrolling
if(target =='#home' || target=='#about'|| target=='#portfolio' || target=='#contact'){
$('html,body').animate(
{
//get top-position of target-element and set it as scroll target
@qoh
qoh / dbg.h
Created November 9, 2013 17:50
#ifndef __dbg_h__
#define __dbg_h__
#include <stdio.h>
#include <errno.h>
#include <string.h>
#ifdef NDEBUG
#define debug(M, ...)
#else
@goldeneggg
goldeneggg / gen_sbt_skelton
Last active December 25, 2015 22:39
sbtを使用したscalaプロジェクトのスケルトン・ディレクトリ生成スクリプト
#!/bin/sh
NAME=""
PACKAGE_PATH=""
SCALA_VERSION="2.11.0"
SCALATEST_VERSION="2.1.3"
DIR=`pwd`
usage() {
cat << __EOT__
@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet
@solar
solar / install.sh
Created October 19, 2012 09:10
install nginx with supervisord
sudo cp ./nginx.repo /etc/yum.repod.d/
sudo yum install nginx
sudo chkconfig nginx off
# add 'daemon off' to /etc/nginx/nginx.conf
sudo cp ./nginx.ini /etc/supervisord.d/
sudo supervisorctl add nginx
@solar
solar / install.sh
Created October 16, 2012 10:47
install redis with supervisord
#!/bin/sh
version="2.6.3"
priority="20603"
sudo mkdir -p /var/redis /var/log/redis
curl -sL http://redis.googlecode.com/files/redis-${version}.tar.gz | tar zx
cd redis-${version}/
make
sudo make PREFIX=/usr/local/redis/${version} install