muvid.footage.media_views¶
What an editor draws: per-camera filmstrips and the song’s waveform peaks.
The studio’s Edit tab (the redesign in the plan of record’s Edit tab note, §5) draws every camera as a strip of thumbnails on the song’s timeline and the song as a waveform. Both are derived from media the project already holds, both are expensive to make and cheap to keep, so both are CACHED by content and parameters:
filmstrips — one or more JPEG sprite sheets per clip (
cols x rowsframes each,frame_hpixels tall, width from the clip’s own aspect), sampled atfpsframes per second of CLIP time: frameiof a clip is its picture ati / fpss. Cached atfootage/filmstrips/<clip-hash>-<params>/with anindex.json, so a re-call is a file read and a re-uploaded clip with other bytes gets new sheets. Each sheet is registered in the host’s catalog (content-addressed) when the project is hosted, so the screen loads it byartifact_id.peaks — the song’s per-bucket peak absolute amplitude, mono, normalised to
0..1overnequal buckets of the song. Cached atfootage/peaks/<song-hash>-<n>.json.
Every file is written as a NEW file (temp + rename) — the catalog hardlinks them.
Module Attributes
frames per second of clip time, frame height in pixels, frames per sheet (columns x rows), JPEG quality (ffmpeg's 2-31, lower is better). |
Functions
|
One clip's filmstrip record, generating (and caching) it when missing. |
|
|
|
The cache directory name: the clip's content and every parameter. |
|
|
|
- muvid.footage.media_views.FILMSTRIP_FPS = 2.0¶
frames per second of clip time, frame height in pixels, frames per sheet (columns x rows), JPEG quality (ffmpeg’s 2-31, lower is better). 2 fps x 90 px x 10x10 puts 50 s of a clip on one ~100-200 KB sheet.
- Type:
Default sampling of a filmstrip
- muvid.footage.media_views.clip_filmstrip(fp, clip_id, *, fps=2.0, height=90, cols=10, rows=10)[source]¶
One clip’s filmstrip record, generating (and caching) it when missing.
Returns
{duration_s, n_frames, frame_w, frame_h, sheets: [{artifact_id, cols, rows, first_frame, n_frames}]}.- Return type:
- muvid.footage.media_views.filmstrip_key(clip_hash, *, fps, height, cols, rows)[source]¶
The cache directory name: the clip’s content and every parameter.
- Return type:
>>> filmstrip_key("ab" * 32, fps=2.0, height=90, cols=10, rows=10) 'abababababababab-f2-h90-10x10-v2'
- muvid.footage.media_views.song_peaks(fp, *, n)[source]¶
{duration_s, n, peaks}—nbuckets of the song’s peak |amplitude|, mono, normalised so the loudest bucket is 1.0 (all zeros for a silent song).- Return type: