Skip to content

Instantly share code, notes, and snippets.

View anselmobattisti's full-sized avatar
🇧🇷
Aqui é Brasil!

Anselmo Battisti anselmobattisti

🇧🇷
Aqui é Brasil!
View GitHub Profile
@yashi
yashi / gst-dynamic-pad.c
Last active May 10, 2021 02:25
An Example for GStreamer Dynamic Pad (Decodebin)
#include <gst/gst.h>
static gboolean bus_call (G_GNUC_UNUSED GstBus *bus, GstMessage *msg, gpointer data)
{
GMainLoop *loop = (GMainLoop *) data;
switch (GST_MESSAGE_TYPE (msg)) {
case GST_MESSAGE_EOS:
g_print ("End of stream\n");
@bmount
bmount / gstreamer_udp_rtsp.md
Last active November 14, 2021 16:20
gstreamer udp rtsp

Snippets collected/distilled from gists/blog posts/etc. Combined here for fellow web-searchers -- goal is to have an easy/minimal sink for in-app use, and then forward that stream in another process.

Read camera, push to UDP sink (usually from appsrc, here v4l2 camera):

$ gst-launch-1.0 -vvvv v4l2src ! 'video/x-raw, width=640, height=480, framerate=30/1' ! videoconvert ! x264enc pass=qual quantizer=20 tune=zerolatency ! rtph264pay ! udpsink port=1234

Visualize above:

$ gst-launch-1.0 -vvv udpsrc port=1234 ! "application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264" ! rtph264depay ! h264parse ! decodebin ! videoconvert ! xvimagesink sync=false

@technoknol
technoknol / Laravel - Disable SSL verification for SMTP.php
Created August 18, 2017 11:41
Laravel - Disable SSL verification for SMTP
<?php
// File :: config/mail.php
'stream' => [
'ssl' => [
'allow_self_signed' => true,
'verify_peer' => false,
'verify_peer_name' => false,
],
],
@jmcclellan
jmcclellan / wpseo_breadcrumb_links.php
Created September 28, 2014 01:18
Override Yoast SEO Breadcrumb Trail
@ericelliott
ericelliott / .gitignore
Created November 15, 2016 19:51
Sample Node project .gitignore
node_modules
build
npm-debug.log
.env
.DS_Store
@khalidx
khalidx / simple_http_server_cors.py
Last active September 21, 2023 02:24
Python SimpleHTTPServer with CORS, supporting both Python 2 and 3
#!/usr/bin/env python
# Usage: python simple_http_server_cors.py <port>
try:
# try to use Python 3
from http.server import HTTPServer, SimpleHTTPRequestHandler, test as test_orig
import sys
def test (*args):
test_orig(*args, port=int(sys.argv[1]) if len(sys.argv) > 1 else 8000)
@crearo
crearo / gstreamer-tee-recording-and-display.c
Created March 20, 2017 11:47
Example of tee in gstreamer. recording + display.
#include <string.h>
#include <gst/gst.h>
#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
// v4l2src ! tee name=t t. ! x264enc ! mp4mux ! filesink location=/home/rish/Desktop/okay.264 t. ! videoconvert ! autovideosink
static GMainLoop *loop;
static GstElement *pipeline, *src, *tee, *encoder, *muxer, *filesink, *videoconvert, *videosink, *queue_record, *queue_display;
@beeender
beeender / appsrc-udpsink.c
Last active February 27, 2024 12:57
Gstreamer appsrc streaming though udpsink
#include <gst/gst.h>
#include <gst/app/gstappsrc.h>
static GMainLoop *loop;
static void
cb_need_data (GstAppSrc *appsrc,
guint unused_size,
gpointer user_data)
{
@danharper
danharper / background.js
Last active March 30, 2024 18:25
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@mmaia
mmaia / Very quick localhost kubernetes start
Last active April 4, 2024 15:22
Quick start guide to running Kubernetes localhost for development. A.K.A. -> No BS guide to local Kubernetes.
# Install the following on your machine
1. [Docker](https://docs.docker.com/get-docker/)
- Test with `docker version`
2. [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)
- Test with: `kubectl version`
3. [kind](https://kubernetes.io/docs/tasks/tools/#kind)
- Test with: `kind version`