Python API

The modules of bbbdl can be used in other Python software by adding bbbdl to their dependencies and importing them at the start of the file.

Note

The following sections are autogenerated from bbbdl’s Python code.

bbbdl.composer

bbbdl.composer.compose_lesson(meeting: Meeting, width: int, height: int) Tracks

Create a stream composed by:

  • the webcam video

  • the deskshare video overlayed on the webcam video

  • the slides images overlayed on the deskshare video when they are enabled

  • the webcam audio

All video streams will be scaled so they all have the same size.

Parameters:
  • meeting – The meeting to create the stream from.

  • width – The width of the video file.

  • height – The height of the video file.

Returns:

A Tracks object containing the video and audio tracks.

bbbdl.composer.compose_screensharing(meeting: Meeting, width: int, height: int) Tracks

Create a stream composed by:

  • the webcam video

  • the deskshare video overlayed on the webcam video

  • the webcam audio

All video streams will be scaled so they all have the same size.

Parameters:
  • meeting – The meeting to create the stream from.

  • width – The width of the video file.

  • height – The height of the video file.

Returns:

A Tracks object containing the video and audio tracks.

bbbdl.resources

class bbbdl.resources.Enable(start: float, end: float)

An object containing two timestamps relative to the start of a meeting.

They represent the moments when a slide should be displayed and hidden from the screen.

end: float
start: float
class bbbdl.resources.Meeting(deskshare: Source, webcams: Source, shapes: List[Slide])

An object representing all resources from a BigBlueButton meeting.

deskshare: Source

The Source for the desktop-sharing stream.

classmethod from_base_url(base_url: str, meeting_id: str) Meeting

Create a new Meeting from a BigBlueButton base url and a meeting id.

Parameters:
  • base_url – The base url of the BigBlueButton instance.

  • meeting_id – The id of the meeting to get the resources from.

Returns:

The created meeting.

Raises:

MetadataNotFoundError – If the metadata request returned a non-2XX status code.

classmethod from_url(url: str) Meeting

Create a new Meeting from any BigBlueButton url by autodetecting the base url and the meeting id.

shapes: List[Slide]

A list of all the Slide in the presentation.

webcams: Source

The Source for the presenter webcam stream.

class bbbdl.resources.Slide(resource: Source, enables: List[Tuple[float, float]])

An object representing a single slide from BigBlueButton.

It contains the Source where the slide can be accessed, and a list of Enable, representing the moments when that slide is displayed on screen.

enables: List[Tuple[float, float]]
resource: Source
class bbbdl.resources.Source(location: str)

A handler for the splitting of a single video source in multiple input nodes.

It can be created by specifying an url pointing to a local or remote video.

It is necessary because the same input source cannot be passed twice to ffmpeg.

classmethod create_from_url(href: str) Source | None

Check if a resource exists at an url, and create a Source from it if it does.

Returns:

The created source.

Raises:

SourceNotFoundError – If the request returned a non-2XX status code.

get_audio() FilterableStream

Get an input audio stream.

Returns:

The created audio stream.

get_video() FilterableStream

Get an input video stream.

Returns:

The created video stream.

bbbdl.tracks

class bbbdl.tracks.Tracks

A container for video and audio tracks. It starts empty, and more tracks can be added with the overlay() and amerge() methods.

amerge(other: FilterableStream, **kwargs)

Merge a new audio track.

overlay(other: FilterableStream, **kwargs)

Overlay a new video track.

bbbdl.urlhandler

bbbdl.urlhandler.playback_regex = re.compile('^(https?://.+)/playback/presentation/2\\.0/playback\\.html\\?meetingId=([0-9a-f-]+)$')

The regex used to parse BigBlueButton playback urls.

bbbdl.urlhandler.playback_to_data(url: str) Sequence[str]

Autodetect the base url and the meeting id from a BigBlueButton playback url.

Returns:

The match groups of playback_regex.

Raises:

ValueError – If the regex doesn’t match.

bbbdl.exc

exception bbbdl.exc.BBBDLException

An Exception occoured in bbbdl.

exception bbbdl.exc.MetadataNotFoundError

The metadata ({base_url}/presentation/{meeting_id}/metadata.xml) of the specified meeting could not be retrieved.

exception bbbdl.exc.SourceNotFoundError

The specified url didn’t return a successful HTTP status code (200 <= x < 300).