Prechádzať zdrojové kódy

Update streaming notes

HON95 2 rokov pred
rodič
commit
1999bfe090
5 zmenil súbory, kde vykonal 93 pridanie a 18 odobranie
  1. 4 0
      general/linux-general.md
  2. 1 0
      index.md
  3. 19 5
      media/ffmpeg.md
  4. 49 0
      media/ndi.md
  5. 20 13
      media/vlc.md

+ 4 - 0
general/linux-general.md

@@ -400,6 +400,10 @@ Using GPG (from package `gnupg2` on Debian).
 - Monitor interrupts:
     - `irqtop`
     - `watch -n0.1 /proc/interrupts`
+- Monitor USB traffic:
+    - Install usbmon (Arch): `yay -S usbtop`
+    - Load module: `modprobe usbmon`
+    - View live traffic: `sudo usbtop`
 - Run command with high or low CPU priority:
     - Command: `nice -n<n> <cmd>` (`-20 <= n <= 19`)
     - The nice value goes from -20 (highest priority) to 19 (lowest priority), with 0 as the default priority.

+ 1 - 0
index.md

@@ -79,6 +79,7 @@ _(Alphabetically sorted, so the ordering might seem a bit strange.)_
 - [DMX512](/media/dmx512/)
 - [FFmpeg](/media/ffmpeg/)
 - [Media: General](/media/general/)
+- [Network Device Interface (NDI)](/media/ndi/)
 - [Video4Linux 2 (V4L2)](/media/v4l2/)
 - [Video Processing](/media/video-processing/)
 - [Video Ripping](/media/video-ripping/)

+ 19 - 5
media/ffmpeg.md

@@ -24,12 +24,26 @@ breadcrumbs:
 - Linux (Arch): `sudo pacman -S ffmpeg v4l-utils`
 - Windows: Download binaries from some FFmpeg mirror site.
 
-## View fTODO
+## General Usage
 
-- View video feed: `ffplay <dev>`
-    - For some reason this typically uses a limited framerate and resolution.
+### Devices
 
-## Examples
+#### Linux
+
+- See the the [Video4Linux 2 (V4L2) page](../v4l2/) for more info about managing devices.
+- List devices: `v4l2-ctl --list-devices`
+    - Cameras often provide multiple `/dev/video<n>` for the same device, only one of them provides the correct video feed.
+- Show current device info: `v4l2-ctl -<n> --all` (for `/dev/video<n>`)
+    - E.g. the pixel format and resolution is what is currently configured for the device.
+
+#### Windows
+
+- View devices: `ffmpeg -list_devices true -f dshow -i dummy`
+
+### View
+
+- View video feed: `ffplay <dev-or-url>`
+    - For some reason this often uses a limited framerate and resolution or high delay for me.
 
 ### Recording
 
@@ -38,7 +52,7 @@ breadcrumbs:
 - Record time lapse at 10x speed without audio:
     - Command: `ffmpeg -i http://localhost:5555/ -filter:v "setpts=0.1*PTS" -an out.mkv`
 
-## Tasks
+## Specific Usage
 
 ### Concatenate Video Files
 

+ 49 - 0
media/ndi.md

@@ -0,0 +1,49 @@
+---
+title: Network Device Interface (NDI)
+breadcrumbs:
+- title: Media
+---
+{% include header.md %}
+
+A network video protocol by NewTek.
+
+## Info
+
+- A royalty-free protocol by NewTek for sharing video over IP in a standard Gigabit LAN (or better).
+- Provides multiple high-quality, low-latency and frame-accurate video and audio feeds.
+- Uses mDNS by default for autodiscovery. Alternatively, one or more discovery servers may be used.
+- Supports multicast sending, but it's disabled by default.
+
+### Encoding
+
+- The normal, high-bandwidth encoder is simply called "NDI".
+- NDI provides multi-generational stability, meaning repeated encodings don't degrade quality.
+- Has a technical latency of 16 video scan lines, although typically lower in implementations.
+- "NDI|HX", meaning "NDI High Efficiency", uses much lower bitrate and is appropriate when bandwidth is limited.
+
+### Transport Protocols
+
+- Reliable UDP: Supports very high-latency networks. Has built-in  congestion control and loss recovery and no head-of-line blocking.
+- Multipath TCP: Uses multiple NICS and multiple network paths.
+- Single TCP: Nothing special.
+- UDP with FEC: For when reliable delivery is not required. Has forward error correction (FEC).
+
+### Recommendations
+
+- The network must be high-bandwidth, low-latency, jitter-free and highly available.
+- The network should be mostly dedicated to NDI streams.
+- The network topology should be designed with requirements in mind.
+- Gigabit, consumer off-the-shelf (COTS) equipment is generally good enough.
+- 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
+
+{% include footer.md %}

+ 20 - 13
media/vlc.md

@@ -12,6 +12,10 @@ breadcrumbs:
 - [Command line streaming examples (VideoLAN)](https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/)
 - [Streaming over IPv6 (VideoLAN)](https://wiki.videolan.org/Documentation:Streaming_HowTo/Streaming_over_IPv6/)
 
+## Installation
+
+- Arch: `sudo pacman -S vlc zvbi`
+
 ## General
 
 - Hide GUI:
@@ -55,11 +59,13 @@ breadcrumbs:
     - Duplicate the feed, e.g. to send it to different destinations.
 - Display (`display`):
     - Show the input stream locally. Can be used to verify that the input or previous parts chain is working as expected. Can be used with `duplicate` to monitor the stream.
-- RTP/RTSP (`rtp`):
-    - Stream as RTP, optionally with RTSP.
-    - Basic example: `rtp{mux=ts,dst=<addr>,port=<port>}`
-    - `dst` must be some destination unicast or multicast address. `port` may be omitted to use the default.
-    - Uses UDP by default.
+- RTP (`rtp`):
+    - Stream as raw RTP to a destination unicast or multicast address.
+    - Example: `rtp{mux=ts,dst=<addr>,port=<port>}`
+    - `dst` must be some destination unicast or multicast address. `port` may be omitted to use the default (typically UDP).
+- RTSP (also `rtp`):
+    - Run a RTSP server, allowing clients to stream over RTP.
+    - Example: `rtp{name=yolo,mux=ts,proto=udp,sdp=rtsp://127.0.0.1:5000/}`
 
 ## Video and Sub Filter Modules
 
@@ -102,15 +108,16 @@ breadcrumbs:
 
 ### Streaming
 
-- Stream webcam with RTP (no RTSP) (Linux):
-    - Command: `cvlc v4l2:///dev/video0:width=1920:height=1080:fps=30:chroma=mjpg --live-caching=10 --sout='#transcode{vcodec=mp4v,acodec=none}:rtp{mux=ts,dst=localhost}'`
-    - `dst` is the destination unicast or multicast address to continuously stream to.
-- Stream webcam with HTTP (Linux):
-    - Command: `cvlc v4l2:///dev/video0:width=1920:height=1080:fps=30:chroma=mjpg --live-caching=10 --sout='#transcode{vcodec=mp4v,acodec=none}:standard{access=http,mux=ts}' --http-host=localhost --http-port=5555`
+- Stream webcam to RTP (raw stream to target, no RTSP) (no sound) (Linux):
+    - Command: `cvlc v4l2:///dev/video0:width=1920:height=1080:fps=30:chroma=mjpg --live-caching=10 --sout='#transcode{vcodec=mp4v,acodec=none}:rtp{mux=ts,dst=127.0.0.1}'`
+- Stream webcam to RTSP (no sound) (Linux):
+    - Command: `cvlc v4l2:///dev/video2:width=1920:height=1080:fps=30:chroma=mjpg --live-caching=10 --sout='#transcode{vcodec=mp4v,acodec=none}:rtp{name=yolo,mux=ts,proto=tcp,sdp=rtsp://127.0.0.1:5000/}''`
+- Stream webcam to HTTP (no sound) (Linux):
+    - Command: `cvlc v4l2:///dev/video0:width=1920:height=1080:fps=30:chroma=mjpg --live-caching=10 --sout='#transcode{vcodec=mp4v,acodec=none}:standard{access=http,mux=ts}' --http-host=127.0.0.1 --http-port=5555`
     - HTTP streams may be easily used as sources in e.g. OBS.
-- Stream capture card to display and HTTP stream (Windows):
-    - Command: `./vlc -I dummy --dummy-quiet dshow:// --dshow-vdev="Game Capture HD60 S (Video) (#01)" --dshow-adev=none  --dshow-size=1920x1080 --dshow-aspect-ratio=16:9 --dshow-fps=60  --live-caching=10 --sout='#transcode{vcodec=mp2v,acodec=none,sfilter=logo}:duplicate{dst=display,dst=standard{access=http,mux=ts}}' --http-host=localhost --http-port=5555`
-- Record network stream to file (Linux):
+- Stream capture card to display and HTTP stream (no sound) (Windows):
+    - Command: `./vlc -I dummy --dummy-quiet dshow:// --dshow-vdev="Game Capture HD60 S (Video) (#01)" --dshow-adev=none  --dshow-size=1920x1080 --dshow-aspect-ratio=16:9 --dshow-fps=60 --live-caching=10 --sout='#transcode{vcodec=mp2v,acodec=none,sfilter=logo}:duplicate{dst=display,dst=standard{access=http,mux=ts}}' --http-host=127.0.0.1 --http-port=5555`
+- Record network stream to file (no sound) (Linux):
     - Command: `cvlc <input> --sout='#transcode{vcodec=mp4v,acodec=none}:std{access=file,mux=ps,dst=test.mpg}'`
 
 {% include footer.md %}