How ffmpeg detects SBR in AAC files
static int decode_frame_ga(AVCodecContext *avctx, AACDecContext *ac,
GetBitContext *gb, int *got_frame_ptr)
{
// ... parse frame ...| import timeit | |
| import scipy.io.wavfile | |
| t0 = timeit.default_timer() | |
| _, samples = scipy.io.wavfile.read("test.wav") | |
| for channel_ix, max_sample in enumerate(samples.max(axis=0)): | |
| print(f"Channel {channel_ix} max: 0x{max_sample:x}") | |
| t1 = timeit.default_timer() | |
| print(f"Elapsed {(t1-t0)*1000:.3f}ms") |
| #!/usr/bin/env python3 | |
| """ | |
| mp4box_mpd_to_webkit_manifest.py: | |
| Small utility to convert a DASH MPD file coming from MP4Box into a much simpler | |
| JSON manifest as used in WebKit LayoutTests. | |
| --- | |
| MIT License |
| <!DOCTYPE html> | |
| <!-- | |
| Simple page with an HTMLMediaElement, event log and basic controls. | |
| You can use this as a template to explore the behavior of HTMLMediaElement and | |
| look for media playback bugs in web engines. | |
| --> | |
| <html> | |
| <head> | |
| <title>Simple media player</title> | |
| <meta charset="utf-8"> |
| from collections.abc import ItemsView, Set, KeysView | |
| from typing import Iterable, Iterator, NamedTuple, Hashable | |
| class MultiDict[K: Hashable, V: Hashable]: | |
| """ | |
| Associates sets of values with a key. | |
| Values can repeat for different keys if needed. | |
| """ | |
| def __init__(self): | |
| self.__vals_by_key: dict[K, set[V]] = {} |
| #!/usr/bin/env python3 | |
| import os, termios, collections, re | |
| TermAttr = collections.namedtuple("TermAttr", | |
| ["iflag", "oflag", "cflag", "lflag", "ispeed", "ospeed", "cc"]) | |
| old = TermAttr._make(termios.tcgetattr(0)) | |
| new = old._replace( | |
| lflag=old.lflag & ~(termios.ECHO | termios.ICANON) | |
| ) |
| #!/usr/bin/env python3 | |
| ''' | |
| Code by Alba Mendez, manually copied and pasted, had 8 revisions when copied. | |
| https://gist.github.com/mildsunrise/ffd74730504e4dc44f47fc7528e7bf59 | |
| Portable* ISO Base Media File Format dissector / parser. | |
| Usage: ./mp4parser.py <file name> | |
| (*) Needs Python 3.8+ |
| register_path() { | |
| # Usage: | |
| # register_path <env_var_name> <provided_path> [after] | |
| # | |
| # Registers a path in a PATH-like environment variable. | |
| # The provided_path is prepended unless the "after" | |
| # argument is provided, in which case it's appended. | |
| # | |
| # Example: | |
| # register_path LD_LIBRARY_PATH /an/important/path |
| #!/usr/bin/python3 | |
| # Instructions: | |
| # 1. Checkout: https://github.com/Ecosystem-Infra/wpt-results-analysis.git | |
| # 2. cd compat-2021 | |
| # 3. Edit main.js like this: | |
| # const CATEGORIES = [ | |
| # + 'media-source', | |
| # + 'media', | |
| # ]; | |
| # ... |
| #!/bin/bash | |
| set -eu | |
| found_not_mounted=0 | |
| function check_not_empty() { | |
| local path="$1" | |
| if [ ! -d "$path" ]; then | |
| found_not_mounted=1 | |
| echo "ERROR: $path does not exist!" | |
| elif [ ! "$(ls -A "$path")" ]; then |