Skip to content

Instantly share code, notes, and snippets.

View fernandoherreradelasheras's full-sized avatar

Fernando Herrera fernandoherreradelasheras

View GitHub Profile
#include <SDL2/SDL.h>
#include <unistd.h>
#include <stdio.h>
/* Compile with:
* g++ -g -o sdl2_wayland_libdecor_bug sdl2_wayland_libdecor_bug.cpp `sdl2-config --cflags --libs`
*/
const int disp_w = 400, disp_h = 300;
static SDL_Window *window = NULL;
@fernandoherreradelasheras
fernandoherreradelasheras / smart-video-cutter.sh
Created February 26, 2022 17:01
Smart video cutter with minimal transcoding using ffmpg
#!/usr/bin/bash
#
# Cut a fragment of a video with the minimal possible re-encoding.
# If the new start point is not a key frame it reencodes the video
# from that point until the frame before a new keyframe. The remaining
# part is copied as passthrough and both fragments are concatenated
#
# In order to make the video streams compatible we use the same codec
# and bitrate. This works fine with h264. No idea about other codecs
@fernandoherreradelasheras
fernandoherreradelasheras / mpv-freedesktop-screensaver-plugin.c
Created April 12, 2021 11:25
mpv pluging to inhibit screensaver while playing a video using freedesktop dbus api
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <gio/gio.h>
#include <mpv/client.h>
/**
* mpv pluging to inhibit screensaver while playing a video on GNOME Desktop