Skip to content

Commit

Permalink
Add RDMA support to ffmpeg plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Kasiewicz, Marek <marek.kasiewicz@intel.com>
  • Loading branch information
Sakoram committed Nov 25, 2024
1 parent 50b1e12 commit 9c9458e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
23 changes: 15 additions & 8 deletions ffmpeg-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ Install dependencies and build MCM as described in the top level README.md, para

The next arguments are supported to configure a connection to MCM

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

## Video configuration

Expand Down Expand Up @@ -99,6 +99,13 @@ TBD
-port 9001 -
```

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:

```bash
ffmpeg -f rawvideo -pix_fmt yuv422p10le -s 1920x1080 -i <video-file-path> ...
```


### VLC player setup

On the remote machine start the VLC player and open a network stream from the next URL:
Expand Down
15 changes: 15 additions & 0 deletions ffmpeg-plugin/mcm_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ int mcm_parse_conn_param(AVFormatContext* avctx, MeshConnection *conn,
err = mesh_apply_connection_config_memif(conn, &cfg);
if (err)
return err;
} else if (!strcmp(payload_type, "rdma")) {
MeshConfig_RDMA cfg;

if (kind == MESH_CONN_KIND_SENDER) {
cfg.remote_port = atoi(port);
strlcpy(cfg.remote_ip_addr, ip_addr, sizeof(cfg.remote_ip_addr));
} else {
cfg.local_port = atoi(port);
strlcpy(cfg.local_ip_addr, ip_addr, sizeof(cfg.local_ip_addr));
}

err = mesh_apply_connection_config_rdma(conn, &cfg);
if (err)
return err;

} else {
MeshConfig_ST2110 cfg;

Expand Down
5 changes: 4 additions & 1 deletion sdk/src/mcm_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,13 @@ mcm_conn_context* mcm_create_connection(mcm_conn_param* param)
switch (param->protocol) {
case PROTO_AUTO:
/**
* This is a temporary workaround to calculate the RDMA transfer size
* TODO: This is a temporary workaround to calculate the RDMA transfer size
* from video payload parameters provided by the user. It will be
* removed after the Control Plane implementation supporting Multipoint
* Groups is implemented in Media Proxy.
*
* In the new implementation the transfer size of audio payload should be calculated too,
* PAYLOAD_TYPE_RDMA_VIDEO should be renamed to PAYLOAD_TYPE_RDMA, as it will support both.
*/
if (param->payload_type == PAYLOAD_TYPE_RDMA_VIDEO) {
size_t sz = (size_t)param->payload_args.video_args.width *
Expand Down

0 comments on commit 9c9458e

Please sign in to comment.