Skip to content

Commit 9c9458e

Browse files
committed
Add RDMA support to ffmpeg plugin
Signed-off-by: Kasiewicz, Marek <[email protected]>
1 parent 50b1e12 commit 9c9458e

File tree

3 files changed

+34
-9
lines changed

3 files changed

+34
-9
lines changed

ffmpeg-plugin/README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ Install dependencies and build MCM as described in the top level README.md, para
3333

3434
The next arguments are supported to configure a connection to MCM
3535

36-
| Argument | Type | Description | Default |
37-
| --------------- | :-----: | -------------------------------------------------------- | :--------------: |
38-
| `ip_addr` | String | Remote IP address | `"192.168.96.1"` |
39-
| `port` | String | Remote port (Sender), or Local port (Receiver) | `"9001"` |
40-
| `protocol_type` | String | MCM Protocol type (`"auto"`, `"memif"`, etc.) | `"auto"` |
41-
| `payload_type` | String | ST2110 payload type (`"st20"`, `"st22"`, `"st30"`, etc.) | `"st20"` |
42-
| `socket_name` | String | Memif socket name | - |
43-
| `interface_id` | Integer | Memif interface id | `0` |
36+
| Argument | Type | Description | Default |
37+
| --------------- | :-----: | --------------------------------------------------------- | :--------------: |
38+
| `ip_addr` | String | Remote IP address | `"192.168.96.1"` |
39+
| `port` | String | Remote port (Sender), or Local port (Receiver) | `"9001"` |
40+
| `protocol_type` | String | MCM Protocol type (`"auto"`, `"memif"`, etc.) | `"auto"` |
41+
| `payload_type` | String | Payload type (`"st20"`, `"st22"`, `"st30", "rdma"`, etc.) | `"st20"` |
42+
| `socket_name` | String | Memif socket name | - |
43+
| `interface_id` | Integer | Memif interface id | `0` |
4444

4545
## Video configuration
4646

@@ -99,6 +99,13 @@ TBD
9999
-port 9001 -
100100
```
101101

102+
When working with raw video files that lack metadata, you must explicitly provide FFmpeg with the necessary video frame details. This includes specifying the format `-f rawvideo`, pixel format `-pix_fmt`, and resolution `-s WxH`. For example:
103+
104+
```bash
105+
ffmpeg -f rawvideo -pix_fmt yuv422p10le -s 1920x1080 -i <video-file-path> ...
106+
```
107+
108+
102109
### VLC player setup
103110

104111
On the remote machine start the VLC player and open a network stream from the next URL:

ffmpeg-plugin/mcm_common.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,21 @@ int mcm_parse_conn_param(AVFormatContext* avctx, MeshConnection *conn,
9292
err = mesh_apply_connection_config_memif(conn, &cfg);
9393
if (err)
9494
return err;
95+
} else if (!strcmp(payload_type, "rdma")) {
96+
MeshConfig_RDMA cfg;
97+
98+
if (kind == MESH_CONN_KIND_SENDER) {
99+
cfg.remote_port = atoi(port);
100+
strlcpy(cfg.remote_ip_addr, ip_addr, sizeof(cfg.remote_ip_addr));
101+
} else {
102+
cfg.local_port = atoi(port);
103+
strlcpy(cfg.local_ip_addr, ip_addr, sizeof(cfg.local_ip_addr));
104+
}
105+
106+
err = mesh_apply_connection_config_rdma(conn, &cfg);
107+
if (err)
108+
return err;
109+
95110
} else {
96111
MeshConfig_ST2110 cfg;
97112

sdk/src/mcm_dp.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,13 @@ mcm_conn_context* mcm_create_connection(mcm_conn_param* param)
233233
switch (param->protocol) {
234234
case PROTO_AUTO:
235235
/**
236-
* This is a temporary workaround to calculate the RDMA transfer size
236+
* TODO: This is a temporary workaround to calculate the RDMA transfer size
237237
* from video payload parameters provided by the user. It will be
238238
* removed after the Control Plane implementation supporting Multipoint
239239
* Groups is implemented in Media Proxy.
240+
*
241+
* In the new implementation the transfer size of audio payload should be calculated too,
242+
* PAYLOAD_TYPE_RDMA_VIDEO should be renamed to PAYLOAD_TYPE_RDMA, as it will support both.
240243
*/
241244
if (param->payload_type == PAYLOAD_TYPE_RDMA_VIDEO) {
242245
size_t sz = (size_t)param->payload_args.video_args.width *

0 commit comments

Comments
 (0)