Skip to content

Instantly share code, notes, and snippets.

ffmpeg -re -i file.ext -f mp4 -movflags hls -c:v libx264 -listen 1 -seekable 0 -g 1 http://localhost:1935/live
<video src="http://localhost:1935/live" controls/>
@emcodem
emcodem / gist:5ae493ab6cae720979048b42a61f1491
Created March 14, 2021 09:52
Prometheus windows exporter config
.\windows_exporter-0.16.0-amd64.exe --collector.textfile.directory c:\temp --collectors.enabled cpu,net,os,cs,cpu,cpu_info,logical_disk,system,textfile
c:\temp\ffastrans_metrics.prom
# HELP test_alpha_total Some random metric.
# TYPE test_alpha_total counter
test_alpha_total 1
@emcodem
emcodem / ffmpeg dolbye decode.txt
Last active May 18, 2021 14:06
ffmpeg dolbye decode
#source file is xdcamhd, thus 8tracks. dbe is on track 3/4, dbe is 16 bit in a 24bit pcm
ffmpeg.exe -i "E:\vizone\Viz_Omneon30s11Origin10.mxf" -filter_complex "[0:a:2][0:a:3]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a pcm_s16le -ar 48000 -f s16le - | ffmpeg -y -i - c:\temp\out.wav
ffmpeg.exe -i E:\temp\Dolby34_2min.mxf -filter_complex "[0:a:2][0:a:3]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a pcm_s16le -ar 48000 -f s16le - | ffmpeg -y -i - -c:a pcm_s16le -ar 48000 -f s16le ffmpeg -i - -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.0 e:\temp\ch0.wav -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.1 e:\temp\ch1.wav -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.2 e:\temp\ch2.wav -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.3 e:\temp\ch3.wav -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.4 e:\temp\ch4.wav -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.5 e:\temp\ch5.wav
@emcodem
emcodem / ctrl+c.c
Created January 26, 2021 16:28
Send Ctrl+C to PID in Windows
#include <Windows.h>
#include <stdio.h>
//sends ctrl+c to pid
//compile with gcc, no options
//first and only argument: int PID
int main(int argc, char** argv){
DWORD pid = atoi(argv[1]);
printf ("Argument PID: %d\n",pid);
@emcodem
emcodem / ffmpeg development infos.txt
Last active December 8, 2020 09:34
ffmpeg development infos
use MSYS64
copy h file to C:\msys64\mingw64\include\avisynth\avisynth_c.h
copy libs to C:\msys64\mingw64\lib
//start
C:\msys64\mingw64.exe
./configure --disable-static --enable-shared --enable-avisynth --enable-gpl
make -j4
//rebuild only a part
import aaf2
import sys
import json
import urllib.parse
from timecode import Timecode
class TimelineFrame:
#contains relevant information about a single frame
def __init__(self, url, start_offset,left_neighbour,framenum):
self.url = url