Skip to content

Reflector settings

Martin Pulec edited this page Nov 8, 2023 · 14 revisions

UltraGrid is bundled with a packet reflector. There are 2 flavors of reflector - first is hd-rum, which a simple packet reflector that retransmits a received flow to multiple recepients. Second is hd-rum-transcode which is capable of transcoding data flows and changing other parameters of flow.

Hd-rum-transcode is a superset of hd-rum in terms of features (it supports packet retransmit as well) but has extensive dependencies (basically the same as UltraGrid). Hd-rum on the other hand has only minimal compile and run-time dependencies but cannot be compiled in Windows.

Table of Contents

Hd-rum

Hd-rum is a simple packet reflector which is located in directory hd-rum-multi (comes with own Makefile, doesn't support Windows).

Syntax is as following:

hd-rum 8M 5004 receiver1 receiver2 ...

where 8M is buffer size and 5004 port (default UltraGrid video port). For audio you'd need use reflector for UltraGrid audio port as well (default is 5006):

hd-rum 8M 5006 receiver1 receiver2 ...

Note: If using the reflector on the same machine as UltraGrid receiver see also Port setting.

Hd-rum-transcode

The other reflector, called hd-rum-transcode, is more powerful. It is capable of transcoding the received video as well as simply retransmitting packets (in a similar way as hd-rum does). It is compiled automatically alongside UltraGrid.

Transcoding occurs when -c parameter (compression) is specified in host options. Usage is:

hd-rum-transcode <global_opts> 8M 5004 <host1_opts> <host1> <host2_opts> <host2> ... <hostn_opts> <hostn>

Note: As for legacy hd-rum, hd-rum-transcode only retransmits/transcodes selected port (here 5004). Because UltraGrid uses different ports for video and audio (5004 and 5006 by default, +2 for audio in general), reflector needs to be run for both, therefore one instance for video and the other for audio.

Note 2: Transcoding is currently not supported for the audio, so the reflector must be run in retransmitting mode.

Sample usage is:

hd-rum-ranscode 8M 5004 \
  -c libavcodec:codec=H.264 receiver1 \
                            receiver2 \
         -m 9000 -c GPUJPEG receiver3                     # video
hd-rum-transcode 8M 5006 receiver1 receiver2 receiver3    # audio

In this setup, first two arguments are mandatory with following meaning:

  • buffer size (here 8M, so 8 MBytes)
  • port to listen to

Furthermore:

  1. receiver1 receives video transcoded to H.264
  2. receiver2 receives unaltered data as it is sent by sender to reflector
  3. receiver3 gets JPEG data in with Jumbo frames
  4. receiver1, receiver2 and receiver3 receive audio retransmitted from sender

Options are (always precede host address which they relate to):

  • -P - TX port to be used (if not specified RX is used)
  • -c - compression

Following options will be used only if '-c' parameter is set:

  • -m - MTU size
  • -l <limiting_bitrate> - bitrate to be shaped to
  • -f - FEC that will be used for transmission.

For more info refer to this page.

Note: If using the reflector on the same machine as UltraGrid receiver see also Port setting.

Port setting

UltraGrid receiver by default binds to port 5004 for video and 5006 for audio. So running a receiver and a reflector on a single machine like this:

hostA $ uv -t testcard -d gl -s testcard -r portaudio localhost
hostA $ hd-rum 8M 5004 hostB hostC
hostA $ hd-rum 8M 5006 hostB hostC

won't work since both UG receiver and reflectors bind to same ports. Explicit port mapping is then needed:

hostA $ uv -t testcard -d gl -s testcard -r portaudio -P 5004:6004:5006:6006 localhost
                                                          ^    ^    ^    ^
                                                       RXvid TXvid RXaud TXaud
hostA $ hd-rum-transcode 8M 6004 -P 5004 hostB -P 5004 hostC
hostA $ hd-rum-transcode 8M 6006 -P 5006 hostB -P 5006 hostC

(Transcoding reflector here is selected because it allows port remmaping /6004->5004, 6006->5006/.)

Note: The above is needed only if UG receiver is on the same machine as reflector(s). If the UltraGrid is sender only or the reflector are on different machine, this is not required.

See also

Clone this wiki locally