Skip to content

Instantly share code, notes, and snippets.

@dphov
dphov / 01-hello-world.py
Last active January 13, 2025 07:50
GStreamer mac os x hello world basic tutorial python pygobject
# coding=utf-8
# https://gstreamer.freedesktop.org/documentation/tutorials/basic/hello-world.html
# Also big thanks to https://stackoverflow.com/questions/35137165/gstreamer-1-0-video-from-tutorials-is-not-playing-on-macos
import gi
gi.require_versions({'Gst': '1.0'})
from gi.repository import Gst, GLib
Gst.init(None)
@dphov
dphov / macosx_gstreamer_plugins.md
Last active March 21, 2020 17:17
Mac OS X GSteamer brew install

gst-plugins-base

brew install gst-plugins-base --with-libogg --with-theora --with-libvorbis

gst-plugins-good

brew install gst-plugins-good --with-flac --with-taglib --with-libsoup --with-jpeg --with-libcaca --with-libshout --with-speex

gst-plugins-bad

brew install gst-plugins-bad --with-faad2 --with-libsndfile --with-libmms

gst-plugins-ugly

@dphov
dphov / GStreamer_cheatsheet.md
Created October 27, 2017 05:09
GStreamer 1.12.3, Mac OS Sierra 10.12.6

Video Test Source

To generate a test video stream use videotestsrc

gst-launch-1.0 videotestsrc ! glimagesink

Use the pattern property to select a specific pattern:

@dphov
dphov / .vimrc
Last active November 2, 2017 06:00
My vimrc for vim8
set nocompatible
syntax enable
set encoding=utf-8
set showcmd
filetype plugin indent on
""Whitespace
set nowrap "don't wrap lines
set tabstop=2 shiftwidth=2 " a tab is two spaces (or set this to 4)
set expandtab "usespaces,nottabs(optional)
@dphov
dphov / external.htm
Created October 11, 2017 08:55 — forked from bennadel/external.htm
Exploring Recursive Promises In JavaScript
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>
Exploring Recursive Promises In JavaScript
</title>
</head>
<body>
@dphov
dphov / tmux_build_from_source_CentOS.sh
Last active September 28, 2017 15:14 — forked from P7h/tmux__CentOS__build_from_source.sh
tmux 2.0 and tmux 2.3 installation steps for Ubuntu. Or build from tmux source v2.5 for Ubuntu and CentOS.
# Steps to build and install tmux from source.
# Takes < 25 seconds on EC2 env [even on a low-end config instance].
VERSION=2.5
sudo yum -y remove tmux
sudo yum -y install wget tar libevent-devel ncurses-devel
wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz
tar xzf tmux-${VERSION}.tar.gz
rm -f tmux-${VERSION}.tar.gz
cd tmux-${VERSION}
@dphov
dphov / dash-avc264 command lines
Created September 22, 2017 09:15 — forked from ddennedy/dash-avc264 command lines
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.
# cat << EOF > /dev/null
# https://github.com/gpakosz/.tmux
# (‑●‑●)> released under the WTFPL v2 license, by Gregory Pakosz (@gpakosz)
# /!\ do not edit this file
# instead, override settings in ~/.tmux.conf.local
# -- general -------------------------------------------------------------------
set -g default-terminal "screen-256color" # colors!
@dphov
dphov / factorial.sc
Created September 1, 2017 18:48
factorial created by dphov - https://repl.it/Kctn/0
(define (fact-iter x counter n)
(if (> counter n)
x
(fact-iter (* x counter) (+ counter 1) n)))
(define (fact n)
(fact-iter 1 1 n)
)