Skip to content

Instantly share code, notes, and snippets.

View fthiery's full-sized avatar

Florent Thiery fthiery

  • UbiCast
  • Paris
View GitHub Profile
@fthiery
fthiery / oculus.frag
Last active December 22, 2015 22:44
GLES-compatible oculus gstreamer display pipeline
//author: https://gist.github.com/michaeltyson/8235f5016baed5eab288
#extension GL_ARB_texture_rectangle : enable
precision mediump float;
varying vec2 v_texcoord;
uniform sampler2D tex;
const vec4 kappa = vec4(1.0,1.7,0.7,15.0);
const float screen_width = 1280.0;
const float screen_height = 800.0;
@fthiery
fthiery / parse_uwsgi_profiler.py
Created March 9, 2016 10:07
Parser for uWSGI profile data
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016, Florent Thiery
# Run uwsgi with '--profiler pycall' and run the parser on uwsgi.log
import sys
from collections import Counter
HEADER = '##############'
PATTERN = "[uWSGI Python profiler"
@fthiery
fthiery / mediaserver_api_client.py
Last active March 15, 2016 14:02
Python client for the mediaserver API
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016, Florent Thiery
import requests
API_KEY = 'your-api-key'
BASE_URL = 'https://your.mediaserver.net'
VERIFY_SSL = False
PROXIES = {'http': '', 'https': ''}
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2016, Florent Thiery
import os
import sys
import requests
from zipfile import ZipFile
API_KEY = 'my-api-key'
BASE_URL = 'https://my.mediaserver.com'
@fthiery
fthiery / java.desktop
Created June 1, 2016 13:52
Desktop entry for running java jar files from nautilus (among others), copy into /usr/share/applications/
[Desktop Entry]
Name=Java
Comment=Java
GenericName=Java
Keywords=java
Exec=java -jar %f
Terminal=false
X-MultipleArgs=false
Type=Application
MimeType=application/x-java-archive
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import gi
gi.require_version("Gst", "1.0")
gi.require_version("GstAudio", "1.0")
from gi.repository import Gst, GstAudio, GObject
import sys
GObject.threads_init()
Gst.init(None)
@fthiery
fthiery / generate_multichannel_aac.py
Last active October 6, 2017 16:53
Test app to generate aac multichannel samples
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import gi
gi.require_version("Gst", "1.0")
gi.require_version("GstAudio", "1.0")
from gi.repository import Gst, GstAudio, GObject
import sys
GObject.threads_init()
Gst.init(None)
@fthiery
fthiery / create_gst_uninstalled_setup_vaapi_github.sh
Last active November 9, 2017 10:44
gst_uninstalled environment setup using github mirrors with vaapi; note that git-update.sh does not update vaapi
#!/bin/sh
# ----------------------------------------------------------------------------
#
# create-uninstalled-setup.sh
#
# Little shell script that creates a fresh GStreamer uninstalled setup in
# your home directory.
#
# ----------------------------------------------------------------------------
#
#!/bin/bash
FOLDER=/opt/gstreamer
mkdir -p $FOLDER
git clone https://github.com/GStreamer/gst-build.git $FOLDER
cd $FOLDER
mkdir build
meson -Denable_python=true build
cd build
ninja
echo "Now run: $FOLDER/gst-uninstalled.py"
@fthiery
fthiery / python-gst-boilerplate.py
Created July 4, 2018 12:27
Python3 Gstreamer boilerplate
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GLib
Gst.init(None)
p = "videotestsrc is-live=true ! autovideosink"