MediaPipeline¶
-
class
pyforkurento.pipeline.
MediaPipeline
(session_id, pipeline_id, client_class)¶ Base class for adding Media Elements to a Media Pipeline
-
add_endpoint
(endpoint, **kwargs)¶ Adds an Endpoint Media Element to the pipeline
- Params:
- endpoint (str): String representing the type of endpoint to create. Accepts:
WebRtcEndpoint
RtpEndpoint
HttpPostEndpoint
PlayerEndpoint
RecorderEndpoint
- kwargs: Optional named arguments for different endpoints:
webrtc_recv_only (bool): Sets a WebRtcEndpoint to be a receiver only
webrtc_send_only (bool): Sets a WebRtcEndpoint to be a sender only
buffer_size (int): Milliseconds to buffer an RTSP stream in PlayerEndpoint
- uri (str): Media URI for RecorderEndpoint & PlayerEndpoint only.
- For PlayerEndpoint, it’s the media to be played
- Accepted URI schemas are:
file:///path/to/file (File on local file system)
rtsp://<server-ip> (IP camera RTSP URLs)
http(s)://<server-ip>/path/to/file (File on HTTP server)
- For RecorderEndpoint, it’s the location to record to
- Accepted URI schemas are:
file:///path/to/file (File on local file system)
http(s)://<server-ip>/path/to/file (File on HTTP server)
- Returns
Object of the requested endpoint
-
add_hub
(hub, **kwargs)¶ Adds a Hub Media Element to the pipeline
- Params:
- hub (str): String representing the type of hub to create. Accepts:
Composite
Dispatcher
DispatcherOneToMany
- Returns
Object of the requested hub
-
apply_filter
(filter, **kwargs)¶ Applies a Filter to the stream
- Params:
- filter (str): String representing the type of filter to create. Accepts:
FaceOverlayFilter - Overlays an image on a face detected
ZBarFilter - Triggers an event when a QR code is detected
GStreamerFilter - (https://gstreamer.freedesktop.org/documentation/installing/index.html)
ImageOverlayFilter - Overlays an image on the stream
- kwargs: Optional named arguments for different endpoints:
command (str): The gstreamer command (https://gstreamer.freedesktop.org/documentation/tools/gst-launch.html)
- filter_type (str): The type of the gstreamer filter (AUDIO, VIDEO, or AUTODETECT)
The textoverlay command DOES NOT work
- If a command in unrecognised, you might be missing a filter. Try:
sudo apt install libgstreamer-plugins-bad1.0 libgstreamer-plugins-base1.0 libgstreamer-plugins-good1.0 libgstreamer-plugins-ugly1.0
- Returns
Object of the requested filter
-