* [FFmpeg-devel] [PATCH] avformat/whip: Drop invalid group:BUNDLE from SDP in single-stream cases
@ 2025-10-06 8:06 baigao via ffmpeg-devel
2025-10-06 11:33 ` [FFmpeg-devel] " Jack Lau via ffmpeg-devel
2025-10-08 1:16 ` Jack Lau via ffmpeg-devel
0 siblings, 2 replies; 3+ messages in thread
From: baigao via ffmpeg-devel @ 2025-10-06 8:06 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: baigao
---
libavformat/whip.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavformat/whip.c b/libavformat/whip.c
index 472c6dbf16..6ace9240f9 100644
--- a/libavformat/whip.c
+++ b/libavformat/whip.c
@@ -617,12 +617,14 @@ static int generate_sdp_offer(AVFormatContext *s)
"o=FFmpeg %s 2 IN IP4 %s\r\n"
"s=FFmpegPublishSession\r\n"
"t=0 0\r\n"
- "a=group:BUNDLE 0 1\r\n"
"a=extmap-allow-mixed\r\n"
"a=msid-semantic: WMS\r\n",
WHIP_SDP_SESSION_ID,
WHIP_SDP_CREATOR_IP);
+ if (whip->audio_par && whip->video_par)
+ av_bprintf(&bp, "a=group:BUNDLE 0 1\r\n");
+
if (whip->audio_par) {
if (whip->audio_par->codec_id == AV_CODEC_ID_OPUS)
acodec_name = "opus";
--
2.51.0
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* [FFmpeg-devel] Re: [PATCH] avformat/whip: Drop invalid group:BUNDLE from SDP in single-stream cases
2025-10-06 8:06 [FFmpeg-devel] [PATCH] avformat/whip: Drop invalid group:BUNDLE from SDP in single-stream cases baigao via ffmpeg-devel
@ 2025-10-06 11:33 ` Jack Lau via ffmpeg-devel
2025-10-08 1:16 ` Jack Lau via ffmpeg-devel
1 sibling, 0 replies; 3+ messages in thread
From: Jack Lau via ffmpeg-devel @ 2025-10-06 11:33 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Jack Lau
> On Oct 6, 2025, at 16:06, baigao via ffmpeg-devel <ffmpeg-devel@ffmpeg.org> wrote:
>
> ---
> libavformat/whip.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/whip.c b/libavformat/whip.c
> index 472c6dbf16..6ace9240f9 100644
> --- a/libavformat/whip.c
> +++ b/libavformat/whip.c
> @@ -617,12 +617,14 @@ static int generate_sdp_offer(AVFormatContext *s)
> "o=FFmpeg %s 2 IN IP4 %s\r\n"
> "s=FFmpegPublishSession\r\n"
> "t=0 0\r\n"
> - "a=group:BUNDLE 0 1\r\n"
> "a=extmap-allow-mixed\r\n"
> "a=msid-semantic: WMS\r\n",
> WHIP_SDP_SESSION_ID,
> WHIP_SDP_CREATOR_IP);
>
> + if (whip->audio_par && whip->video_par)
> + av_bprintf(&bp, "a=group:BUNDLE 0 1\r\n");
> +
> if (whip->audio_par) {
> if (whip->audio_par->codec_id == AV_CODEC_ID_OPUS)
> acodec_name = "opus";
> --
> 2.51.0
>
> _______________________________________________
> ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
> To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
LGTM
Thanks!
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* [FFmpeg-devel] Re: [PATCH] avformat/whip: Drop invalid group:BUNDLE from SDP in single-stream cases
2025-10-06 8:06 [FFmpeg-devel] [PATCH] avformat/whip: Drop invalid group:BUNDLE from SDP in single-stream cases baigao via ffmpeg-devel
2025-10-06 11:33 ` [FFmpeg-devel] " Jack Lau via ffmpeg-devel
@ 2025-10-08 1:16 ` Jack Lau via ffmpeg-devel
1 sibling, 0 replies; 3+ messages in thread
From: Jack Lau via ffmpeg-devel @ 2025-10-08 1:16 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Jack Lau
> On Oct 6, 2025, at 16:06, baigao via ffmpeg-devel <ffmpeg-devel@ffmpeg.org> wrote:
>
> ---
> libavformat/whip.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/whip.c b/libavformat/whip.c
> index 472c6dbf16..6ace9240f9 100644
> --- a/libavformat/whip.c
> +++ b/libavformat/whip.c
> @@ -617,12 +617,14 @@ static int generate_sdp_offer(AVFormatContext *s)
> "o=FFmpeg %s 2 IN IP4 %s\r\n"
> "s=FFmpegPublishSession\r\n"
> "t=0 0\r\n"
> - "a=group:BUNDLE 0 1\r\n"
> "a=extmap-allow-mixed\r\n"
> "a=msid-semantic: WMS\r\n",
> WHIP_SDP_SESSION_ID,
> WHIP_SDP_CREATOR_IP);
>
> + if (whip->audio_par && whip->video_par)
> + av_bprintf(&bp, "a=group:BUNDLE 0 1\r\n");
> +
After testing this patch, I found something need to be improved
The bug cause by the a=group:BUNDLE use non-exist mid when there is single stream
Some SFUs reject non-bundle SDP(like SRS), and Chrome generate SDP with BUNDLE
even though there is single stream.
So, to improve compatibility, please consider making such change
diff --git a/libavformat/whip.c b/libavformat/whip.c
index 6ace9240f9..5b9520041b 100644
--- a/libavformat/whip.c
+++ b/libavformat/whip.c
@@ -622,8 +622,12 @@ static int generate_sdp_offer(AVFormatContext *s)
WHIP_SDP_SESSION_ID,
WHIP_SDP_CREATOR_IP);
- if (whip->audio_par && whip->video_par)
- av_bprintf(&bp, "a=group:BUNDLE 0 1\r\n");
+ av_bprintf(&bp, "a=group:BUNDLE");
+ if (whip->audio_par)
+ av_bprintf(&bp, " 0");
+ if(whip->video_par)
+ av_bprintf(&bp, " 1");
+ av_bprintf(&bp, "\r\n");
if (whip->audio_par) {
if (whip->audio_par->codec_id == AV_CODEC_ID_OPUS)
> if (whip->audio_par) {
> if (whip->audio_par->codec_id == AV_CODEC_ID_OPUS)
> acodec_name = "opus";
> --
> 2.51.0
>
> _______________________________________________
> ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
> To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
Thanks
Jack
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-08 1:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-06 8:06 [FFmpeg-devel] [PATCH] avformat/whip: Drop invalid group:BUNDLE from SDP in single-stream cases baigao via ffmpeg-devel
2025-10-06 11:33 ` [FFmpeg-devel] " Jack Lau via ffmpeg-devel
2025-10-08 1:16 ` Jack Lau via ffmpeg-devel
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ http://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git