Skip to content

Instantly share code, notes, and snippets.

View vhdirk's full-sized avatar

Dirk Van Haerenborgh vhdirk

View GitHub Profile
#!/usr/bin/env python3
import os
import sys
import unittest
import logging
import pytest
from functools import partial
class DBStub:
@vhdirk
vhdirk / accel_group.rs
Last active May 29, 2018 18:47
gtk-subclass
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+)
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+)
// DO NOT EDIT
use ffi;
use glib;
use glib::object::Downcast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect;
@vhdirk
vhdirk / action.rs
Last active August 24, 2020 01:24
gio-subclass
// This file was generated by gir (https://github.com/gtk-rs/gir @ 9770f76+)
// from gir-files (https://github.com/gtk-rs/gir-files @ b215ee8+)
// DO NOT EDIT
#[cfg(any(feature = "v2_38", feature = "dox"))]
use Error;
use ffi;
use glib;
use glib::object::Downcast;
use glib::object::IsA;
@vhdirk
vhdirk / rtpclient.sh
Last active August 29, 2015 13:58
rtp multicast
#client.sdp
#-------------------
#v=0
#o=- 1396621827000000 1 IN IP4 192.168.2.222
#s=Session streamed by GStreamer
#i=server.sh
#t=1 1
#a=tool:GStreamer
#a=type:broadcast
#m=video 5000 RTP/AVP 96
Gst.ElementFactory.make('ximagesink', 'sink').set_window_handle
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-25-fe429b4248ad> in <module>()
----> 1 Gst.ElementFactory.make('ximagesink', 'sink').set_window_handle
AttributeError: '__main__.GstXImageSink' object has no attribute 'set_window_handle'
[alias]
submodule-rm=!~/.dotfiles/git/git-submodule-rm.sh
cloner= clone --recursive
@vhdirk
vhdirk / multifilesrc.sh
Created March 28, 2013 09:49
Multifilesrc hangs
#create frames
gst-launch-1.0 videotestsrc ! video/x-raw, format=I420, framerate=25/1, width=640, height=480 ! \
videoconvert ! \
timeoverlay halignment=right valignment=top ! clockoverlay halignment=left valignment=top time-format="%Y/%m/%d %H:%M:%S" ! \
tee name="splitter" ! queue ! xvimagesink sync=false splitter. ! \
queue ! videorate ! video/x-raw, format=I420, \
framerate=5/1 ! videoconvert ! pngenc snapshot=false ! multifilesink location=timelapse/%05d.png
#Next, we bundle all png images into one single video, at 25fps
@vhdirk
vhdirk / videobox.sh
Created March 28, 2013 08:18
GStreamer 1.0 videobox
#1.0 version of example found here: http://wiki.oz9aec.net/index.php/Gstreamer_cheat_sheet
gst-launch-1.0 -e videotestsrc pattern="snow" ! video/x-raw, format=I420, framerate=10/1, width=200, height=150 ! \
videobox border-alpha=0 top=-20 left=-25 ! videomixer name=mix ! videoconvert ! xvimagesink \
videotestsrc ! video/x-raw, format=I420, framerate=10/1, width=640, height=360 ! mix.
@vhdirk
vhdirk / gist:5237814
Created March 25, 2013 15:11
gh-pages
# Create a new repo at github called `test`
# On your local machine:
$ cd test
$ git init
Initialized empty Git repository in /Users/bcf/Git/me/test/.git/
$ touch README
$ git add .
$ git commit -m 'first commit'
# wire everything up to the remote at github (replace yourName)
# Convert bayer pattern format
## works
gst-launch-1.0 --gst-debug=capssetter:5 videotestsrc ! video/x-bayer,format=rggb,width=640,height=480,framerate=10/1 ! capssetter join=false caps="video/x-bayer,format=gbrg,width=640,height=480,framerate=10/1" replace=true ! bayer2rgb ! videoconvert ! xvimagesink
# Convert bayer pattern format, with additional capsfilter (that is identical to the capssetter's output caps)
## does not work
gst-launch-1.0 --gst-debug=capssetter:5 videotestsrc ! video/x-bayer,format=rggb,width=640,height=480,framerate=10/1 ! capssetter join=false caps="video/x-bayer,format=gbrg,width=640,height=480,framerate=10/1" replace=true ! video/x-bayer,format=gbrg,width=640,height=480,framerate=10/1 ! bayer2rgb ! videoconvert ! xvimagesink
# Convert bayer caps to GRAY8 (both planar 8-bit, should work)