Skip to content

Commit

Permalink
Fix st30p ffmpeg plugin, (#986)
Browse files Browse the repository at this point in the history
"ar" and "ac" are standard FFmpeg parameters and shall not be used as
plugin parameters. For this reason the user could not customize commands
Change  "ar" to "sample_rate"  audio sample rate
Change "ac" to "channels" number of audio channel
change "at" to "ptime" audio packet time
  • Loading branch information
tszumski authored Oct 1, 2024
1 parent dbb4cd6 commit f33cc15
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions ecosystem/ffmpeg_plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,25 +152,25 @@ ffmpeg -stream_loop -1 -video_size 1920x1080 -f rawvideo -pix_fmt yuv422p10le -i
Reading a st2110-30 stream(pcm24,1ms packet time,2 channels) on "239.168.85.20:30000" with payload_type 111 and encoded to a wav file:

```bash
ffmpeg -p_port 0000:af:01.0 -p_sip 192.168.96.2 -p_rx_ip 239.168.85.20 -udp_port 30000 -payload_type 111 -pcm_fmt pcm24 -at 1ms -ac 2 -f mtl_st30p -i "0" dump.wav -y
ffmpeg -p_port 0000:af:01.0 -p_sip 192.168.96.2 -p_rx_ip 239.168.85.20 -udp_port 30000 -payload_type 111 -pcm_fmt pcm24 -ptime 1ms -channels 2 -f mtl_st30p -i "0" dump.wav -y
```

### 4.2 St30p output

Reading from a wav file and sending a st2110-30 stream(pcm24,1ms packet time,2 channels) on "239.168.85.20:30000" with payload_type 111:

```bash
ffmpeg -stream_loop -1 -i test.wav -p_port 0000:af:01.1 -p_sip 192.168.96.3 -p_tx_ip 239.168.85.20 -udp_port 30000 -payload_type 111 -at 1ms -f mtl_st30p -
ffmpeg -stream_loop -1 -i test.wav -p_port 0000:af:01.1 -p_sip 192.168.96.3 -p_tx_ip 239.168.85.20 -udp_port 30000 -payload_type 111 -ptime 1ms -f mtl_st30p -
```

### 4.3 St30p pcm16 example

For pcm16 audio, use `mtl_st30p_pcm16` muxer, set `pcm_fmt` to `pcm16` for demuxer.

```bash
ffmpeg -stream_loop -1 -i test.wav -p_port 0000:af:01.1 -p_sip 192.168.96.3 -p_tx_ip 239.168.85.20 -udp_port 30000 -payload_type 111 -at 1ms -f mtl_st30p_pcm16 -
ffmpeg -stream_loop -1 -i test.wav -p_port 0000:af:01.1 -p_sip 192.168.96.3 -p_tx_ip 239.168.85.20 -udp_port 30000 -payload_type 111 -ptime 1ms -f mtl_st30p_pcm16 -

ffmpeg -p_port 0000:af:01.0 -p_sip 192.168.96.2 -p_rx_ip 239.168.85.20 -udp_port 30000 -payload_type 111 -pcm_fmt pcm16 -at 1ms -ac 2 -f mtl_st30p -i "0" dump_pcm16.wav -y
ffmpeg -p_port 0000:af:01.0 -p_sip 192.168.96.2 -p_rx_ip 239.168.85.20 -udp_port 30000 -payload_type 111 -pcm_fmt pcm16 -ptime 1ms -channels 2 -f mtl_st30p -i "0" dump_pcm16.wav -y
```

### Enabling experimental MTL_GPU_DIRECT in FFmpeg with ST20p Support
Expand Down
10 changes: 5 additions & 5 deletions ecosystem/ffmpeg_plugin/mtl_st30p_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,16 +266,16 @@ static const AVOption mtl_st30p_rx_options[] = {
0,
60,
DEC},
{"ar",
"audio sampling rate",
{"sample_rate",
"audio sample rate",
OFFSET(sample_rate),
AV_OPT_TYPE_INT,
{.i64 = 48000},
1,
INT_MAX,
DEC},
{"ac",
"audio channel",
{"channels",
"number of audio channels",
OFFSET(channels),
AV_OPT_TYPE_INT,
{.i64 = 2},
Expand All @@ -288,7 +288,7 @@ static const AVOption mtl_st30p_rx_options[] = {
AV_OPT_TYPE_STRING,
{.str = NULL},
.flags = DEC},
{"at",
{"ptime",
"audio packet time",
OFFSET(ptime_str),
AV_OPT_TYPE_STRING,
Expand Down
2 changes: 1 addition & 1 deletion ecosystem/ffmpeg_plugin/mtl_st30p_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static const AVOption mtl_st30p_tx_options[] = {
3,
8000,
ENC},
{"at",
{"ptime",
"audio packet time",
OFFSET(ptime_str),
AV_OPT_TYPE_STRING,
Expand Down

0 comments on commit f33cc15

Please sign in to comment.