Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.8.0 (2026-11-17)
Added
mixtape inspect --jsonandGET /api/modelhavefeatures, the names of the enabled features.mixtape --versionprints the versions of mixtape, GStreamer, PyGObject and Python, withnot foundfor what is missing, for a bug report.- A target can be a file:
mixtape run path/to/file.py:Class; its folder is put onsys.path. GraphChangedandModelChangedevents: the player follows the pipeline's shape as it runs (elements a decodebin adds, pads, links, caps) and publishes the newgraph(), and the newdescribe()when the exposed elements change, at most everyPlayer.shape_interval(0.1 s). The commands follow too: an element added later brings its action signals, one removed takes them.- The HTTP page's graph, element sections and perf measures follow those changes without a
reload, keeping open sections and values being typed.
WS /api/eventssendsgraphandmodelmessages on a change. perfwarns about an element added while it runs that was made before it set up the debug log, as its measures carry a tracer's index instead of its name.--feature gst:NAME[,key=value…](orfeatures=["gst:NAME"]) makes any GStreamer tracer a feature with no Python of its own: its options are the tracer's parameters, its readable properties aregst:NAME.propertyand its action signals are commands,gst:NAME.signal, with structure results as JSON. It refusesleaksand the tracersperfreads beside it.- The action signals of exposed elements are commands,
element.signal(mux.split-now), with the parametersarg1,arg2... when the model supports their types. - A documentation site, https://shashi.to/mixtape/, built with MkDocs from
docs/: the command line, writing an application, the HTTP API, measuring performance with a real-world recorder, a WebRTC client and two pipelines that talk to each other. Its code comes from runnable programs inexamples/, and every command and snippet on it runs in the test suite. A command is shown with its output, and a program with what it prints in# >comments, which the tests check. Each pipeline is drawn as a graph, made fromPlayer.graph()and checked against it by the tests. It has a Troubleshooting page, an install flow that starts from a Python with the GStreamer bindings, and links from each API name to the API reference. The development notes of the README moved toCONTRIBUTING.md.
Changed
- The command line is built with Typer: a usage error prints
error: …, the usage line of the command and a pointer to its--help, and exits 2. Options go anywhere,-vbefore and after the command still adds up. mixtape now depends ontyper(<0.30), which bringsrich,shellinghamandannotated-doc. - The command line's errors start in lower case (
error: could not set the pipeline…), and say what to do next where they can. mixtape perf compare --json(andcompare.jsonof--mixtape-perf-baseline):addedandremovedare lists of objects with the keys that name what changed ({"test"},{"test", "metric"}, or{"metric", "subject"}) and not strings of"metric subject";threshold(a fraction) is nowthreshold_percent, as--thresholdis given; the result hasbaseandnew, the folders as given.--feature NAME,nope=1says which options the feature has:feature 'perf' has no option 'nope'; its options: out (path), interval (number > 0).mixtape run demo:Demo extra wordsis refused, as a player class takes no description words; it was read as a description.- The README is an overview with a quick start; the reference moved to the documentation site.
WS /api/eventsopens with amodelmessage, thenvaluesandgraph: a client that expectsvaluesfirst must skip themodelone.Feature.nameis an instance attribute (agst:feature has its own), andFeature.own_tracersnames the tracers a feature reads itself.
Fixed
- The property changes of an exposed element come under its new key when a namesake added
later renames it (
qbecomesa.q); they kept the old one. - A pipeline that links a sometimes pad with
!(decodebin ! queue, alsodecodebin3,uridecodebin,uridecodebin3) plays again after a stop: the player links the new pad to the same peer. GStreamer's parser links the first pad only, so the second play stopped with "not-linked".
0.7.0 (2026-11-17)
The first release since 0.5.1 (0.6.0 was never released). The core is rewritten as one
subclassable asyncio Player, with a declarative model of what it exposes, a command line,
an HTTP control page and feature plugins, among them perf, which measures pipelines with
GStreamer's own tracers, in a player or in a pytest suite. This release breaks the API.
Breaking
- Python 3.12 or later (was 3.6). PyGObject and GStreamer come from the system, not from PyPI;
the one dependency is
pydantic(2.11 or later).attrsandbeppuare no longer used. AsyncPlayer,BasePlayer(mixtape.base) andmixtape.playersare removed: usemixtape.Player, a plain class (no longer anattrsone).from_descriptionis a sync classmethod that needs no running loop;createis removed.set_stateis a coroutine, likeready,pauseandplay: a call withoutawaitdoes nothing.stop(eos=False, timeout=5.0)replacesstop(send_eos=True, teardown=False), so a barestop()no longer sends an EOS first (passeos=True); clean up withteardown()orasync with player.send_eos(timeout=None)waits for the EOS message and returns nothing.__del__is removed.Player.eventsis a method returning an async iterator of themixtape.eventsdataclasses (StateChanged,Eos,Error,Warning,PropertyChanged,Position,Message).PlayerEvents,Statesand theasyncio.Eventsubclasses are removed, and so are theon_*bus handler methods: useadd_handler(message_type, callback).Player.run(description_or_pipeline, timeout=None)is a sync classmethod that plays until EOS and tears down; thecall_play,call_pauseandcall_stophelpers are removed.PlayerAlreadyConfiguredis removed.PlayerDescriptionErroris new, andPlayerPipelineErrorcarriessource,message,debugandgerror.mixtape.featuresis now the package of feature plugins (below); the HTTP interface lives inmixtape.interfaces.http.
Added
- Player.
setup()attaches to the running loop, and every async method attaches lazily.teardown()is idempotent, safe after the loop closed, and the player can be used again. New:play_until_eos,eos,seek,add_handler,call_soon_threadsafe,run_coroutine_threadsafe,mixtape.player.ensure_init, thepending,loop,error,sources,sinks,elementsandenabled_featuresproperties,get_elements_by_gtypeandexposed_elements, and thedescription,state_timeoutandposition_intervalclass attributes. - Errors.
ModelErrorand its subclassesUnknownNameError,InvalidValueError,NotReadableError,NotWritableError,FeatureErrorandCommandError. - Bus policy. An error is stored in
error(the first since the pipeline left NULL), logged and published, sets the pipeline to NULL and reaches the awaiting caller asPlayerPipelineError; a failed start ends in NULL too. Warnings are logged; clock loss, latency and buffering are handled asgst-playdoes. - State changes on a thread. A hung streaming thread no longer freezes the loop: a change
down to READY or NULL that takes longer than
state_timeout(5 s) raisesPlayerSetStateErrornaming the elements still changing, and the player refuses new changes until it finishes;teardownleaves such a pipeline as it is and keeps it for the life of the process. A new state change fails the waits it ends withPlayerSetStateError.async with playerstops the pipeline before the teardown and raises when that stop fails. - Model.
describe()returns a pydantic model, with JSON Schema types, of the player's commands and properties and those of its named elements (all of them withexpose_all=True): types, ranges and current values. Declare your own withprop()(an alias of an element property),@prop(a computed one) and@command; use them withget,set(validated and converted),invokeandnotify. A changed property is published asPropertyChanged, andevents(position=True)addsPositionevents.graph()returns the elements, the links between them and their caps. - Command line.
mixtape run TARGET(alsopython -m mixtape run) plays a pipeline description or amodule:Classuntil EOS or an error, likegst-launch-1.0 -e, with--set PATH=VALUE,--featureand--expose-all. Ctrl-C sends EOS, a second one stops, a third kills. It exits 0 on EOS, 1 on an error or a pipeline that cannot stop, 2 on bad usage and 130 after a second Ctrl-C. On macOS, video windows appear.-vand-vvlog more, and--versionprints the version.mixtape inspect TARGET [--json]prints the model without playing. - HTTP. With the
httpextra (FastAPI and uvicorn, on the player's own loop),mixtape run --http [HOST:]PORTserves a control page generated from the model (transport and position, a form per command, a live control per property, the pipeline graph), a REST API (/api/model,/api/graph,/api/commands/<name>,/api/elements/<element>,/api/properties),WS /api/eventsand the OpenAPI at/docs. It binds to 127.0.0.1 and checksHostandOrigin; there is no authentication. In code:async with mixtape.interfaces.http.serve(player, host, port). - Feature plugins. Subclass
mixtape.Featureto add commands and live properties (name.x) to a player, with the GStreamer elements or tracers itrequires, options validated from__init__, and the hooksprepare(beforeGst.init),initialised,check,attachanddetach. Enable one with thefeaturesclass attribute,features=or--feature name,key=value; packages register their own under themixtape.featuresentry point. Three are built in: leakscounts the GStreamer objects alive by type from the coreleakstracer (leaks.alive,leaks.checkpoint,leaks.reset) and warns about those still alive once the pipeline is in NULL.tracersruns GStreamer tracers, core or gst-plugins-rs, named in the syntax ofGST_TRACERS, and logs them atGST_TRACER:7. The environment'sGST_TRACERSandGST_DEBUGwin, with a warning.perfmeasures element and pipeline latency, the buffers, bitrate and interval of each pad, push time and lateness, queue levels and fill, and process and per-thread CPU, from the core tracers and, when installed, the gst-plugins-rs ones. It reads them from GStreamer's ring buffer logger, so no Python runs on a streaming thread. It publishesperf.summaryevery window, shows it live on the--httppage (on the graph and in uPlot charts), and without=DIRwrites the samples, a CSV per metric,summary.jsonand areport.htmlthat works offline.- pytest plugin.
pytest --mixtape-perf DIRmeasures every test of a GStreamer suite, whether it uses aPlayerorGst.parse_launch: a report per test, a sessionindex.jsonandindex.html, and JUnit properties. A budget,@pytest.mark.perf(pipeline_latency_p95="20ms", ...), fails a test over its limit, and--mixtape-perf-baseline BASEfails a session that got slower than an earlier one. mixtape perf compare BASE NEWcompares two sessions or two runs: a p95 or max that grew by more than--thresholdpercent (default 50) and by more than a floor of its unit is a regression, and it exits 1.--jsonprints the comparison as JSON.
Fixed
- A state wait could be satisfied by a stale state (play, stop, play).
- Pipeline errors went to the loop's exception handler and never reached callers.
- Building a player raised on Python 3.14+ outside a running loop.
Project
- Packaging moved to
pyproject.toml(PEP 621, hatchling), managed by uv. The wheel shipspy.typedand uPlot 1.6.32 (MIT) inmixtape/vendor/uplot. - Checks are ruff, mypy and pytest, run by
scripts/check. CI moved from Travis to GitHub Actions (Ubuntu 24.04, Python 3.12, PyGObject 3.48), and a Docker image runs the same. - A GitHub release gets the wheel and sdist, with build provenance attestations
(
gh attestation verify <file> --repo ashwoods/mixtape).
0.5.1 (2020-07-18)
- Remove pygobject-stubs as test dependency
0.5.0 (2020-07-14)
- Added typing
- Simplified event handling (Precursor for plugin based handling)
- Removed Bus wrapper
- Added basic error handling
0.4.0 (2020-02-24)
- Refactored asyncplayer to use co-routines by default
- Using async bus-based events for asyncio state change