[Bug 709826] mpegtsmux: performance issue

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Sat Oct 12 19:36:42 CEST 2013


https://bugzilla.gnome.org/show_bug.cgi?id=709826
  GStreamer | gst-plugins-bad | git

--- Comment #2 from Edward Hervey <bilboed at bilboed.com> 2013-10-12 17:25:29 UTC ---
(In reply to comment #1)
> Created an attachment (id=257098)
 View: https://bugzilla.gnome.org/attachment.cgi?id=257098
 Review: https://bugzilla.gnome.org/review?bug=709826&attachment=257098

> Optimization of stuffing bytesd
> 
> It does seem like there should be room for some optimization. Do we have a
> efficient muxer that we can use for inspiration?

  The problem is due to the very nature of mpeg-ts. In most container formats
you can pass the incoming (audio/video) buffer as-is downstream and you "just"
need to put headers and other things before/after.
  With mpeg-ts, you need to break it down into 188 byte chunks.

  The main performance issue is that we're shuffling around buffers in
adapters, doing (expensive) copies, mallocs and so forth. We shouldn't do that.
We should re-use the input memory as-is (i.e. without reading/copying it) and
just put the required headers before/after.


> 
> Meanwhile, looking at the callgrind output brought my attention to how stuffing
> bytes are written.
> 
> This patch uses memset to set all stuffing bytes to 0xFF instead of using a
> loop to set them byte-by-byte.

  That patch is correct ... but you'll notice that function you optimized
doesn't even appear in the callgrind graph, so it's negligeable :)

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list