FFmpeg plugin for Media Communications Mesh#
Build#
Prerequisites#
Install dependencies and build Media Communications Mesh as described in the top level README.md, paragraph “Basic Installation”.
Build flow#
Clone the FFmpeg repository (Release 7.0 by default) and apply patches
./clone-and-patch-ffmpeg.sh
Note: For FFmpeg Release 6.1, replace 7.0
with 6.1
in the above cloning script
Run the FFmpeg configuration tool
./configure-ffmpeg.sh
Build and install FFmpeg with the Media Communications Mesh FFmpeg plugin
./build-ffmpeg.sh
Connection configuration#
The next arguments are supported to configure a connection to Media Communications Mesh
Argument |
Type |
Description |
Default |
---|---|---|---|
|
String |
Connection type ( |
|
|
String |
Multipoint group URN |
|
|
String |
SMPTE ST2110 remote IP address |
|
|
String |
SMPTE ST2110 remote port (Transmitter), or local port (Receiver) |
|
|
String |
SMPTE ST2110 transport type ( |
|
|
String |
Memif socket name |
- |
|
Integer |
Memif interface id |
|
Video configuration#
The next arguments are supported to configure a video transmission
Argument |
Type |
Description |
Default |
---|---|---|---|
|
String |
Video frame size ( |
|
|
String |
Video pixel format |
|
|
String |
Video frame rate ( |
|
Example – Run video transmission#
This example demonstrates sending a video file from the 1st FFmpeg instance to the 2nd FFmpeg instance via Media Communications Mesh, then streaming it to a remote machine via UDP.
NIC setup#
TBD
Receiver side setup#
Start Media Proxy
sudo media_proxy -d 0000:32:01.1 -i 192.168.96.11 -r 192.168.97.11 -p 9200-9299 -t 8002
Start FFmpeg to receive frames from Media Communications Mesh and stream to a remote machine via UDP
sudo MCM_MEDIA_PROXY_PORT=8002 ffmpeg -re -f mcm \ -conn_type st2110 \ -transport st2110-20 \ -ip_addr 192.168.96.10 \ -port 9001 \ -frame_rate 24 \ -video_size nhd \ -pixel_format yuv422p10le \ -i - -vcodec mpeg4 -f mpegts udp://<remote-ip>:<remote-port>
Sender side setup#
Start Media Proxy
sudo media_proxy -d 0000:32:01.0 -i 192.168.96.10 -r 192.168.97.10 -p 9100-9199 -t 8001
Start FFmpeg to stream a video file to the receiver via Media Communications Mesh
sudo MCM_MEDIA_PROXY_PORT=8001 ffmpeg -i <video-file-path> -f mcm \ -conn_type st2110 \ -transport st2110-20 \ -ip_addr 192.168.96.11 \ -port 9001 \ -frame_rate 24 \ -video_size nhd \ -pixel_format yuv422p10le -
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: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:
udp://@:1234
Audio configuration#
The table below shows a proper way to configure the sender and the receiver depending on the audio PCM encoding format
Audio encoding |
Sender configuration |
Receiver configuration |
---|---|---|
PCM 16-bit |
Output device |
Input device |
PCM 24-bit |
Output device |
Input device |
The next arguments are supported to configure an audio transmission
Argument |
Type |
Description |
Default |
---|---|---|---|
|
Integer |
Number of audio channels ( |
|
|
Integer |
Audio sample rate ( |
|
|
String |
Audio packet time according to ST2110-30 (the only option is |
|
Example – Run audio transmission, PCM 24-bit#
This example demonstrates sending a PCM 24-bit encoded audio file from the 1st FFmpeg instance to the 2nd FFmpeg instance via Media Communications Mesh.
NIC setup#
TBD
Receiver side setup#
Start Media Proxy
sudo media_proxy -d 0000:32:01.1 -i 192.168.96.11 -r 192.168.97.11 -p 9200-9299 -t 8002
Start FFmpeg to receive packets from Media Communications Mesh and store on the disk
sudo MCM_MEDIA_PROXY_PORT=8002 ffmpeg -re -f mcm_audio_pcm24 \ -conn_type st2110 \ -ip_addr 192.168.96.10 \ -port 9001 \ -channels 2 \ -sample_rate 48000 \ -ptime 1ms \ -i - output.wav
Sender side setup#
Start Media Proxy
sudo media_proxy -d 0000:32:01.0 -i 192.168.96.10 -r 192.168.97.10 -p 9100-9199 -t 8001
Start FFmpeg to stream an audio file to the receiver via Media Communications Mesh
sudo MCM_MEDIA_PROXY_PORT=8001 ffmpeg -i <audio-file-path> -f mcm_audio_pcm24 \ -conn_type st2110 \ -ip_addr 192.168.96.11 \ -port 9001 \ -channels 2 \ -sample_rate 48000 \ -ptime 1ms -