Skip to content

Instantly share code, notes, and snippets.

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
@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
@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 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 / 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
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/>
"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" -I http "C:\temp\play\test_PCM_DolbyE_PCM_PCM.mxf" :sout=#transcode{vcodec=mp1v,vb=256k,vg=1,acodec=mp2,ab=128,channels=2}:{dst=std{access=file,mux=ts,dst="c:\\temp\\vlc.ts"}} --http-host 127.0.0.1 --http-port 1234 --http-password 1234
@emcodem
emcodem / launch.json
Created January 23, 2023 13:58
ffmpeg vscode launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/ffmpeg_g.exe",
"args": [
"-i",
$ git diff libavcodec/cbs_h2645.c
diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
index 80e48829af..30e213a289 100644
--- a/libavcodec/cbs_h2645.c
+++ b/libavcodec/cbs_h2645.c
@@ -726,7 +726,6 @@ static int cbs_h264_read_nal_unit(CodedBitstreamContext *ctx,
case H264_NAL_PPS:
{
H264RawPPS *pps = unit->content;
-
@emcodem
emcodem / gist:764db05ef10c2ab4f20badc56f00aec1
Last active April 30, 2023 16:15
ffmpeg android commandline
install termux from app store
in termux:
termux-change-repo
* (choose main and bfsu)
apt-install openssl-tool
pkg install ffmpeg
test if ffmpeg works by typing ffmpeg, you should see default ffmpeg output