Håvard Ose Nordstrand 2 роки тому
батько
коміт
56b0d401c3
5 змінених файлів з 180 додано та 15 видалено
  1. 1 0
      index.md
  2. 18 6
      media/audio-basics.md
  3. 98 1
      media/image-basics.md
  4. 27 8
      media/ndi.md
  5. 36 0
      media/obs.md

+ 1 - 0
index.md

@@ -82,6 +82,7 @@ _(Alphabetically sorted, so the ordering might seem a bit strange.)_
 - [Image Basics](/media/image-basics/)
 - [Lighting Basics](/media/lighting-basics/)
 - [Network Device Interface (NDI)](/media/ndi/)
+- [Open Broadcaster Software (OBS)](/media/obs/)
 - [Video4Linux 2 (V4L2)](/media/v4l2/)
 - [Video Basics](/media/video-basics/)
 - [Video Processing](/media/video-processing/)

+ 18 - 6
media/audio-basics.md

@@ -5,7 +5,7 @@ breadcrumbs:
 ---
 {% include header.md %}
 
-- Bands:
+- Bands (typical):
     - Lows (ca. 20Hz-100Hz)
     - Low midrange (ca. 100Hz-1kHz)
     - High midrange (ca. 1kHz-10kHz)
@@ -14,10 +14,11 @@ breadcrumbs:
     - (Note) This is the voltage (and somewhat impedance) inside cables/equipment.
     - Mic level: Output from a microphone. Very weak, requires a preamp.
     - Instrument level: Output from e.g. a guitar. Like mic level but slightly stronger.
-    - Line level (+4dBu): Professional equipment.
-    - Line level (-10dBV): Consumer equipment. Lower than +4dBu. Not to be confused with dB**v**.
+    - Line level (+4dBu): Professional equipment. E.g. for professional audio mixers.
+    - Line level (-10dBV): Consumer equipment. Lower than +4dBu. Not to be confused with dB**v**. E.g. for consumer-grade sound cards in PCs.
     - Speaker level: High-power signal going from an amplifier to a (passive) speaker.
     - Phono: Old, for turntables etc. Much lower voltage than line level. Typically needs a phono preamp/stage with RIAA equalization.
+    - (Note) DI boxes may be used to convert unbalanced non-+4dBu input signals to balanced +4dBu signals.
 - Balance mode:
     - Unbalanced: Ground and signal.
     - Balanced: Ground and hot and cold signal with equal impedance. The cold signal is 0V but not (directly) connected to ground.
@@ -35,8 +36,12 @@ breadcrumbs:
         - Group the ground cables together so no currents get induced into the cables.
         - Use a resistor and/or a ferrite bead to limit AC current.
 - Phantom power:
-    - Applies 48V to XLR3 (or similar) inputs, for powering mics and similar.
-    - Applying this to devices which aren't made for it can break them.
+    - Applies 48V to XLR3 microphone inputs, for powering mics, DI boxes and similar.
+    - 48V is most common, typically labeled as "+48V".
+    - For XLR3 1/4" combo input jacks, typically only the XLR3 part will be applied phantom power to when enabled for the input.
+    - Applying this to devices which aren't made for it can break them (e.g. laptops sound cards and certain old microphone types).
+    - To make sure an input line isn't providing phantom power which would damage equipment on the other end, use the instrument (1/4") input jack (if present, since phantom power is typically only provided on the XLR jack), or a DI box or similar (which would consume the phantom power).
+    - 48V phantom power was first used in Norway in 1966 by NRK, as a hack to supply stable-voltage power from emergency lighting systems to a new type of Neumann-microphones. This was later standardized as the default phantom power voltage.
 - Impedance:
     - Basically resistance but for AC.
 - Proximity effect:
@@ -64,6 +69,13 @@ breadcrumbs:
 - White and pink noise:
     - White noise has equal energy per frequency. The frequency-SPL curve is flat.
     - Pink noise has equal energy per octave. Since each octave has double the frequency of the previous (`log2(freq) = octave`), the frequency-SPL curve is decreasing. This makes pink noise appropriate for equalization for human hearing.
-- Pan law: **TODO**
+- Pan rule (or pan law):
+    - Determines how much louder either side of a stereo channel should get when panned all the way to that side, so that the perceived loudness stays the same.
+    - For an ideal loudspeaker system and ideal room acoustics, the loudness increase from playing an identical signal in both stereo channels should be around 6.02dB SPL, although in reality it's typically closer to 3dB.
+    - Most mixers use a pan rule of 3dB, to account for most realistic situations.
+- Devices:
+    - DI boxes (direct input): Used to convert some unbalanced non-+4dBu input signal (e.g. microphone level, instrument level, consumer-grade line level, or speaker level) to a balanced +4dBu signal. Typically phantom powered, sometimes battery powered. Passive versions also exist, consisting mainly of a transformer to scale the output voltage.
+    - Ground lifts: Used to break ground loops (giving a distinct humming sound), by "lifting" (breaking) the ground in the cable/path and thus breaking the electrical ground loop. Often built into other devices like DI boxes. Often required when the devices are powered from different electrical outlets or similar which could create ground differentials. Should only be used when both sides are actually grounded to avoid risk of electric shock!
+    - Hum destroyers: Typically passive 1:1 transformers with isolated grounds. Basically fancy ground lifts, using transformers in addition to isolating/breaking the ground.
 
 {% include footer.md %}

+ 98 - 1
media/image-basics.md

@@ -5,6 +5,103 @@ breadcrumbs:
 ---
 {% include header.md %}
 
-**TODO**
+- Color models:
+    - Color models are generally applied per pixel and per frame if video.
+- List of color models:
+    - RGB:
+        - Contains red (R), green (G), and blue (B) components. Often as RGB, sometimes as BGR.
+        - It uses additive primary colors, giving white when all three components are max and black when all three components are min.
+        - Used mainly for displays and image formats.
+        - Often uses a color depth of 8 bits per component (24 bits total, aka RGB24 or RGB888), although other depths are also used.
+        - Often considered a "raw" model since e.g. LED and CRT displays use physical red, green and blue components/signals.
+        - If gamma correction needs to be emphasised, it may be written as R'G'B' (with primes).
+    - RGBA:
+        - Like RGB, but includes an alpha/opacity (A) component. Often as RGBA, sometimes as ARGB or ABGR.
+        - Often using 8 bits per component (32 bits total, aka RGBA32 or RGBA8888).
+        - Alternatively as ARGB, with the alpha component first.
+    - CMY:
+        - Contains cyan (C), magenta (M), and yellow (Y) components.
+        - It uses subtractive primary colors, giving black when all three components are max and white when all three components are min.
+        - Used e.g. in printers and light fixture color wheels.
+    - CMYK:
+        - Like CMY, but contains a key/black (K) component.
+        - Since CMY is in practice not very effective for mixing greyscale and deep black (e.g. in printers), the black component is added.
+    - HSL & HSV:
+        - Contains hue (H), saturation (S) and either lightness (L) or value/brightness (V).
+        - Alternative representations to RGB, where the color is represented as a point within a cylinder with hue as the angle, saturation as the radius and lightness/value as the height. Often represented as a 2D slice for a given lightness/value, as a 2D rectangle for a given saturation, or as a 2D rectangle for a given hue.
+        - Difference between HSL (w/ lightness L) and HSV (w/ value/brightness V):
+            - Both L at 0 and V at 0 gives black.
+            - L at 1 gives white.
+            - V at 1 gives the equivalent of L at 0.5 (i.e. the most saturated color for a given saturation value).
+        - A saturation of 0 gives greyscale only, while a saturation of -1 gives the complement color for the specific hue.
+        - The hue is continuous and sometimes represented using degrees.
+        - The concept of "saturation" in these models is a bit confusing.
+    - Y'CbCr (and Y'PbPr):
+        - Alternatively written as YCbCr or Y'C<sub>r</sub>C<sub>b</sub>. Often confused with Y'UV.
+        - Contains luma/luminance (Y'/Y), blue-difference (Cb) and red-difference (Cr).
+        - "Y'" (Y prime) is the luma component, i.e. the gamma compressed luminance "Y".
+        - The blue- and red-difference is simply blue/red minus luminance (or luma?).
+        - While RGB is more appropriate for low-level color (e.g. within displays), Y'CbCr allows for more flexibility wrt. transmission efficiency, e.g. for reducing color depth while keeping luma depth.
+        - Y'CbCr is designed for digital video, using only a single digital link for electrical transmission (e.g. SDI). YPbPr is the analog counterpart of Y'CbCr, using separate analog cabling for electrical transmission (e.g. component video) (unlike composite video which multiplexes the analog signals).
+        - Chroma subsampling is commonly used to reduce chroma resolution (see the section about the J:a:b notation). Y'CbCr 4:4:4 uses no chroma subsampling but is less commonly used. Y'CbCr 4:2:2 uses 1/4 the number of "color pixels", without significant perceived quality reduction.
+    - Y'UV:
+        - Alternatively written YUV. Often confused with Y'CbCr and Y'PbPr.
+        - Previously used for analog encoding, although now it mainly refers to a the color format.
+        - Contains luma/luminance (Y'/Y), blue-luminance (U) and red-luminance (V) (for arbitrary variable names U and V).
+        - While not directly compatible with Y'CbCr, the Y-Y, U-Cb and V-Cr pairs are pairwise linearly related.
+- Color spaces:
+    - Used to reproducably represent colors from a color model by mapping color model values to/from absolute color space.
+    - While devices are often labeled for a certain color space, they're often not actually calibrated for it. E.g. for displays, special calibration devices are typically required (if accurate color representation is actually required).
+    - Generally includes a transfer function (gamma or non-gamma).
+- List of color spaces:
+    - sRGB (for RGB):
+        - The default standard (s) for RGB-derived color models.
+        - Created by HP and Microsoft in 1996 and standardized by the IEC.
+        - Uses 8-bit color components (RGB24/RGBA32), giving a somewhat limited gamut.
+        - Uses a ~2.2 gamma function (not exactly a power function).
+    - Adobe RGB (for RGB):
+        - Similar to sRGB, but uses a wider gamut appropriate for high-end printing (utilising the full CMYK space).
+        - Created by Adobe in 1998.
+    - Rec. 601 (for Y'CbCr video):
+        - For 525-line 60Hz and 625-line 50Hz video, with Y'CbCr 4:2:2 color encoding, standardized by the ITU.
+    - Rec. 709 (aka HDTV video) (for RGB):
+        - For FHD, standardized by the ITU.
+        - Very similar to sRGB, being created shortly before it.
+    - Rec. 2020 (aka UHDTV video) (for RGB):
+        - For 8K UHD, standardized by the ITU.
+    - Rec. 2100 (aka HDR-TV video) (for RGB):
+        - Extension of Rec. 2020 with HDR support.
+        - Supports 10-bit and 12-bit RGB.
+    - sYCC (for Y'CbCr):
+        - Defined in amendments to the sRGB standard.
+- Color range:
+    - The numerical range actually used for each color component.
+    - Typically "partial"/"limited" or "full". While full gives a bigger range and might be better internally, it uses more bandwidth during transmission.
+    - If this doesn't match, e.g. the black will look too dark or too bright.
+- Color gamut:
+    - The cimplete subset of colors that can be represented using a given color space (e.g. sRGB) or a certain input/output device (e.g. an LCD display, being limited by the backlight color spectrum).
+- Gamma (aka gamma correction/encoding/decoding or transfer function):
+    - A power function for changing the mapping 1:1 from a 0–1 input level to a 0–1 output level.
+    - Resources:
+        - [[W3C] PNG (Portable Network Graphics) Specification: Gamma Tutorial (Appendix)](https://www.w3.org/TR/PNG-GammaAppendix.html)
+    - Serves two purposes:
+        - For correcting gamma characteristics of cameras or displays.
+        - For "smoothing" the perceived brightness over an integer range to reduce the number of required bits to represent a certain perceived bit depth of an image, since human perception also follows a power function for brightness perception.
+    - Basic function: $V_{out} = AV_{in}^{\gamma}$, where $V_{in}$ is mapped to $V_{out}$ using gamma exponent $\gamma$ and constant coefficient $A$.
+    - Gamma correction is typically chained (e.g. one gamma for the camera, one for the file format and one for the display), meaning the gamma exponents may simply be multiplied together for the full chain to get the resulting gamma value.
+    - The desired resulting gamma is around 1.0–1.5, with higher gammas for dim viewing environments (gives a darker and "shady" image) and lower gammas for bright viewing environments (gives a brighter and "washed" image).
+    - The gamma for file formats are typically encoded either in the format itself (e.g. for PNG) or in Exif metadata (e.g. for JPEG). For cameras and displays, it's often specified and sometimes configurable.
+    - Only required for integer representations, floating-point representations already handles the problem (although wastes more bits by being more general).
+    - Some typical gamma values:
+        - CRT displays: 2.5
+        - NTSC cameras: 0.45 (to correct for CRT displays)
+        - PAL and SECAM cameras: 0.36 (although this is rather low and cameras are typically set higher)
+        - SMPTE-170M cameras (newer standard): ~0.5 (although not actually a power function)
+- Chroma subsampling:
+    - Using a lower resolution (not depth!) for chroma information than for luma information.
+    - Useful since humans are more sensitive to luma variations than chroma variations.
+    - Used e.g. with JPEG encoding.
+    - It uses notation J:a:b. Long story short, 4:4:4 means full chroma resolution, 4:2:2 means halved horizontal resolution but full vertical resulution, and 4:2:0 means halved horizontal and vertical resolution.
+    - E.g. Y'CbCr 4:2:2, using 1/3 less bandwidth than Y'CbCr 4:4:4, with almost no visual difference.
 
 {% include footer.md %}

+ 27 - 8
media/ndi.md

@@ -37,13 +37,32 @@ A network video protocol by NewTek.
 - While NDI supports using multiple NICs and may automatically distribute streams to different NICs, NIC teaming/aggregation is often preferred if possible.
 - The network should be optimized for multicast traffic with IGMP if multicast sending is enabled.
 - Maximum throughputs for streams:
-    - NDI 1920x1080 60P: 132Mb/s
-    - NDI 1920x1080 60P (with alpha): 165Mb/s
-    - NDI 3840*2160 60P: 249Mb/s
-    - NDI 3840*2160 60P (with alpha): 312Mb/s
-    - NDI|HX 1920x1080 60P: 15.9Mb/s
-    - NDI|HX 1920x1080 60P (with alpha): 10.9Mb/s
-    - NDI|HX 3840*2160 60P: 30.0Mb/s
-    - NDI|HX 3840*2160 60P (with alpha): 21.0Mb/s
+    - NDI 1920x1080 60Hz: 132Mb/s
+    - NDI 1920x1080 60Hz (with alpha): 165Mb/s
+    - NDI 3840x2160 60Hz: 249Mb/s
+    - NDI 3840x2160 60Hz (with alpha): 312Mb/s
+    - NDI|HX 1920x1080 60Hz: 15.9Mb/s
+    - NDI|HX 1920x1080 60Hz (H.264 & HEVC): 10.9Mb/s
+    - NDI|HX 3840x2160 60Hz: 30.0Mb/s
+    - NDI|HX 3840x2160 60Hz (H.264 & HEVC): 21.0Mb/s
+
+## Usage
+
+### NDI Tools
+
+- Contains tools for e.g. sending streams, receiving streams, sending test streams, routing streams, bridging streams etc.
+- Contains plugins/extensions to VLC, Premiere Pro and After Effects.
+- For Windows and Mac only.
+- [Download](https://ndi.tv/tools/)
+
+### NDI SDK
+
+- The NDI SDK is used to develop native NDI applications.
+- For targeting Apple, Android, Linux/ARM, Windows etc.
+- [Download](https://ndi.tv/sdk/)
+
+### OBS NDI Plugin
+
+See [OBS](../obs/).
 
 {% include footer.md %}

+ 36 - 0
media/obs.md

@@ -0,0 +1,36 @@
+---
+title: Open Broadcaster Software (OBS)
+breadcrumbs:
+- title: Media
+---
+{% include header.md %}
+
+## Info
+
+- Color format:
+    - NV12 means Y'UV/Y'CbCr 4:2:0 chroma subsampling (chroma resolution halved in both dimensions), which is what OBS always uses for streaming output (see [issue #3517](https://github.com/obsproject/obs-studio/issues/3517)).
+    - RGB provides the most detailed colors, but with overhead. It's pointless to use for streaming.
+    - GPU offloading might support only some formats (I _think_ it supports NV12 but not e.g. RGB).
+- Color space:
+    - Use BT.709, it's newer than BT.601.
+- Color range:
+    - "Full" is a little better, but mostly pointless for streaming. Use "partial".
+- Make sure to set the color format, color space and color range both in the OBS advanced settings and for sources, and try to keep them consistent.
+
+## Plugins
+
+### OBS NDI Plugin
+
+- Setup (Windows):
+    1. Download the `obs-ndi-*-Windows.zip` archive: [Download](https://github.com/Palakis/obs-ndi/releases)
+    1. Copy the files into the OBS installation directory (merge with existing directories).
+    1. Start OBS.
+    1. If you haven't installed NDI or NDI Tools, a warning should appear with a download link. Install it and restart OBS.
+    1. Make sure NDI sources are available from the "new source" list.
+- Info:
+    - It uses "raw" NDI, not NDI|HX (compressed), meaning a 1920x1080 60Hz stream could use up to 132Mb/s (throughput from an NDI whitepaper).
+- Issues (the ones I've faced):
+    - Growing latency over time (1s delay after ~30m): https://github.com/Palakis/obs-ndi/issues/667
+        - Maybe low latency mode (async OBS output) fixes this? Might introduce stutter tho.
+
+{% include footer.md %}