FFmpeg plugin for MCM#
Build#
Prerequisites#
Install dependencies and build MCM as described in the top level README.md, paragraph “Basic Installation”.
Build flow#
Clone the FFmpeg repository (Release 7.0 by default) and apply MCM 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 MCM plugin
./build-ffmpeg.sh
MCM connection configuration#
The next arguments are supported to configure a connection to MCM
Argument |
Type |
Description |
Default |
---|---|---|---|
|
String |
Remote IP address |
|
|
String |
Remote port (Sender), or Local port (Receiver) |
|
|
String |
MCM Protocol type ( |
|
|
String |
ST2110 payload 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 MCM and then stream it to a remote machine via UDP.
NIC setup#
TBD
Receiver side setup#
Start media_proxy
sudo media_proxy -d 0000:32:11.1 -i 192.168.96.2 -t 8002
Start FFmpeg to receive frames from MCM and stream to a remote machine via UDP
sudo MCM_MEDIA_PROXY_PORT=8002 ffmpeg -re -f mcm \ -frame_rate 24 \ -video_size nhd \ -pixel_format yuv422p10le \ -protocol_type auto \ -payload_type st20 \ -ip_addr 192.168.96.1 \ -port 9001 \ -i - -vcodec mpeg4 -f mpegts udp://<remote-ip>:<remote-port>
Sender side setup#
Start media_proxy
sudo media_proxy -d 0000:32:11.0 -i 192.168.96.1 -t 8001
Start FFmpeg to stream a video file to the receiver via MCM
sudo MCM_MEDIA_PROXY_PORT=8001 ffmpeg -i <video-file-path> -f mcm \ -frame_rate 24 \ -video_size nhd \ -pixel_format yuv422p10le \ -protocol_type auto \ -payload_type st20 \ -ip_addr 192.168.96.2 \ -port 9001 -
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 MCM.
NIC setup#
TBD
Receiver side setup#
Start media_proxy
sudo media_proxy -d 0000:32:11.1 -i 192.168.96.2 -t 8002
Start FFmpeg to receive packets from MCM and store on the disk
sudo MCM_MEDIA_PROXY_PORT=8002 ffmpeg -re -f mcm_audio_pcm24 \ -channels 2 \ -sample_rate 48000 \ -ptime 1ms \ -protocol_type auto \ -payload_type st30 \ -ip_addr 192.168.96.1 \ -port 9001 \ -i - output.wav
Sender side setup#
Start media_proxy
sudo media_proxy -d 0000:32:11.0 -i 192.168.96.1 -t 8001
Start FFmpeg to stream an audio file to the receiver via MCM
sudo MCM_MEDIA_PROXY_PORT=8001 ffmpeg -i <audio-file-path> -f mcm_audio_pcm24 \ -channels 2 \ -sample_rate 48000 \ -ptime 1ms \ -protocol_type auto \ -payload_type st30 \ -ip_addr 192.168.96.2 \ -port 9001 -