Skip to content

Instantly share code, notes, and snippets.

@max-verem
max-verem / blackmagic-10.8.5a4.patch
Created March 28, 2017 08:06
blackmagic-10.8.5a4 under Fedora 25
--- blackmagic-10.8.5a4/blackmagic_lib.c.origin 2017-02-21 01:42:18.000000000 +0200
+++ blackmagic-10.8.5a4/blackmagic_lib.c 2017-03-28 10:54:51.205782144 +0300
@@ -662,7 +662,16 @@
write = 0;
down_read(&current_task->mm->mmap_sem);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+ if (current_task == current)
+ ret = get_user_pages((unsigned long)ptr & PAGE_MASK, *nr_pages, write ? FOLL_WRITE : 0, pages, NULL);
@max-verem
max-verem / demo.c
Created April 7, 2017 08:59
Embedding Flash in Linux GTK Application - Sandbox Violation
#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
package
{
import flash.display.Loader;
import flash.net.URLRequest;
import flash.net.URLStream;
import flash.events.IOErrorEvent;
import flash.events.SecurityErrorEvent;
import flash.events.Event;
import flash.utils.ByteArray;
import flash.utils.Endian;
@max-verem
max-verem / SDI2-SD-qsv.sh
Created May 12, 2017 09:33
Produce live streams with decklink sdi input and intel's h264 codec
#!/bin/bash
D1="[f=hls:hls_flags=delete_segments:hls_list_size=10:hls_time=20]/var/www/html/hls2/stream.m3u8"
D2="[f=mpegts]udp://239.1.1.2:10480?localaddr=10.1.5.99&pkt_size=1316&fifo_size=1000000"
D3="[f=dash:window_size=5:extra_window_size=5:remove_at_exit=1]/var/www/html/dash2/stream.mpd"
ffmpeg \
-v verbose \
-f decklink -i "DeckLink SDI (2)@3" \
-vcodec h264_qsv -a53cc 0 \
@max-verem
max-verem / dash2.html
Created May 12, 2017 09:34
Dash player sample
<!DOCTYPE html>
<html><head><meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta http-equiv="content-type" content="text/html;">
<meta name="viewport" content="initial-scale=1.0 maximum-scale=1.0 user-scalable=no">
<title>M2</title>
<meta name="description" content="M2" />
<meta name="keywords" content="" />
<meta name="robots" content="index, nofollow" />
@max-verem
max-verem / hls2.html
Created May 12, 2017 09:39
HLS playback sample
<html>
<head>
<style>
body {
width: 982px;
margin: 50px auto;
}
</style>
@max-verem
max-verem / hls_to_sdi.sh
Last active September 17, 2022 22:06
hls to sdi
#!/bin/bash
ffmpeg \
-i "http://live.m2.tv:80/hls/stream.m3u8" \
-vf "scale=720:576,fps=fps=25,setdar=dar=16/9,format=pix_fmts=uyvy422" \
-af "aresample=48000" -ac 2 \
-f decklink -y "DeckLink Mini Monitor" \
-acodec copy -vcodec copy \
-f mpegts \
-y "udp://239.1.100.2:10480?localaddr=10.1.5.57&pkt_size=1316&fifo_size=1000000" \
@max-verem
max-verem / 0005-Set-frame-interlaced-if-required-but-still-progressi.patch
Created October 22, 2017 15:52
Set frame interlaced if required but still progressive
From b4a75e97301a3c3ad039a49ba29f6fcedf7d1902 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <[email protected]>
Date: Wed, 4 Oct 2017 09:05:00 -0400
Subject: [PATCH 5/5] Set frame interlaced if required but still progressive
---
src/modules/avformat/consumer_avformat.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/modules/avformat/consumer_avformat.c b/src/modules/avformat/consumer_avformat.c
<?xml version="1.0" ?>
<mlt>
<producer id="item0">
<property name="resource">1080i25_one_multichannel_track.mov</property>
</producer>
<producer id="item1">
<property name="resource">1080i25_one_multichannel_track.mov</property>
</producer>
<?xml version="1.0" ?>
<mlt>
<producer id="item0">
<property name="resource">1080i25_one_multichannel_track.mov</property>
</producer>
<producer id="item1">
<property name="resource">1080i25_one_multichannel_track.mov</property>
</producer>