Skip to content

Instantly share code, notes, and snippets.

View nathanbabcock's full-sized avatar
🛠️

Nathan nathanbabcock

🛠️
View GitHub Profile
@nathanbabcock
nathanbabcock / comma_iter.rs
Created February 13, 2023 19:20
Rust comma iterator (w/ parenthesis support)
use std::str::Chars;
/// An iterator over comma-separated values, **ignoring commas inside parentheses**.
///
/// ## Examples
///
/// ```rust
/// use ffmpeg_sidecar::util::CommaIter;
///
/// let string = "foo(bar,baz),quux";
@nathanbabcock
nathanbabcock / pix_fmts.md
Created February 13, 2023 20:48
ffmpeg -pix_fmts
$ ffmpeg -pix_fmts
ffmpeg version 2023-01-18-git-ba36e6ed52-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev7, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt
--enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enabl
@nathanbabcock
nathanbabcock / TauriLoader.ts
Created March 24, 2023 20:00
Use Tauri's HTTP package to play Hls.js livestreams
import {
type HlsConfig,
type Loader,
type LoaderCallbacks,
type LoaderConfiguration,
type LoaderContext,
type LoaderOnProgress,
type LoaderResponse,
type LoaderStats,
} from 'hls.js'
@nathanbabcock
nathanbabcock / localhost.rs
Created April 11, 2023 17:11
Bundled localhost server to use for streaming local videos in Tauri
use std::thread::JoinHandle;
/// Filesystem proxy server with strictly limited permissions and auth required.
/// Required workaround for Edge Webview2 streaming memory leak
pub fn spawn_localhost_server(localhost_port: u16, random_access_token: String) -> JoinHandle<()> {
use rouille::{Response, percent_encoding};
use std::{
cmp::min,
fs::File,
io::{Read, Seek, SeekFrom},
[aws]
symbol = " "
[buf]
symbol = " "
[c]
symbol = " "
[conda]