pipeparts.mux module¶
Module for multiplexing (mux) and demultiplexing (demux) elements
- class pipeparts.mux.FrameCPPChannelDemuxCheckSegmentsHandler(elem, seglists, jitter=LIGOTimeGPS(0, 1))[source]¶
Bases:
object
Utility to watch for missing data. Pad probes are used to collect the times spanned by buffers, these are compared to a segment list defining the intervals of data the stream is required to have. If any intervals of data are found to have been skipped or if EOS is seen before the end of the segment list then a ValueError exception is raised.
There are two ways to use this tool. To directly install a segment list monitor on a single pad use the .set_probe() class method. For elements with dynamic pads, the class can be allowed to automatically add monitors to pads as they become available by using the element’s pad-added signal. In this case initialize an instance of the class with the element and a dictionary of segment lists mapping source pad name to the segment list to check that pad’s output against.
In both cases a jitter parameter sets the maximum size of a skipped segment that will be ignored (for example, to accomodate round-off error in element timestamp computations). The default is 1 ns.
- pipeparts.mux.avi_mux(pipeline, src)[source]¶
Muxes raw or compressed audio and/or video streams into an AVI file.
- Args:
- pipeline:
Gst.Pipeline, the pipeline to which the new element will be added
- src:
Gst.Element, the source element
- References:
[1] avimux docs: https://gstreamer.freedesktop.org/documentation/avi/avimux.html?gi-language=python
- Returns:
Element, the source merged as avi
- pipeparts.mux.framecpp_channel_demux(pipeline, src, **properties)[source]¶
Demux src using framecpp
- Args:
- pipeline:
Gst.Pipeline, the pipeline to which the new element will be added
- src:
Gst.Element, the source element
- **properties:
dict, keyword arguments to be set as element properties
- References:
[1] framecppdemux implementation: gstlal/gstlal-ugly/gst/framecpp/framecpp_channeldemux.cc
- Returns:
Element, src demuxed using framecpp
- pipeparts.mux.framecpp_channel_mux(pipeline, channel_src_map, units=None, seglists=None, **properties)[source]¶
Mux a source using framecpp
- Args:
- pipeline:
Gst.Pipeline, the pipeline to which the new element will be added
- channel_src_map:
dict, mapping a channel -> src element
- units:
str, default None, if given set these units on source
- seglists:
default None, if given create a segments handler for these segments
**properties:
- Returns:
Element, the muxed sources
- pipeparts.mux.framecpp_channel_mux_from_list(pipeline, *srcs, channels=None, **properties)[source]¶
Mux a source using framecpp
NOTE: This acts similarly to framecpp_channel_mux with a different function signature to map channels to sources.
- Args:
- pipeline:
Gst.Pipeline, the pipeline to which the new element will be added
- *srcs:
Gst.Element, the source elements
- channels:
Union[str, Iterable], default None, the channels mapping to sources
- seglists:
default None, if given create a segments handler for these segments
**properties:
- Returns:
Element, the muxed sources
- pipeparts.mux.ogg_mux(pipeline, src)[source]¶
This element merges streams (audio and video) into ogg files.
- Args:
- pipeline:
Gst.Pipeline, the pipeline to which the new element will be added
- src:
Gst.Element, the source element
- References:
[1] oggmux docs: https://gstreamer.freedesktop.org/documentation/ogg/oggmux.html?gi-language=python
- Returns:
Element, the source merged as ogg format