OpenVisualCloud / Media-Transport-Library

A real-time media transport(DPDK, AF_XDP, RDMA) stack for both raw and compressed video based on COTS hardware.
BSD 3-Clause "New" or "Revised" License
169 stars 55 forks source link

Fix st30p ffmpeg plugin, #986

Closed tszumski closed 1 month ago

tszumski commented 1 month ago

"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

ko80 commented 1 month ago

Consider using the same names for these arguments as in FFmpeg MCM audio plugin:

    { "channels", "number of audio channels", OFFSET(channels), AV_OPT_TYPE_INT, {.i64 = 2}, 1, INT_MAX, DEC },
    { "sample_rate", "audio sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = 48000}, 1, INT_MAX, DEC },
    { "ptime", "audio packet time", OFFSET(ptime), AV_OPT_TYPE_STRING, {.str = "1ms"}, .flags = DEC },

https://github.com/OpenVisualCloud/Media-Communications-Mesh/blob/4d87a2d1aa514903f4125b394d033c1a1503d6ce/ffmpeg-plugin/mcm_audio_tx.c#L206

DawidWesierski4 commented 1 month ago

Consider using the same names for these arguments as in FFmpeg MCM audio plugin:

    { "channels", "number of audio channels", OFFSET(channels), AV_OPT_TYPE_INT, {.i64 = 2}, 1, INT_MAX, DEC },
    { "sample_rate", "audio sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = 48000}, 1, INT_MAX, DEC },
    { "ptime", "audio packet time", OFFSET(ptime), AV_OPT_TYPE_STRING, {.str = "1ms"}, .flags = DEC },

https://github.com/OpenVisualCloud/Media-Communications-Mesh/blob/4d87a2d1aa514903f4125b394d033c1a1503d6ce/ffmpeg-plugin/mcm_audio_tx.c#L206

i believe this is a great idea everything going to tiber should be as "cross compatible" as possible

tszumski commented 1 month ago

HI i belive the -ac argument is also mentioned in Media-Transport-Library/doc/usdt.md:582 Media-Transport-Library/doc/usdt.md:604 Media-Transport-Library/doc/usdt.md:1522 Media-Transport-Library/doc/usdt.md:1544

In location you mentioned, we do not use MTL ffmpeg plugin, those are just example how to convert audio samples, thus "ar" and "ac" standard FFmpeg parameters shall be used

DawidWesierski4 commented 1 month ago

HI i belive the -ac argument is also mentioned in Media-Transport-Library/doc/usdt.md:582 Media-Transport-Library/doc/usdt.md:604 Media-Transport-Library/doc/usdt.md:1522 Media-Transport-Library/doc/usdt.md:1544

In location you mentioned, we do not use MTL ffmpeg plugin, those are just example how to convert audio samples, thus "ar" and "ac" are standard FFmpeg parameters shall be used

ooooki doki yuuup makes sense thank you

lgtm then