]> git.sesse.net Git - nageru/blob - README
Use the new libavformat functionality for marking keyframes.
[nageru] / README
1 Nageru is a live video mixer, based around the standard M/E workflow.
2
3
4 Features:
5
6  - High performance on modest hardware (720p60 with two input streams
7    on my Thinkpad X240[1]); almost all pixel processing is done on the GPU.
8
9  - High output quality; Lanczos3 scaling, subpixel precision everywhere,
10    white balance adjustment, mix of 16- and 32-bit floating point
11    for intermediate calculations, dithered output.
12
13  - Proper sound support: Syncing of multiple unrelated sources through
14    high-quality resampling, freely selectable input, cue out for headphones,
15    dynamic range compression, simple EQ (low-cut), level meters conforming
16    to EBU R128.
17
18  - Theme engine encapsulating the design demands of each individual
19    event; Lua code is responsible for setting up the pixel processing
20    pipelines, running transitions etc., so that the visual look is
21    consistent between operators.
22
23 [1] For reference, that is: Core i7 4600U (dualcore 2.10GHz, clocks down
24 to 800 MHz after 30 seconds due to thermal constraints), Intel HD Graphics
25 4400 (ie., without the extra L4 cache from Iris Pro), single-channel DDR3 RAM
26 (so 12.8 GB/sec theoretical memory bandwidth, shared between CPU and GPU).
27
28
29 Nageru is in beta stage. It currently needs:
30
31  - An Intel processor with Intel Quick Sync, or otherwise some hardware
32    H.264 encoder exposed through VA-API. Note that you can use VA-API over
33    DRM instead of X11, to use a non-Intel GPU for rendering but still use
34    Quick Sync (by giving e.g. “--va-display /dev/dri/renderD128”).
35
36  - Two or more Blackmagic USB3 or PCI cards, either HDMI or SDI.
37    The PCI cards need Blackmagic's own drivers installed. The USB3 cards
38    are driven through the “bmusb” driver embedded in bmusb/, using libusb-1.0.
39    You want a recent kernel and libusb-1.0; see below.
40
41  - Movit, my GPU-based video filter library (https://movit.sesse.net).
42    You will need at least version 1.3.1.
43
44  - Qt 5.5 or newer for the GUI.
45
46  - libmicrohttpd for the embedded web server.
47
48  - x264 for encoding high-quality video suitable for streaming to end users
49    (but see below).
50
51  - ffmpeg for muxing, and for encoding audio.
52
53  - Working OpenGL; Movit works with almost any modern OpenGL implementation.
54    Nageru has been tested with Intel on Mesa (you want 11.2 or newer, due
55    to critical stability bugfixes), and with NVIDIA's proprietary drivers.
56    AMD's proprietary drivers (fglrx) are known not to work due to driver bugs;
57    I am in contact with AMD to try to get this resolved.
58
59  - libzita-resampler, for resampling sound sources so that they are in sync
60    between sources, and also for oversampling for the peak meter.
61
62  - Lua, for driving the theme engine.
63
64
65 If on Debian stretch or something similar, you can install everything you need
66 with:
67
68   git submodule update --init
69   apt install qtbase5-dev qt5-default pkg-config libmicrohttpd-dev \
70     libusb-1.0-0-dev liblua5.2-dev libzita-resampler-dev libva-dev \
71     libavcodec-dev libavformat-dev libswscale-dev libavresample-dev \
72     libmovit-dev libegl1-mesa-dev libasound2-dev libx264-dev
73
74 Exceptions as of June 2016:
75
76   - You need libusb 1.0.21 or newer (not yet released; you will need to
77     use git) if you want zerocopy USB. Zerocopy USB helps not only for
78     performance, but also for stability.
79
80   - You want kernel 4.6.0 or newer to get zerocopy USB. Older kernels
81     also lack some workarounds for LPM (link power management) and bandwidth
82     allocation issues with USB3.
83
84   - There is a critical bug fix with x264 speed control in
85     928bd9d5def4f0ca5071ea176a11b816a01e6495, pushed to git mid-June 2016.
86
87   - Nageru depends on an avformat API for marking block boundaries in the
88     muxed byte stream that didn't enter ffmpeg before
89     4e7a9212820a56bc731c09b2f11ae1422d070837, pushed to git late June 2016.
90
91
92 The patches/ directory contains a patch that helps zita-resampler performance.
93 It is meant for upstream, but was not in at the time Nageru was released.
94 It is taken to be by Steinar H. Gunderson <sesse@google.com> (ie., my ex-work
95 email), and under the same license as zita-resampler itself.
96
97 To start it, just hook up your equipment, type “make” and then “./nageru”.
98 It is strongly recommended to have the rights to run at real-time priority;
99 it will make the USB3 threads do so, which will make them a lot more stable.
100 (A reasonable hack for testing is probably just to run it as root using sudo,
101 although you might not want to do that in production.) Note also that if you
102 are running a desktop compositor, it will steal significant amounts of GPU
103 performance. The same goes for PulseAudio.
104
105 Nageru will open a HTTP server at port 9095, where you can extract a live
106 H264+PCM signal in nut mux (e.g. http://127.0.0.1:9095/stream.nut).
107 It is probably too high bitrate (~25 Mbit/sec depending on content) to send to
108 users, but you can easily send it around in your internal network and then
109 transcode it in e.g. VLC. A copy of the stream (separately muxed) will also
110 be saved live to local disk.
111
112 If you have a fast CPU (typically a quadcore desktop; most laptops will spend
113 most of their CPU on running Nageru itself), you can use x264 for the outgoing
114 stream instead of Quick Sync; it is much better quality for the same bitrate,
115 and also has proper bitrate controls. Simple add --http-x264-video on the
116 command line. (You may also need to add something like "--x264-preset veryfast",
117 since the default "medium" preset might be too CPU-intensive, but YMMV.)
118 The stream saved to disk will still be the Quick Sync-encoded stream, as it is
119 typically higher bitrate and thus also higher quality. Note that if you add
120 ".metacube" at the end of the URL (e.g. "http://127.0.0.1:9095/stream.ts.metacube"),
121 you will get a stream suitable for streaming through the Cubemap video reflector
122 (cubemap.sesse.net). A typical example would be:
123
124   ./nageru --http-x264-video --x264-preset veryfast --x264-tune film \
125       --http-mux mp4 --http-audio-codec libfdk_aac --http-audio-bitrate 128
126
127 If you are comfortable with using all your remaining CPU power on the machine
128 for x264, try --x264-speedcontrol, which will try to adjust the preset
129 dynamically for maximum quality, at the expense of somewhat higher delay.
130
131 See --help for more information on options in general.
132
133 The name “Nageru” is a play on the Japanese verb 投げる (nageru), which means
134 to throw or cast. (I also later learned that it could mean to face defeat or
135 give up, but that's not the intended meaning.)
136
137
138 Nageru's home page is at https://nageru.sesse.net/, where you can also find
139 contact information and link to the latest version.
140
141
142 Legalese: TL;DR: Everything is GPLv3-or-newer compatible, and see
143 Intel's copyright license at h264encode.h.
144
145
146 Nageru is Copyright (C) 2015 Steinar H. Gunderson <steinar+nageru@gunderson.no>.
147 Portions Copyright (C) 2003 Rune Holm.
148 Portions Copyright (C) 2010-2015 Fons Adriaensen <fons@linuxaudio.org>.
149 Portions Copyright (C) 2012-2015 Fons Adriaensen <fons@linuxaudio.org>.
150 Portions Copyright (C) 2008-2015 Fons Adriaensen <fons@linuxaudio.org>.
151 Portions Copyright (c) 2007-2013 Intel Corporation. All Rights Reserved.
152
153
154 This program is free software: you can redistribute it and/or modify
155 it under the terms of the GNU General Public License as published by
156 the Free Software Foundation, either version 3 of the License, or
157 (at your option) any later version.
158
159 This program is distributed in the hope that it will be useful,
160 but WITHOUT ANY WARRANTY; without even the implied warranty of
161 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
162 GNU General Public License for more details.
163
164 You should have received a copy of the GNU General Public License
165 along with this program.  If not, see <http://www.gnu.org/licenses/>.
166
167
168 Portions of h264encode.h and h264encode.cpp:
169
170 Copyright (c) 2007-2013 Intel Corporation. All Rights Reserved.
171
172 Permission is hereby granted, free of charge, to any person obtaining a
173 copy of this software and associated documentation files (the
174 "Software"), to deal in the Software without restriction, including
175 without limitation the rights to use, copy, modify, merge, publish,
176 distribute, sub license, and/or sell copies of the Software, and to
177 permit persons to whom the Software is furnished to do so, subject to
178 the following conditions:
179
180 The above copyright notice and this permission notice (including the
181 next paragraph) shall be included in all copies or substantial portions
182 of the Software.
183
184 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
185 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
186 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
187 IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
188 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
189 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
190 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
191
192
193 All files in decklink/:
194
195 Copyright (c) 2009 Blackmagic Design
196 Copyright (c) 2015 Blackmagic Design
197
198 Permission is hereby granted, free of charge, to any person or organization
199 obtaining a copy of the software and accompanying documentation covered by
200 this license (the "Software") to use, reproduce, display, distribute,
201 execute, and transmit the Software, and to prepare derivative works of the
202 Software, and to permit third-parties to whom the Software is furnished to
203 do so, all subject to the following:
204
205 The copyright notices in the Software and this entire statement, including
206 the above license grant, this restriction and the following disclaimer,
207 must be included in all copies of the Software, in whole or in part, and
208 all derivative works of the Software, unless such copies or derivative
209 works are solely in the form of machine-executable object code generated by
210 a source language processor.
211
212 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
213 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
214 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
215 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
216 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
217 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
218 DEALINGS IN THE SOFTWARE.