]> git.sesse.net Git - nageru-docs/blob - hardware.rst
Add a new node about streaming.
[nageru-docs] / hardware.rst
1 Hardware requirements for getting started
2 =========================================
3
4 Nageru is designed to be as plug-and-play as possible, but by nature,
5 a software video mixer requires a certain amount of hardware with associated
6 drivers.
7
8 Working OpenGL
9 --------------
10
11 Nageru uses your computer's graphics processing unit (GPU) extensively,
12 through OpenGL. The use of the GPU is the reason why Nageru can deliver
13 high-quality (as in e.g. gamma-correct fades and high-quality scaling)
14 HD video without a monster CPU, but it also comes with certain caveats.
15
16 In particular, Nageru's use of multithreaded OpenGL trickles bugs in
17 some drivers, as most games access the GPU from only one thread;
18 Mesa didn't work properly at all before version 11.2, and there are still
19 bugs left as of 13.0. However, in general, Intel GPUs from the Haswell
20 generation and newer should work well with Nageru as long as you stick to
21 720p60 (ie., no 1080i inputs, which require deinterlacing). NVIDIA's
22 proprietary drivers (occasionally known as nvidia-glx) are generally excellent
23 and should give few issues in this regard.
24
25 If you see Nageru dying with a message about “GL error”, or segfaulting with
26 the stack trace pointing into libGL.so, your first intuition should be to check
27 that you have the latest drivers for your GPU.
28
29
30 .. _digital-intermediate:
31
32 VA-API H.264 encoding
33 ---------------------
34
35 Even on modern networks and with today's large SSDs, uncompressed HD video is a
36 bit unwieldy to send around (uncompressed 720p60 4:2:0 is about 79 MB/sec,
37 or 663 Mbit/sec). Nageru creates a high-bitrate H.264 stream of the finished
38 output as a sort of “digital intermediate” that can much easier be stored to disk
39 (for future editing or re-streaming) or sent to an encoder on another machine
40 for final streaming.
41
42 Currently, only VA-API is supported for H.264 encoding, although Nageru might
43 support NVIDIA's NVENC at some point in the future. In particular, this means that Intel Quick
44 Sync Video (QSV), the hardware H.264 encoder present on all modern Intel
45 GPUs, is supported. QSV is more than fast enough to keep up with 720p60 in
46 realtime without eating appreciably into the power budget, but it is not
47 competitive with the top H.264 encoders in terms of quality per bit. Also,
48 the stream is encoded using *constant quality* (fixed quantizer), not
49 constant bitrate, which means the bitrate will vary strongly with content.
50 (For practical material, the quantizer used by Nageru will end up around
51 25 Mbit/sec for 720p60, and be nearly visually lossless so as to allow
52 further editing or transcoding without strong generational loss.) Thus, the
53 QSV stream is not intended for streaming to end users of the Internet; it will
54 need to be reencoded by some external means, or you can use Nageru's x264
55 support (see `:doc:Streaming`).
56
57 By default, Nageru uses zerocopy from the GPU to the VA-API buffers in order to
58 reduce memory transfer bandwidth, but this depends on EGL support (as opposed to
59 the older GLX standard), and also that the GPU you are rendering to also
60 supports VA-API. NVIDIA's proprietary drivers do not support either. Unfortunately,
61 this is somewhat cumbersoe  to automatically detect before it's too late to do anything
62 about it (Qt has already initialized using EGL), so on NVIDIA
63 systems, Nageru will exit with an error message asking you to set *--va-display*
64 to your Intel GPU manually. Simply follow the instructions printed to the terminal
65 to select what looks like your Intel GPU, and Nageru will fall back to using GLX
66 and transferring the memory data between the two GPUs via the CPU. (Some BIOSes
67 automatically disable the Intel GPU if you have a discrete GPU installed; you
68 will need to reenable it to get access to QSV, or Nageru can't run.)
69
70
71 Video capture cards
72 -------------------
73
74 If you do not have enough cards to satisfy your theme when you start up
75 Nageru, *fake cards* will be instantiated. They produce a simple color
76 (depending on the card) and no audio (unless you give the --fake-cards-audio
77 command-line flag, in which case they will produce a tone). USB hotplug
78 is supported; once you insert a new card, it will automatically be detected
79 and takes the place of one of the fake cards.
80
81 Currently, Nageru supports only Blackmagic's capture cards; specifically,
82 it does not support Video4Linux. This may change in the future if cards
83 come along that significantly improve upon Blackmagic's lineup in terms
84 of features, price or stability. (Most other cards fail on all three counts.)
85
86 There are separate drivers for the USB and PCI cards. (Thunderbolt cards,
87 although rare, count as PCI cards in this respect.) The USB cards are
88 handled by a driver called *bmusb* that is built into Nageru; they require
89 working USB3 on your machine, but nothing else. (Kernel versions prior to
90 4.6 are not recommended, though. If you get USB issues, upgrade your kernel.)
91 The cards autodetect their input, but unfortunately has no 1080p60 support,
92 which means that most laptops plugged in will default to 1080i60, which
93 probably is not what you want. (In particular, the YADIF deinterlacer
94 employed by Nageru puts a lot of strain on the GPU; too much for most
95 Intel GPUs.)
96
97 The PCI cards (known as DeckLink) require Blackmagic's proprietary driver
98 (`Desktop Video <https://www.blackmagicdesign.com/support>`_) installed
99 and working. It is non-free and thus not included in most Linux distributions.
100 However, the SDK is not needed for building Nageru; the required headers
101 are free and included. Note that the PCI cards generally do not autodetect,
102 so you will need to right-click on the input to set the right mode.
103
104
105 Video format conversion
106 -----------------------
107
108 If you have an input source with a different resolution than the native mode
109 (currently locked to 720p; this will be configurable without recompiling
110 in the future), Nageru will scale transparently for you using a Lanczos3
111 filter. This requires some extra GPU power, so if you can avoid it, use the
112 native mode. Similarly, if you connect an interlaced input, Nageru will
113 automatically deinterlace for you.
114
115 Frame rates are automatically converted; one input is designated as the
116 **master clock** (right-click on an input to select it as such), and gets
117 to dictate the frame rate of the output. Inputs with differing frame rates
118 will get frames duplicated or dropped as needed (with adaptive queueing to
119 account for clock and jitter).
120
121 Nageru works in 16-bit floating-point RGBA internally. High-quality conversion to and
122 from subsampled Y'CbCr (typically 4:2:2 for inputs and 4:2:0 for outputs)
123 is done transparently on the GPU.