Skip to content

Instantly share code, notes, and snippets.

View agrathwohl's full-sized avatar
👨‍🌾

Andrew Grathwohl agrathwohl

👨‍🌾
View GitHub Profile
@agrathwohl
agrathwohl / post.md
Created April 22, 2021 22:53 — forked from chrisguttandin/post.md
What else can we do with the Web Audio API?

What else can we do with the Web Audio API?

Of course the Web Audio API is meant for synthesizing and processing audio data. It is tailored for that use case. But at least in our digital world audio data is just a series of numbers, which are typically somewhere between +1 and -1. So why can't we use the Web Audio API for general computations?

Almost a year ago I had the pleasure to give a talk at the Web Audio Conference in Atlanta. The conference featured a lot of great talks, which I really appreciated as an attendee. However, as a speaker it was tough to reduce my own talk until it was short enough to fit into the schedule. I had the feeling that I had to rush through my slides. Since then I planned to write down my findings in a more detailed way, but I never got around to it. Luckily I was asked to repeat my talk at our local Web Audio Meetup here in

Bento4

Bento4 is a C++ class library and tools designed to read and write ISO-MP4 files. This format is defined in international specifications ISO/IEC 14496-12, 14496-14 and 14496-15. The format is a derivative of the Apple Quicktime file format, so Bento4 can be used to read and write most Quicktime files as well.

Features

execute pathogen#infect()
syntax on
filetype plugin indent on
colorscheme badwolf
set noswapfile
set number " Show number lines
set autoindent
filetype plugin indent on
let t_Co=256
let g:netrw_dirhistmax = 0
[options]
font = Hack 12
[colors]
foreground = #e0dadb
#foreground_bold = #ffffff
#include </home/agrathwohl/.colors/urban>
! HiDPI
Xft.dpi: 109
Xft.autohint: 1
Xft.displayfilter: lcddefault
Xft.hintstyle: hintslight
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb

Moving Image Categorization

This document is intended to serve as an overview of moving image categorization best-practices. These practices are implemented by the Library of Congress, arguably the best-organized media archive on the planet. By following these practices, we enable frictionless relationships with ratings agencies, advertisers, media cataloging groups, metadata databases, etc.

Categories

The LoC has defined three types of labels for moving image genre categorization.

  • GENRE - Describes the 'plot' or 'setting' of the video, i.e. #Adventure, #Comedy, or #Romance.
  • SUBDIVISION - Another genre term, but applied as the leading subgenre of the video.
@agrathwohl
agrathwohl / compare.rb
Last active April 8, 2016 16:14
Small ruby class that uses FFmpeg to perform PSNR analysis on two video files.
require "pathname"
require "open3"
class CompareVideo
def initialize(reference, video)
ref = Pathname.new(File.open("#{reference}", "r"))
vid = Pathname.new(File.open("#{video}", "r"))
@comp = [vid, ref] # Video first, reference file second
end
def compare(tech=['psnr','ssim'])
@agrathwohl
agrathwohl / BUILD_FFMPEG+DEPS
Last active November 3, 2015 20:24
Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# BY SACRED DATA MEDIA PARTNERS; WWW.SACREDDATA.IO
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@agrathwohl
agrathwohl / FFmpeg PSNR
Last active December 13, 2022 10:37
Using fluent-ffmpeg to quickly create an MP4->WebM transcode with VP8 video. Adds the psnr flag so that we can get the transcode's peak signal-to-noise ratio. Any result greater than 35dB would be acceptable for most streaming use cases.
[fluent_ffmpeg] node ffmpeg.js
ffmpeg version N-75369-g5ba811b Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 5.2.0 (GCC)
configuration: --prefix=/usr --shlibdir=/usr/lib --pkg-config-flags=--static --disable-static --enable-gpl --enable-gnutls --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-shared --enable-x11grab
libavutil 55. 2.100 / 55. 2.100
libavcodec 57. 2.100 / 57. 2.100
libavformat 57. 2.100 / 57. 2.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 4.100 / 6. 4.100
libswscale 4. 0.100 / 4. 0.100
@agrathwohl
agrathwohl / ffmpeg_ios
Last active January 4, 2026 17:54
FFmpeg options that will make your iOS video experience much better
# FFmpeg / iOS Video Taming
## General Options:
# These settings may be applied to both the INPUT and the OUTPUT
# of the FFmpeg command.
-r 30 # set the frame rate of the video to Apple's recommended 30 fps
-pix_fmt yuv420p # set the output video's pixel format