Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ms 274 live queueing video frames #60

Merged
merged 11 commits into from
Nov 21, 2022

Conversation

jerzywilczek
Copy link
Contributor

This patch makes use of Membrane timers to allow live operation of the
compositor:

  • A timer with interval equal to seconds / frames is started when the element starts operating.

  • Whenever a frame is composed naturally (when all vidoes have frames ready for composition) the timer is restarted.

  • When the timer ticks, a frame is forcibly rendered, using previous frames as fallback in cases where we don't have a frame ready.

  • To protect against stale frames clogging the front of the queue, whenever a frame is rendered stale frames are removed from the front of the queue.

It also adds tests:

  • A new element, BadConnectionEmulator, was added to simulate delays and
    packet loss.

  • The ComposeMultipleInputs pipeline was altered to allow introducing an
    additional filter between the decoder and the compositor.

  • A new test was added (packet_loss.ex). It is completely analogous to
    the h264 pipeline test, but uses the BadConnectionEmulator and sets
    the compositor to live mode.

These tests don't verify much unfortunately. Since some frames are
randomly dropped or delayed, there is no reference result to compare to.

This patch makes use of Membrane timers to allow live operation of the
compositor.

A timer with interval equal to seconds / frames is started when the element starts operating.

Whenever a frame is composed naturally (when all vidoes have frames ready for composition) the timer is restarted.

When the timer ticks, a frame is forcibly rendered, using previous frames as fallback in cases where we don't have a frame ready.

To protect against stale frames clogging the front of the queue, whenever a frame is rendered stale frames are removed from the front of the queue.
A new element, `BadConnectionEmulator`, was added to simulate delays and
packet loss.

The `ComposeMultipleInputs` pipeline was altered to allow introducing an
additional filter between the decoder and the compositor.

A new test was added (`packet_loss.ex`). It is completely analogous to
the h264 pipeline test, but uses the `BadConnectionEmulator` and sets
the compositor to live mode.

This test doesn't verify much unfortunately. Since some frames are
randomly dropped or delayed, there is no reference result to compare to.
test/support/bad_connection_emulator.ex Outdated Show resolved Hide resolved
test/support/bad_connection_emulator.ex Show resolved Hide resolved
lib/membrane/compositor_element.ex Outdated Show resolved Hide resolved
native/membrane_videocompositor/src/compositor/videos.rs Outdated Show resolved Hide resolved
lib/membrane/compositor_element.ex Outdated Show resolved Hide resolved
lib/membrane/compositor_element.ex Outdated Show resolved Hide resolved
lib/membrane/compositor_element.ex Outdated Show resolved Hide resolved
Base automatically changed from prepare-framerate to master November 17, 2022 11:04
lib/membrane/compositor_element.ex Outdated Show resolved Hide resolved
lib/membrane/compositor_element.ex Outdated Show resolved Hide resolved
Copy link
Contributor

@Janix4000 Janix4000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job

@jerzywilczek jerzywilczek merged commit 9619365 into master Nov 21, 2022
@jerzywilczek jerzywilczek deleted the MS-274-live-queueing-video-frames branch November 21, 2022 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants