Skip to content

Instantly share code, notes, and snippets.

View cybort's full-sized avatar
💥
booom

cybort

💥
booom
  • I will be always collecting before 'everything went down'.
View GitHub Profile
@ankushian
ankushian / AV1Encoding.md
Created June 21, 2025 18:34
AV1 encoding pocket guide (using SVT-AV1)

Tenets of AV1 Encoding

AV1 is a next-generation video codec developed by Alliance of Open Media to facilitate VOD, storage and live-streaming. It's usually paired with Opus audio codec, stored in MP4 (ISOBMFF) or streamed using HLS (HTTP Live Streaming). SVT-AV1 is currently the best production quality encoder available (the matter of discusssion here).

Presets

Quoting the SVT-AV1 documentation:

Presets control how many efficiency features are used during the encoding process, and the intensity with which those features are used. Lower presets use more features and produce a more efficient file (smaller file, for a given visual quality). However, lower presets also require more compute time during the encode process. If a file is to be widely distributed, it can be worth it to use very low presets, while high presets allow fast encoding, such as for real-time applications. >

@ctlllll
ctlllll / longest_chinese_tokens_gpt4o.py
Created May 13, 2024 19:53
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except:
# This supports merging as many adapters as you want.
# python merge_adapters.py --base_model_name_or_path <base_model> --peft_model_paths <adapter1> <adapter2> <adapter3> --output_dir <merged_model>
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import os
import argparse
@s1ntoneli
s1ntoneli / pppdata.js
Created February 2, 2024 17:10
各国家购买力水平清单
const ppp = [
{
"range": "0.0-0.1",
"countries": []
},
{
"range": "0.1-0.2",
"countries": []
},
{
@s-macke
s-macke / gpt-4-tokens.txt
Last active May 20, 2025 19:08
All 100k GPT-4 Tokens. New lines are replaced with \n and carriage returns with \r. The index of the token is (index=line-1). The list is extracted using https://github.com/openai/tiktoken
!
"
#
$
%
&
'
(
)
*
@allenk
allenk / deepclean.cmd
Last active October 12, 2025 20:33
ASUS Software Clean Up Tool
@echo off
:: ------------------------------------------------------------------------------------------------------------
:: Clean Up ASUS All
:: ------------------------------------------------------------------------------------------------------------
:: The tool helps to clean up all ASUS software from system
:: ------------------------------------------------------------------------------------------------------------
:: Before running the tools,
:: 1. Complete backup your system.
:: 2. Disable ASUS Apps from BIOS (MyASUS and Armoury)
:: 3. Run ASUS remove tools (Armoury Crate Uninstall Tool.exe, or geek_uninstall.exe).
@BlueSwordM
BlueSwordM / Simple SVT-AV1 Beginner Guide Part 1.md
Last active October 12, 2025 08:47
Simple SVT-AV1 Beginner Guide Part 1

Since we're dealing with simpler AV1 encoding, that does mean we'll be eskewing aomenc-av1, since it requires 2-pass encoding to be able to take advantage of it, and I use it externally since I have access to a special build.

Now, let's get on with the simple guide.

You'll first need to be reasonably competent with command line builds or use a recent up to date ffmpeg GUI with support for SVT-AV1.

As such, I would recommend getting a master git ffmpeg build for the operating system of your choice right here:

https://github.com/BtbN/FFmpeg-Builds

@BlueSwordM
BlueSwordM / Decoding guide AV1 2022: Decoding and decoding aware encoding optimizations.md
Last active September 30, 2025 03:33
# Maximizing AV1 decoding speed: a modern 2022 encoding and decoding guide!

Hello. I've decided to share a lot more of my knowledge in public forums from now on, and to not divert any of my focus away from improving the world in a way that stays written in history.

This Gist is about discussing on how to improve AV1 decoding performance on 2 fronts: improving performance through more efficient decoding, and through decoding aware encoding.

Improving decoding performance through more efficient decoding.

Here are many tips on how to improve decoding performance on any machine:

1. Keep your favorite media player up to date!

@b01
b01 / download-vs-code-server.sh
Last active July 17, 2025 05:04
Linux script to download latest VS Code Server, good for Docker (tested in Alpine).
#!/bin/sh
# Copyright 2023 Khalifah K. Shabazz
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the “Software”),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions: