Hardware acceleration Print

  • hardware acceleration, gpu transcoding, nvenc, nvdec, quick sync, va-api, amd amf, low latency
  • 0

Medusa Panel › Stream › Add Stream

Medusa can offload decoding and encoding to a GPU, so one server carries far more channels at a far lower CPU cost. You turn it on per stream (or once in a reusable profile) by choosing a hardware encoder and deciding how much of the pipeline runs on the GPU.

The engine only offers a backend when the matching GPU and driver are present on that server. Install the GPU drivers first — see System requirements. For NVIDIA the driver is installed manually; the helper command bin/web --nvidia-driver-supported lists the driver versions that match the bundled FFmpeg.

Supported backends

  • Intel Quick Sync (QSV) — integrated and Arc GPUs. Encoders: h264_qsv, hevc_qsv.
  • NVIDIA NVENC / NVDEC — GeForce, Quadro and RTX. Encoders: h264_nvenc, hevc_nvenc, and av1_nvenc on AV1-capable cards.
  • AMD (VAAPI) — Radeon GPUs. Encoders: h264_vaapi, hevc_vaapi.
AMD GPU transcoding is a Medusa addition: the original engine accelerates on NVIDIA and Intel only. Radeon cards are offered automatically when the server has an AMD render device (for example /dev/dri/renderD128).

Choose the encoder and the acceleration

Open Medusa Panel › Stream › Add Stream and set the video codec to a hardware encoder (for example h264_nvenc or h264_vaapi). Then set:

  • Hardware Acceleration Method — Full, Partial or Encoding Only. Full runs decode and encode on the GPU; Encoding Only decodes on the CPU and encodes on the GPU; Partial sits between the two.
  • Hardware Device — which GPU to use when the server has more than one. For AMD this is the render node (such as /dev/dri/renderD128).

Encoder settings

  • Preset — NVENC uses p1–p7 (p1 fastest, p7 best quality) plus named presets such as hq and llhq. QSV and AMD VAAPI have no x264/x265-style preset; those presets (ultrafast…veryslow) apply only to the software encoders libx264 / libx265.
  • Profile and Level — apply to the hardware encoders too, by codec. See Codecs and passthrough.
  • Rate control, bitrate and size — CBR or VBR, the target bitrate and the resolution work the same as on the CPU.

Deinterlacing on the GPU

When the source is interlaced, the engine can deinterlace on the same GPU: adaptive_cuvid or yadif_cuda on NVIDIA, advanced_qsv on Intel. Otherwise it falls back to yadif on the CPU. See Filters and overlays.

Verify it is working

Watch the stream statistics: with acceleration active the CPU stays low while the GPU rises, and the stream log names the device it opened.

Keep decode and encode on the same GPU. Decoding on one card and encoding on another forces the frames back through system memory between them and erases most of the saving.
If the hardware encoder is not sharp enough for your top rendition, decode on the GPU and encode just that one tier on the CPU with libx264 / libx265, while the lower tiers stay on the GPU.

Related


Was this answer helpful?

« Back