Contact sheet¶
A grid of frames sampled through a recording.
One frame from each of many videos, tiled into a sheet a corpus can be scanned by eye.
grid() tiles frames from ONE video. This does the other case: a corpus of recordings, one tile
each, so a year of daily sessions is a handful of pictures rather than a folder nobody opens.
WHY IT IS WORTH HAVING. On a 366-day export of daily standstill recordings, every framing fault found was found by a person looking at a sheet like this and not by a measurement: a crop pointed at a colleague rather than the participant, a frame that cut the participant's feet off, a geometry that ran out of room at the bottom. A day framed differently from its neighbours announces itself without any threshold having to be chosen, which is exactly what an automatic check cannot do, because a check has to be told in advance what wrong looks like.
AN UNREADABLE FILE IS LABELLED, not skipped and not silently black. A tile that is simply dark and a tile whose file could not be read look identical, and on that corpus a day was investigated as a fault when the truth was that the sheet had been built while the file was still being written. So a file that will not open gets a tile with UNREADABLE on it.
mg_contact_sheet ¶
mg_contact_sheet(videos, at=None, tile_height=300, per_sheet=40, labels=None, background=(14, 13, 18), ink=(232, 228, 216), target_name=None, overwrite=False)
Tile one frame from each video into one or more contact sheets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
videos
|
list
|
paths to the video files, in the order they should appear. |
required |
at
|
float
|
seconds into each video to sample. Defaults to the midpoint of each file, which is per-file rather than a single number, because a corpus rarely shares one duration and the opening seconds usually hold setup rather than content. |
None
|
tile_height
|
int
|
height of each tile in pixels; width follows the aspect ratio. Defaults to 300. |
300
|
per_sheet
|
int
|
tiles per sheet before starting another. Defaults to 40. |
40
|
labels
|
list
|
one label per video. Defaults to each file's basename without its extension. |
None
|
background
|
tuple
|
sheet background as RGB. Defaults to a near-black. |
(14, 13, 18)
|
ink
|
tuple
|
label colour as RGB. |
(232, 228, 216)
|
target_name
|
str
|
path of the first sheet. Later sheets take a numbered
suffix. Defaults to |
None
|
overwrite
|
bool
|
whether to overwrite an existing file. Defaults to False. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
list |
the |
Example
import glob, musicalgestures as mg sheets = mg.contact_sheet(sorted(glob.glob('exports/*.mp4')))
Source code in musicalgestures/_contactsheet.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |