OS X, udpsink, is there a way to reduce messagesize / split UDP messages into smaller ones?

Ralf Stoye stoye at stoye.com
Mon Jun 16 04:53:13 PDT 2014

On OSX, the maximum Messagesize for UDP is about 9000 (9216 Bytes)
(tested on OS X 10.6 and 10.8, for further reference see http://stackoverflow.com/questions/25841/maximum-buffer-length-for-sendto)
Is there an way force a pipeline / udpsink to split larger messages into smaller ones?

Example Pipeline:
/opt/local/bin/gst-launch-1.0 -vvv -m --gst-debug=6 videotestsrc is-live=true  ! video/x-raw, format=I420, width=1280, height=720, framerate=15/1, pixel-aspect-ratio=1/1, interlace-mode=progressive \
! queue ! x264enc tune=zerolatency speed-preset=ultrafast bitrate=1000 ! queue ! mpegtsmux ! queue ! udpsink host= port=1234

Result ->
0:00:08.625751000 58410    0x1061642d0 LOG             multiudpsink gstmultiudpsink.c:562:gst_multiudpsink_render:<udpsink0> about to send 12596 bytes in 1 blocks
0:00:08.625768000 58410    0x1061642d0 LOG             multiudpsink gstmultiudpsink.c:575:gst_multiudpsink_render:<udpsink0> sending 12596 bytes to client 0x10610b1c0
0:00:08.625904000 58410    0x1061642d0 WARN            multiudpsink gstmultiudpsink.c:607:gst_multiudpsink_render:<udpsink0> warning: Error sending UDP packet
0:00:08.625921000 58410    0x1061642d0 WARN            multiudpsink gstmultiudpsink.c:607:gst_multiudpsink_render:<udpsink0> warning: Reason: Fehler beim Senden der Nachricht: Message too long

BTW. the pipeline works for framerates >= 25, since then the messages are smaller and don't exceed the limit of osx)

another test showing that we error out for messages > 9216 Bytes

(dotimes (n 5000)
(let* ((mess (make-array (+ 8000 n) :element-type '(UNSIGNED-BYTE 8) ))
       (msize (length mess)))
 (unless (numberp (ignore-errors (ccl::send-to mysocket mess msize))  ) (error "n ~a" (+ 8000 n)))))

->  n 9217

More information about the gstreamer-devel mailing list