This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": 7, | |
"title": "InfluxDB internals", | |
"originalTitle": "InfluxDB internals", | |
"tags": [], | |
"style": "dark", | |
"timezone": "browser", | |
"editable": true, | |
"hideControls": false, | |
"sharedCrosshair": false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ffmpeg -i test1.mp4 -vf "[in] scale=iw/2:ih/2, pad=2*iw:ih [left]; movie=test2.mp4, scale=iw/2:ih/2 [right]; [left][right] overlay=main_w/2:0 [out]" Output.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add #include <execinfo.h> to includes | |
// START STACK TRACE | |
void* tracePtrs[100]; | |
int count = backtrace( tracePtrs, 100 ); | |
char** funcNames = backtrace_symbols( tracePtrs, count ); | |
// Print the stack trace | |
printf("Stack trace:\n"); | |
for( int ii = 0; ii < count; ii++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Calculates average bitrate of a video file by looking at size of each frame. Uses ffprobe, sed and awk | |
if [ -z "$1" ]; then | |
echo "Error: No input video file specified" | |
exit 1 | |
fi | |
echo "Estimating bitrate statistics for $1..." ; ffprobe -show_frames -loglevel error $1 | \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Convert seconds to SMPTE timecode JSON object, example input is html video.currentTime */ | |
function secondsToSMPTE(seconds, framerate) { | |
var f = Math.floor((seconds % 1) * framerate); | |
var s = Math.floor(seconds); | |
var m = Math.floor(s / 60); | |
var h = Math.floor(m / 60); | |
m = m % 60; | |
s = s % 60; | |
return {h: h, m: m, s: s, f: f}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Overlays a video with visual debug information: the size (in bytes) of each frame and the type of frame, as well as motion vectors and block types (green P, intra purple/red) | |
# Uses Courier New.ttf as found on OSX (not tested with other font files) | |
ffprobe -loglevel warning -show_frames $1 | grep -A 20 media_type=video | grep "pkt_size\|pict_type" | sed 'N;s/\n/ /' | sed 's/[^=]*=\([0-9]*\)[^=]*=\(.\)/\1 \2 /' | awk '{ printf("%s %16d\n", $2, $1) }' > $1.frames-sizes | |
ffmpeg -loglevel info -vismv pf -debug vis_mb_type -i $1 -b:v 10M -vf "[IN]drawtext= text=Frame type \\, size \=\\> bytes \\<=: x=10: y=299: fontfile=Courier New.ttf: fontcolor=#ffffffcc: box=1: boxcolor=#000000dd: fontsize=16, drawtext= fontfile=Courier New.ttf: textfile=$1.frames-sizes: fontcolor=#ffffffdd: x=310-tw: y=300-12*n: fontsize=18, drawtext= text=frame %{n} PTS %{pts}: x=(w-tw)/2: y=h-(2*lh)-100: fontcolor=white: box=1: boxcolor=0x00000099: fontsize=18[OUT]" $1.bitrate+mv+bt.mp4 | |
sleep 1 | |
rm -f $1.frames-sizes |