Skip to content

Instantly share code, notes, and snippets.

@aisouard
aisouard / test.py
Last active April 26, 2017 08:37
Sample cefpython
# Hello world example. Doesn't depend on any third party GUI framework.
# Tested with CEF Python v55.3+.
from cefpython3 import cefpython as cef
import numpy as np
import cv2
import platform
import sys
VIEWPORT_SIZE = (359, 640)
@aisouard
aisouard / commands.sh
Created April 6, 2017 07:23
Raspbian + QEMU
mount 2017-03-02-raspbian-jessie-lite.img -o offset=$((137216 * 512)) /mnt/rpi/
emacs /mnt/rpi/etc/fstab # Comment the two lines under the first one
touch /mnt/rpi/etc/ld.so.preload
umount /mnt/rpi
qemu-system-arm -M versatilepb -cpu arm1176 -kernel kernel-qemu -hda 2017-03-02-raspbian-jessie-lite.img -serial stdio -no-reboot -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw"
mount 2017-03-02-raspbian-jessie-lite.img -o offset=$((137216 * 512)) /mnt/rpi/
emacs /mnt/rpi/etc/ld.so.preload # Comment the first line
umount /mnt/rpi
@aisouard
aisouard / readVariableInt.js
Last active May 5, 2021 09:53
Reading an EBML variable-length integer
/**
* Read an EBML tag header or length and return their respective values into
* single numbers.
*
* @example
* var tagHeader = new Uint8Array([0x1A, 0x45, 0xDF, 0xA3, 0x01, 0x00, 0x00,
* 0x00, 0x00, 0x00, 0x00, 0x1F]);
* var tagId = readVariableInt(tagHeader, 4, 0);
* console.log('The current tag ID is: ', tagId.value, ', skipping ', tagId.size, ' bytes.');
* // The current tag ID is: 172351395, skipping 4 bytes.
@aisouard
aisouard / peeracle-sample-1.cpp
Last active February 24, 2020 07:58
peeracle-sample-1
using namespace peeracle;
// Ouvrir le fichier de métadonnées
DataStreamInit init;
init.path = "./ma_video.peeracle";
DataStreamInterface *dataStream = new FileDataStream(init);
// Charger le fichier de métadonnées
MetadataInterface *metadata = new Metadata();
metadata->unserialize(dataStream);
cmake_minimum_required(VERSION 3.2)
project(libpeeracle)
add_definitions(-DWEBRTC_LINUX -DWEBRTC_POSIX -DPOSIX -DBUILD_LIBPEERACLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
file(GLOB SOURCE_FILES
peeracle/**/**/*.cc
peeracle/**/**/*.h
@aisouard
aisouard / parse.c
Created June 8, 2015 02:32
Parseur de fichier de métadonnés
#include <stdio.h>
#include <stdlib.h>
unsigned int swap_uint32(unsigned int num) {
unsigned int swapped;
swapped = ((num >> 24) & 0xff) |
((num << 8) & 0xff0000) |
((num >> 8) & 0xff00) |
((num << 24) & 0xff000000);
return swapped;
@aisouard
aisouard / vlc-min-configure
Created June 5, 2015 05:49
vlc minimal configure
./configure --enable-static --disable-shared --disable-archive --disable-live555 --disable-dc1394 --disable-dv1394 --disable-linsys --disable-dvdread --disable-dvdnav --disable-bluray --disable-opencv --disable-smbclient --disable-dsm --disable-sftp --disable-v4l2 --disable-decklink --disable-gnomevfs --disable-vcdx --disable-vcd --disable-libcddb --disable-screen --disable-vnc --disable-freerdp --disable-realrtsp --disable-macosx-eyetv --disable-macosx-qtkit --disable-macosx-avfoundation --disable-asdcp --disable-dvbpsi --disable-gme --disable-sid --disable-ogg --disable-shout --disable-mkv --disable-mod --disable-mpc --disable-wma-fixed --disable-shine --disable-omxil --disable-omxil-vout --disable-rpi-omxil --disable-crystalhd --disable-mad --disable-mpg123 --disable-merge-ffmpeg --disable-gst-decode --disable-avcodec --disable-libva --disable-dxva2 --disable-vda --disable-avformat --disable-swscale --disable-postproc --disable-faad --disable-vpx --disable-twolame --disable-fdkaac --disable-quicktime --dis
@aisouard
aisouard / gist:feca4c78911a6107e4af
Created June 2, 2015 02:49
cURL configure line
./configure --enable-static --disable-shared --with-pic --disable-gopher --disable-smtp --disable-smb --disable-imap --disable-pop3 --disable-tftp --disable-telnet --disable-dict --disable-rtsp --disable-ldaps --disable-ldap --disable-file --disable-ftp --without-libssh2 --without-librtmp
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.
>npm test
> wrtc@0.0.55 test C:\Users\vm\node-webrtc
> node test/all.js
TAP version 13
# create a peer connection
ok 1 created
# createOffer function implemented
ok 2 implemented