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

Update pipeline to increase gstreamer performance #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joaofigueiredobisect
Copy link
Collaborator

No description provided.

auto* jitter_buffer = gst_element_factory_make("rtpjitterbuffer", NULL);
BST_ENFORCE(jitter_buffer != nullptr, "Failed creating GStreamer element jitter_buffer");
BST_ENFORCE(gst_bin_add(GST_BIN(pipeline), jitter_buffer), "Failed adding jitter_buffer to the pipeline");

// Add pipeline queue1

Choose a reason for hiding this comment

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

I don't think it's a good idea to remove the jitter buffer.

// Add pipeline queue1
auto* queue1 = gst_element_factory_make("queue", NULL);
BST_ENFORCE(queue1 != nullptr, "Failed creating GStreamer element queue");
BST_ENFORCE(gst_bin_add(GST_BIN(pipeline), queue1), "Failed adding queue to the pipeline");
g_object_set(queue1, "max-size-buffers", 3, NULL);

Choose a reason for hiding this comment

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

queue1 handles RTP buffers, while queue2 handles full frames. Each frame may have several thousands of packets, so I don't think it is a good idea to use the same value (3) for both.
Probably the best solution is to work based on time, for example, you could set both to 200 ms.
Also, make sure you set max-size-time, max-size-buffers and max-size-bytes. They all have defaults and we probably don't want to rely on them. If we go with my suggestion (using max-size-time), then we should set both max-size-buffers and max-size-bytes to 0, in order to disable those checks and rely only on time.

// Add pipeline queue1
auto* queue1 = gst_element_factory_make("queue", NULL);
BST_ENFORCE(queue1 != nullptr, "Failed creating GStreamer element queue");
BST_ENFORCE(gst_bin_add(GST_BIN(pipeline), queue1), "Failed adding queue to the pipeline");
g_object_set(queue1, "max-size-buffers", 3, NULL);

Choose a reason for hiding this comment

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

Don't hardcode constants in a function call (3 in this case). Always define constexpr values with meaningful names and explain why you chose that value.

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.

2 participants