Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ FFmpeg is an open source project licensed under LGPL and GPL. See https://www.ff
```bash
sudo apt-get install -y xserver-xorg-video-dummy ubuntu-desktop
```
- The stock `mtl_st20p` muxer only exposes `p_port`/`r_port` (2 physical NIC ports). To use more than 2 NICs with the default (non-`ENABLE_MTL_TX`) build, the plugin's `libavdevice/mtl_common.h` must be patched to add `p2_port`..`p7_port` (and matching `p2_sip`..`p7_sip`) AVOptions mapped to `devArgs.port[MTL_PORT_2..MTL_PORT_7]` / `devArgs.sip[...]`, then FFmpeg rebuilt and reinstalled. Without this patch, `nic_count` is effectively capped at 2 for the FFmpeg TX path (the `ENABLE_MTL_TX` direct-pipeline build already supports up to 8 NICs without any patch).

### Build Steps

Expand Down Expand Up @@ -143,7 +144,8 @@ dvledtx uses a JSON config file with three sections:
| Section | Field | Description |
|---------|-------|-------------|
| **log_file** | `log_file` | (Optional) Path/name of the log output file (e.g. `dvledtx.log`). If omitted, logging goes to console only. |
| **interfaces[]** | `name` | PCI BDF address of the NIC (e.g. `0000:06:00.0`) |
| **interfaces[]** | `nic_index` | (Optional) Must equal this entry's position in the `interfaces[]` array (0, 1, 2, ...); parsing fails if it doesn't match. Informational/self-documenting only — interfaces are always resolved by array position. |
| | `name` | PCI BDF address of the NIC (e.g. `0000:06:00.0`) |
| | `sip` | Source IP address |
| | `dip` | Destination multicast IP address |
| **video** | `width` | Source frame width in pixels |
Expand All @@ -165,8 +167,8 @@ dvledtx uses a JSON config file with three sections:
{
"log_file": "dvledtx.log",
"interfaces": [
{ "name": "0000:03:10.0", "sip": "192.168.50.30", "dip": "239.168.85.20" },
{ "name": "0000:03:10.2", "sip": "192.168.50.29", "dip": "239.168.85.21" }
{ "nic_index": 0, "name": "0000:03:10.0", "sip": "192.168.50.30", "dip": "239.168.85.20" },
{ "nic_index": 1, "name": "0000:03:10.2", "sip": "192.168.50.29", "dip": "239.168.85.21" }
],
"video": {
"width": 1920, "height": 1080,
Expand Down Expand Up @@ -348,6 +350,8 @@ pkill -f "gnome-session --session=ubuntu"
sudo pkill -f "Xorg :99"
```

`interfaces[]` supports up to 8 NICs (MTL's port limit); each `tx_sessions[]` entry picks its NIC via `nic_index` (see `config/tx_fullhd_multi_nic.json` for an 8-NIC/8-session example). Using more than 2 NICs with the default FFmpeg TX path requires the patched `mtl_st20p` muxer described above.
Comment thread
sunilnom marked this conversation as resolved.

## Logging

dvledtx includes a built-in logger with configurable output targets and log levels.
Expand Down
2 changes: 2 additions & 0 deletions config/tx_1session_12bit.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"interfaces": [
{
"nic_index": 0,
"name": "0000:06:00.0",
"sip": "192.168.50.29",
"dip": "239.168.85.20"
Expand All @@ -17,6 +18,7 @@
},
"tx_sessions": [
{
"nic_index": 0,
"udp_port": 20000,
"payload_type": 96,
"crop": { "x": 0, "y": 0, "w": 1920, "h": 1080 }
Expand Down
4 changes: 4 additions & 0 deletions config/tx_2k_multi_session.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"log_file": "dvledtx.log",
"interfaces": [
{
"nic_index": 0,
"name": "0000:03:00.1",
"sip": "192.168.50.29",
"dip": "239.168.85.20"
Expand All @@ -20,16 +21,19 @@
},
"tx_sessions": [
{
"nic_index": 0,
"udp_port": 20000,
"payload_type": 96,
"crop": { "x": 0, "y": 0, "w": 854, "h": 1440 }
},
{
"nic_index": 0,
"udp_port": 20002,
"payload_type": 96,
"crop": { "x": 854, "y": 0, "w": 854, "h": 1440 }
},
{
"nic_index": 0,
"udp_port": 20004,
"payload_type": 96,
"crop": { "x": 1708, "y": 0, "w": 852, "h": 1440 }
Expand Down
4 changes: 3 additions & 1 deletion config/tx_2k_single_session.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"log_file": "dvledtx.log",
"interfaces": [
{
"nic_index": 0,
"name": "0000:03:00.1",
"sip": "192.168.50.29",
"dip": "239.168.85.20"
Expand All @@ -20,7 +21,8 @@
},
"tx_sessions": [
{
"udp_port": 20000,
"nic_index": 0,
"udp_port": 20000,
"crop": { "x": 0, "y": 0, "w": 2560, "h": 1440 }
}
]
Expand Down
4 changes: 4 additions & 0 deletions config/tx_4k_multi_session.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"log_file": "dvledtx.log",
"interfaces": [
{
"nic_index": 0,
"name": "0000:03:00.1",
"sip": "192.168.50.29",
"dip": "239.168.85.20"
Expand All @@ -20,16 +21,19 @@
},
"tx_sessions": [
{
"nic_index": 0,
"udp_port": 20000,
"payload_type": 96,
"crop": { "x": 0, "y": 0, "w": 640, "h": 1080 }
},
{
"nic_index": 0,
"udp_port": 20002,
"payload_type": 96,
"crop": { "x": 640, "y": 0, "w": 640, "h": 1080 }
},
{
"nic_index": 0,
"udp_port": 20004,
"payload_type": 96,
"crop": { "x": 1280, "y": 0, "w": 640, "h": 1080 }
Expand Down
2 changes: 2 additions & 0 deletions config/tx_4k_single_session.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"log_file": "dvledtx.log",
"interfaces": [
{
"nic_index": 0,
"name": "0000:03:00.1",
"sip": "192.168.50.29",
"dip": "239.168.85.20"
Expand All @@ -20,6 +21,7 @@
},
"tx_sessions": [
{
"nic_index": 0,
"udp_port": 20000,
"payload_type": 96,
"crop": { "x": 0, "y": 0, "w": 900, "h": 600 }
Expand Down
93 changes: 71 additions & 22 deletions config/tx_fullhd_multi_nic.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,58 @@
"log_file": "dvledtx.log",
"interfaces": [
{
"name": "0000:03:10.0",
"sip": "192.168.50.30",
"dip": "239.168.85.20"
"nic_index": 0,
"name": "0000:01:10.1",
Comment thread
sunilnom marked this conversation as resolved.
"sip": "192.168.50.40",
"dip": "239.168.85.30"
},
{
"nic_index": 1,
"name": "0000:01:10.3",
"sip": "192.168.50.41",
"dip": "239.168.85.31"
},
{
"nic_index": 2,
"name": "0000:01:10.5",
"sip": "192.168.50.42",
"dip": "239.168.85.32"
},
{
"name": "0000:03:10.2",
"sip": "192.168.50.31",
"dip": "239.168.85.21"
"nic_index": 3,
"name": "0000:01:10.7",
"sip": "192.168.50.43",
"dip": "239.168.85.33"
},
{
"name": "0000:03:10.4",
"sip": "192.168.50.32",
"dip": "239.168.85.22"
"nic_index": 4,
"name": "0000:01:11.1",
"sip": "192.168.50.44",
"dip": "239.168.85.34"
},
{
"name": "0000:03:10.6",
"sip": "192.168.50.33",
"dip": "239.168.85.23"
"nic_index": 5,
"name": "0000:01:11.3",
"sip": "192.168.50.45",
"dip": "239.168.85.35"
},
{
"name": "0000:03:11.0",
"sip": "192.168.50.34",
"dip": "239.168.85.24"
"nic_index": 6,
"name": "0000:01:11.5",
"sip": "192.168.50.46",
"dip": "239.168.85.36"
},
{
"name": "0000:03:11.2",
"sip": "192.168.50.35",
"dip": "239.168.85.25"
"nic_index": 7,
"name": "0000:01:11.7",
"sip": "192.168.50.47",
"dip": "239.168.85.37"
}
],
"video": {
"width": 1920,
"height": 1080,
"tx_url": "ball_fullhd_yuv422p10_30fps_5min.mp4"
"tx_url": "bbb_sunflower_1080p_30fps_normal.mp4"
},
"tx_video": {
"scale_width": 1920,
Expand All @@ -48,20 +66,51 @@
"nic_index": 0,
"udp_port": 20000,
"payload_type": 96,
"crop": { "x": 0, "y": 0, "w": 640, "h": 1080 }
"crop": { "x": 0, "y": 0, "w": 240, "h": 1080 }
},
{
"nic_index": 1,
"udp_port": 20002,
"payload_type": 96,
"crop": { "x": 640, "y": 0, "w": 640, "h": 1080 }
"crop": { "x": 240, "y": 0, "w": 240, "h": 1080 }
},
{
"nic_index": 2,
"udp_port": 20004,
"payload_type": 96,
"crop": { "x": 1280, "y": 0, "w": 640, "h": 1080 }
"crop": { "x": 480, "y": 0, "w": 240, "h": 1080 }
},
{
"nic_index": 3,
"udp_port": 20006,
"payload_type": 96,
"crop": { "x": 720, "y": 0, "w": 240, "h": 1080 }
},
{
"nic_index": 4,
"udp_port": 20008,
"payload_type": 96,
"crop": { "x": 960, "y": 0, "w": 240, "h": 1080 }
},
{
"nic_index": 5,
"udp_port": 20010,
"payload_type": 96,
"crop": { "x": 1200, "y": 0, "w": 240, "h": 1080 }
},
{
"nic_index": 6,
"udp_port": 20012,
"payload_type": 96,
"crop": { "x": 1440, "y": 0, "w": 240, "h": 1080 }
},
{
"nic_index": 7,
"udp_port": 20014,
"payload_type": 96,
"crop": { "x": 1680, "y": 0, "w": 240, "h": 1080 }
}
]
}


4 changes: 4 additions & 0 deletions config/tx_fullhd_multi_session.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"log_file": "dvledtx.log",
"interfaces": [
{
"nic_index": 0,
"name": "0000:03:10.1",
"sip": "192.168.50.29",
"dip": "239.168.85.21"
Expand All @@ -20,16 +21,19 @@
},
"tx_sessions": [
{
"nic_index": 0,
"udp_port": 20000,
"payload_type": 96,
"crop": { "x": 0, "y": 0, "w": 640, "h": 1080 }
},
{
"nic_index": 0,
"udp_port": 20002,
"payload_type": 96,
"crop": { "x": 640, "y": 0, "w": 640, "h": 1080 }
},
{
"nic_index": 0,
"udp_port": 20004,
"payload_type": 96,
"crop": { "x": 1280, "y": 0, "w": 640, "h": 1080 }
Expand Down
2 changes: 2 additions & 0 deletions config/tx_fullhd_screen_capture.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"interfaces": [
{
"nic_index": 0,
"name": "0000:06:00.0",
"sip": "192.168.50.29",
"dip": "239.168.85.20"
Expand All @@ -18,6 +19,7 @@
},
"tx_sessions": [
{
"nic_index": 0,
"udp_port": 20000,
"payload_type": 96,
"crop": { "x": 0, "y": 0, "w": 1920, "h": 1080 }
Expand Down
4 changes: 4 additions & 0 deletions config/tx_fullhd_screen_capture_multi_session.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"interfaces": [
{
"nic_index": 0,
"name": "0000:06:00.0",
"sip": "192.168.50.29",
"dip": "239.168.85.20"
Expand All @@ -18,16 +19,19 @@
},
"tx_sessions": [
{
"nic_index": 0,
"udp_port": 20000,
"payload_type": 96,
"crop": { "x": 0, "y": 0, "w": 640, "h": 1080 }
},
{
"nic_index": 0,
"udp_port": 20002,
"payload_type": 96,
"crop": { "x": 640, "y": 0, "w": 640, "h": 1080 }
},
{
"nic_index": 0,
"udp_port": 20004,
"payload_type": 96,
"crop": { "x": 1280, "y": 0, "w": 640, "h": 1080 }
Expand Down
10 changes: 6 additions & 4 deletions config/tx_fullhd_single_session.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@
"log_file": "dvledtx.log",
"interfaces": [
{
"name": "0000:06:00.0",
"nic_index": 0,
"name": "0000:01:11.3",
"sip": "192.168.50.29",
"dip": "239.168.85.20"
}
],
"video": {
"width": 3840,
"height": 2160,
"tx_url": "ball_fullhd_yuv422p10_30fps_5min.mp4"
"tx_url": "bbb_sunflower_1080p_30fps_normal.mp4"
},
"tx_video": {
"scale_width": 3840,
"scale_height": 2160,
"scale_width": 1920,
"scale_height": 1080,
"fps": 30,
"fmt": "yuv422p10le"
},
"tx_sessions": [
{
"nic_index": 0,
"udp_port": 20000,
"payload_type": 96,
"crop": { "x": 0, "y": 0, "w": 1920, "h": 1080 }
Expand Down
8 changes: 8 additions & 0 deletions include/ffmpeg/ffmpeg_tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@
* Also pre-allocates enc_frame (crop-width scratch) and enc_pkt
* (contiguous packed frame buffer) whose size must equal MTL's frame_size.
*
* Multi-NIC: on the session that opens first (idx 0), also registers
* every other configured NIC (up to DVLEDTX_MAX_NICS = 8, MTL's port
* limit) with the mtl_st20p plugin's singleton MTL device via the
* p_port/r_port/p2_port..p7_port AVOptions, since mtl_init()/DPDK EAL is
* only ever invoked once per process. Requires a patched mtl_st20p muxer
* exposing p2_port..p7_port (see README's FFmpeg prerequisite section);
* without it, only 2 NICs (p_port/r_port) can be registered.
*
* close_ffmpeg_tx():
* Writes the AVFormat trailer (mtl_st20p: no-op), frees the AVFormatContext
* (this destroys the MTL TX session internally), and releases enc_frame/pkt.
Expand Down
Loading
Loading