Skip to content

Instantly share code, notes, and snippets.

@krzemienski
krzemienski / dash_and_hls_cenc_cbcs_multi_codec_packaging_shaka_bento4.py
Created September 2, 2020 21:19
Packaging multi codec DASH and HLS with cenc and cbcs encryption for widevine, playready, and fairplay w/ shaka & bento4
def package_local_targets(input_dir, output_dir):
trace = 'package_local_targets'
os.chdir(input_dir)
try:
print(f"{trace}: create directory {output_dir}")
os.makedirs(output_dir)
except FileExistsError:
print(f"delete existing {output_dir}")
shutil.rmtree(output_dir)
@Rajeshr34
Rajeshr34 / wkhtmltopdf.sh
Last active July 8, 2024 05:42
Wkhtmltopdf With Patched QT Setup Ubuntu 16+
cd ~
apt-get install libfontenc1 xfonts-75dpi xfonts-base xfonts-encodings xfonts-utils openssl build-essential libssl-dev libxrender-dev git-core libx11-dev libxext-dev libfontconfig1-dev libfreetype6-dev fontconfig -y
#https://github.com/wkhtmltopdf/wkhtmltopdf/releases
#replace arch
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
apt --fix-broken install
@i-like-robots
i-like-robots / ads.js
Last active January 28, 2021 14:16
Minimum viable IMA implementation for desktop and mobile with support for autoplay when available and basic error handling.
'use strict'
const CLASSNAME_WAITING = 'is-waiting'
const CLASSNAME_LOADING = 'is-loading'
const CLASSNAME_PREROLL = 'is-preroll'
const CLASSNAME_PLAYING = 'is-playing'
const CLASSNAME_PROBLEM = 'is-problem'
// <https://developers.google.com/interactive-media-ads/docs/sdks/html5/sdk-player>
function ads (target) {
@Snawoot
Snawoot / ffmpeg_surfaces.patch
Created January 1, 2017 12:09
Lower surfaces usage for nvenc encoding process
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index a3a2ef5..1691d15 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -1157,7 +1157,7 @@ static av_cold int nvenc_setup_surfaces(AVCodecContext *avctx)
NvencContext *ctx = avctx->priv_data;
int i, res;
int num_mbs = ((avctx->width + 15) >> 4) * ((avctx->height + 15) >> 4);
- ctx->nb_surfaces = FFMAX((num_mbs >= 8160) ? 32 : 48,
+ ctx->nb_surfaces = FFMAX((num_mbs >= 8160) ? 8 : 12,
@thebinarypenguin
thebinarypenguin / DiceRoller.js
Created June 19, 2013 01:27
A dice roller library for javascript
/*
* A virtual dice roller that accepts standard dice notation
*
*
* Dice Notation
*
* [Num Dice] d <Num Sides> [Modifier]
*
*
* Num Dice - Number of dice to roll (optional)
@jkstill
jkstill / proc_net_tcp_decode
Last active May 8, 2024 13:54
decode entries in /proc/net/tcp
Decoding the data in /proc/net/tcp:
Linux 5.x /proc/net/tcp
Linux 6.x /proc/PID/net/tcp
Given a socket:
$ ls -l /proc/24784/fd/11
lrwx------ 1 jkstill dba 64 Dec 4 16:22 /proc/24784/fd/11 -> socket:[15907701]