an.media.sinks#
Frame sinks: a frame directory in, one deliverable out – one sink per format.
A sink reads the frame directory the frame stage writes (an.media.frames:
one PNG per output frame, at the declared size) and writes one deliverable. It
knows nothing about what drew the frames, so a stage render, a Manim shot’s
frames or a burns crop sequence go through the same three:
name |
what it writes |
knobs |
|---|---|---|
|
H.264, the pinned argv ( |
|
|
the one palette recipe ( |
|
|
the frames themselves, copied to a directory |
– |
New formats register by name (register_sink()) – a WebM sink, say –
without editing this module. Browser-side sinks (WebCodecs) belong to the
TypeScript side (previz) and are not duplicated here (core study §2.8).
>>> sorted(sink_names())
['gif', 'mp4', 'png']
>>> get_sink("gif", crop="10:10:0:0").crop
'10:10:0:0'
Functions
|
A sink by name, built with |
|
Register a sink factory under |
The registered sink names. |
Classes
|
Writes a frame directory as one deliverable. |
|
The demo gallery's palette recipe. |
|
The silent picture mux (the shot's audio is laid by |
|
The frames themselves, renumbered from 0 into |
- class an.media.sinks.FrameSink(*args, **kwargs)[source]#
Bases:
ProtocolWrites a frame directory as one deliverable.
- class an.media.sinks.GifSink(crop='', fps=12, width=480, max_colours=128, name='gif', suffix='.gif')[source]#
Bases:
objectThe demo gallery’s palette recipe.
- class an.media.sinks.Mp4Sink(pix_fmt=None, name='mp4', suffix='.mp4')[source]#
Bases:
objectThe silent picture mux (the shot’s audio is laid by
an.media.mp4.mux_shot()).pix_fmt=Noneis the module default AT CALL TIME, the seam the bench pulls.
- class an.media.sinks.PngSequenceSink(name='png', suffix='')[source]#
Bases:
objectThe frames themselves, renumbered from 0 into
output(a directory).>>> import tempfile >>> src, out = Path(tempfile.mkdtemp()), Path(tempfile.mkdtemp()) / "seq" >>> _ = frame_path(src, 0).write_bytes(b"png") >>> sorted(p.name for p in PngSequenceSink().write(src, out, fps=24).iterdir()) ['frame_000000.png']
- an.media.sinks.get_sink(name, **knobs)[source]#
A sink by name, built with
knobs; the error lists what exists.- Return type: