-
Notifications
You must be signed in to change notification settings - Fork 57
Compression Settings
Whenever running UltraGrid with uncompressed video, it is desirable to use Jumbo frames if possible (see here):
uv -m 8500 <other_parameters> receiver
This tells UltraGrid to use Jumbo Frames (You have to have Jumbo frames enabled along the whole path, see Setup how to set it up on endpoints).
To compress the video, use the option -c
with one of the following
parameters
-
RTDXT:DXT1
- GPU DXT1 compression - decreases bandwidth to 1/4 for YUV 4:2:2 or to 1/8 for RGBA -
RTDXT:DXT5
- GPU DXT5 YCoCg,a bit more exacting version of DXT, with lower compression ratio, but higher quality. -
cuda_dxt
- DXT1/DXT5 using CUDA, superior performance than GLSL based RTDXT but requires a NVIDIA GPU
The resulting command can be
uv -t decklink:mode=Hi50:codec=UYVY -c RTDXT:DXT1 192.0.43.10
- Sender - Centaurus, 8bit, compressed via RTDXT using DXT5 YCoCg compression (Linux only)
uv -t dvs -c RTDXT:DXT5 192.0.43.20
- cuda_dxt, AV Foundation (macOS)
uv -t avroundation -c cuda_dxt 192.0.43.10
- receiver (any platform/GPU)
uv -d gl
Note: To see preliminaries for RTDXT please see the preliminaries page.
If you have compiled JPEG support, you can use JPEG compression, eg:
uv -t decklink -c JPEG
# if DeckLink supports format detection, it can be omitted
You can also set quality and reset-interval of compression:
uv -t decklink -c JPEG:80 # <quality>, 80 is default
Lastly, you can also set CUDA device index, eg:
uv -t decklink -c JPEG:80 --cuda-device
where available devices can be listed with –cuda-device help
You do not need any special settings on the receiver. Of course, also receiver needs to be CUDA-capable and has to have compiled JPEG support.
Please note that JPEG compression is quite sensitive to transmission errors (eg. lost packets), so if you use a lossy network, you may want to use some of FEC schemes.
See page Libavcodec Compression.
Examples:
uv -c cmpto_j2k[optional_parameters] [--cuda-device <first>[,<second>]]
Parameters:
- rate - target bitrate
- quality - decimal number 0-1, higher is better (default 0.7)
- mem_limit - memory limit that encoder can occupy (default 1 GB), recommended as much as possible (without affecting other application)
- tile_limit - number of concurrently compressed images - higher number increases parallelism but also can decrease latency (default 1)
- pool_limit - superset of the above - includes all stages (default 4), similar rules apply)
- cuda-device - CUDA device(s) to use
Usage:
uv [--param param=val[param2=val2]] [--cuda-device <first>[,<second>]]
Following options are available:
- j2k-dec-mem-limit - same as for encoder
- j2k-dec-tile-limit - same as pool_limit for encoder
- j2k-queue-len - maximal number of frames waiting for decompress (default 2)
- j2k-dec-encoder-queue - same as for encoder
- cuda-device - CUDA device(s) to use
Usage:
uv -c cineform[:opts]
use -c cineform:help
to see available options.
Audio compression scheme is selected by –audio-codec option. Currently, libavcodec-supplied compressions are supported. Depending on you libavcodec build, you can use following codecs:
- AAC
- A-law
- FLAC
- G.722
- MP3
- OPUS
- PCM
- speex
- u-law
The preferred codec is OPUS which provides decent quality at low bitrates. You can use SPEEX as well.
There are two options that can be passed with the codec:
- sample_rate - specifies sampling rate to be resampled to before passing to audio codec. This has two results - lower sampling rate results in lower bitrate. Secondly, some codecs (eg. speex) support only limited set of sampling rates (here 32000/16000/8000), so you need to resample to this samplerate if you want to use such codec. Source sampling rate is usually 48 kHz.
- bitrate - for codec that support this setting, you may set this option (currently only OPUS)
Some examples:
uv --audio-codec A-law:sample_rate=8000 # standard 8 kHz A-law compression used in European digital communication (similarly u-law for North America and Japan). Results in 64 kbps dataflow suitable to transmit speech
uv --audio-codec OPUS # high-quality audio codec
uv --audio-codec OPUS:bitrate=64000 # similar as previous, use 64 kbps
uv --audio-codec speex:sample_rate=32000
If you have any technical or non-technical question or suggestion please feel free to contact us at