Skip to content

Instantly share code, notes, and snippets.

@cfoch
cfoch / dvd.py
Last active June 29, 2020 02:15
dvd.py
import argparse
import pathlib
import pickle
import signal
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("GES", "1.0")
gi.require_version("GstController", "1.0")
from gi.repository import Gtk
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("GES", "1.0")
gi.require_version("GstController", "1.0")
import signal
from gi.repository import Gtk
from gi.repository import GES
from gi.repository import Gst
from gi.repository import GObject
@cfoch
cfoch / video_plus_webcam_recorder.html
Created June 7, 2020 05:40
video_plus_webcam_recorder.html
<body>
<canvas id="canvas" width="800" height="600"></canvas>
<br></br>
<button id="record-button" onclick="startRecording()">Start recording</button>
<button id="download-button" disabled="true" onclick="download()">Download</button>
</body>
<script>
var canvas, context, stream, recordedBlobs, videoStarted, video,
webcamVideo, videoAvailable, webcamAvailable;
@cfoch
cfoch / main.c
Last active May 20, 2020 07:26
cfoch.github.io: 2020-05-20-playing-back-arbitrary-frames-with-appsrc: code 1
#include <gtk/gtk.h>
#include <gst/gst.h>
#define _STR(x) #x
#define STR(x) _STR(x)
#define WIDTH 640
#define HEIGHT 460
#define BUFFER_SIZE WIDTH * HEIGHT * 4
@cfoch
cfoch / send-color-buffers.c
Created April 8, 2020 06:05
Sends manually created colored frames every 1 second
#include <gtk/gtk.h>
#include <gst/gst.h>
#include <gst/audio/audio.h>
#include <string.h>
#define _STR(x) #x
#define STR(x) _STR(x)
#define WIDTH 640
#define HEIGHT 460
@cfoch
cfoch / out
Created August 20, 2019 14:03
sh-4.4$ ninja
[1/29] Compiling C object 'gst-libs/gst/cheese/ca76057@@gstcheese-1.0@sha/face_cheesefacespriteframe.c.o'.
../gst-libs/gst/cheese/face/cheesefacespriteframe.c: In function ‘cheese_face_sprite_frame_set_property’:
../gst-libs/gst/cheese/face/cheesefacespriteframe.c:171:14: warning: unused variable ‘pixbuf’ [-Wunused-variable]
GdkPixbuf *pixbuf;
^~~~~~
[3/29] Compiling C object 'gst-libs/gst/cheese/ca76057@@gstcheese-1.0@sha/face_cheesefacespritekeypoint.c.o'.
../gst-libs/gst/cheese/face/cheesefacespritekeypoint.c: In function ‘cheese_face_keypoint_get_type’:
../gst-libs/gst/cheese/face/cheesefacespritekeypoint.c:61:9: warning: initialization of ‘int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
{ NULL, NULL, NULL}
{
"app-id" : "org.gnome.Cheese",
"runtime" : "org.gnome.Platform",
"runtime-version" : "3.32",
"sdk" : "org.gnome.Sdk",
"branch" : "stable",
"build-options": {
"cflags": "-O2 -g",
"cxxflags": "-O2 -g",
"env": {
{
"app-id" : "org.gnome.Cheese",
"runtime" : "org.gnome.Platform",
"runtime-version" : "3.32",
"sdk" : "org.gnome.Sdk",
"branch" : "stable",
"command" : "cheese",
"tags" : [
"nightly"
],
#include <gst/gst.h>
#include <gtk/gtk.h>
//gcc $(pkg-config --cflags --libs gstreamer-1.0 glib-2.0 gtk+-3.0) simple3.c -o simple3
struct _BusData {
GstElement *pipeline;
GMainLoop *loop;
};
[cfoch@localhost simple]$ make
[ 50%] Built target dlib-example
[ 75%] Building CXX object CMakeFiles/fit-model.dir/fit-model.o
In file included from /home/cfoch/dev/env/eos-prefix/include/eos/core/Image.hpp:25,
from /home/cfoch/dev/checkout/cfoch/cfoch-cv/src/cpp/eos-sample/simple/fit-model.cpp:20:
/home/cfoch/dev/env/eos-prefix/include/eos/core/image/Pixel.hpp:38:49: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type
template <typename... Args, typename = std::enable_if_t<sizeof...(Args) == NumChannels>>
^~~~~~~~~~~
/home/cfoch/dev/env/eos-prefix/include/eos/core/image/Pixel.hpp:38:44: note: suggested alternative: ‘enable_if’
template <typename... Args, typename = std::enable_if_t<sizeof...(Args) == NumChannels>>