Skip to content

Instantly share code, notes, and snippets.

View vpalmisano's full-sized avatar

Vittorio Palmisano vpalmisano

View GitHub Profile
@vpalmisano
vpalmisano / bower_install.sh
Last active May 9, 2017 08:29
Bower install with Docker
#!/bin/sh
docker run --rm -it -v $PWD:/workdir node:latest bash -c "cd /workdir; npm install -g bower; bower --allow-root install"
@vpalmisano
vpalmisano / npm_install.sh
Created May 9, 2017 08:30
NPM install with Docker
#!/bin/sh
docker run --rm -it -v $PWD:/workdir node:latest bash -c "cd /workdir; npm install"
@vpalmisano
vpalmisano / Blackmagic v4l loopback
Created September 19, 2017 09:33
Blackmagic v4l loopback
#!/bin/sh
modprobe v4l2loopback exclusive_caps=1
modprobe snd_aloop
GST_DEBUG=3,*decklink*:4 gst-launch-1.0 -tv \
decklinkvideosrc connection=hdmi \
! videoconvert ! videoscale ! videorate \
! video/x-raw,width=1920,height=1080,framerate=25/1,format=UYVY \
! v4l2sink device=/dev/video0 sync=0 \
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Polymer Bin</title>
<link href="https://unpkg.com/@polymer/[email protected]/polymer.html" rel="import" >
<link href="https://unpkg.com/@polymer/[email protected]/polymer-element.html" rel="import" >
apt-get update && apt-get install -y curl apt-transport-https curl software-properties-common nfs-common ntp
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/docker.list
deb https://download.docker.com/linux/$(lsb_release -si | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable
EOF
apt-get update && apt-get install -y --force-yes docker-ce=$(apt-cache madison docker-ce | grep 17.03 | head -1 | awk '{print $3}')
apt-mark hold docker-ce
import sys
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GLib
Gst.init(None)
pipeline = Gst.parse_launch('uridecodebin uri=file://%s name=d d. ! autovideosink d. ! autoaudiosink' %sys.argv[1])
bus = pipeline.get_bus()
bus.add_signal_watch()
#!/bin/bash
csv=$1
read -d '' prog <<'EOT'
function get_var(array, name, convert_bps) {
for (i in array) {
if (array[i] ~ name) {
value = gensub("^"name":", "", "g", array[i])
#!/usr/bin/env bash
function show_usage()
{
echo
echo "USAGE"
echo "-----"
echo
echo " SERVER_URL=https://my.mediasoup-demo.org:4443 ROOM_ID=test MEDIA_FILE=./test.mp4 ./gstreamer.sh"
echo
#!/bin/bash
#
# Usage:
# ./v4l2loopback_script start <videosource> [<total fake sources> <width> <height> <framerate>]
#
set -ex
function start() {
local SRC=${1}
#
# Utility functions for converting an sdp textual format to/from MediaSoup format
#
def sdpToMediasoup(text, config):
"""
Converts an SDP textual description used by GStreamer into the oRTP
format used by MediaSoup
:param text: The SDP text