* [FFmpeg-devel] [PATCH] avformat/rtsp: Fix server compatibility issues with rtspclientsink GStreamer plugin
@ 2023-12-27 13:44 Paul Orlyk
2023-12-28 19:33 ` Michael Niedermayer
0 siblings, 1 reply; 11+ messages in thread
From: Paul Orlyk @ 2023-12-27 13:44 UTC (permalink / raw)
To: ffmpeg-devel
mode field in Transport header can be sent in upper case so make string
comparison case insensitive.
Also, GStreamer expects to see mode=record instead of mode=receive in
Transport header in response.
Signed-off-by: Paul Orlyk <paul.orlyk@gmail.com>
---
libavformat/rtsp.c | 4 ++--
libavformat/rtspdec.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 583f5338e8..61e24a5c7a 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1012,8 +1012,8 @@ static void rtsp_parse_transport(AVFormatContext *s,
if (*p == '=') {
p++;
get_word_sep(buf, sizeof(buf), ";, ", &p);
- if (!strcmp(buf, "record") ||
- !strcmp(buf, "receive"))
+ if (!av_strcasecmp(buf, "record") ||
+ !av_strcasecmp(buf, "receive"))
th->mode_record = 1;
}
}
diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index 39fd92fb66..d6a223cbc6 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -303,7 +303,7 @@ static int rtsp_read_setup(AVFormatContext *s, char*
host, char *controlurl)
rtsp_st->interleaved_min = request.transports[0].interleaved_min;
rtsp_st->interleaved_max = request.transports[0].interleaved_max;
snprintf(responseheaders, sizeof(responseheaders), "Transport: "
- "RTP/AVP/TCP;unicast;mode=receive;interleaved=%d-%d"
+ "RTP/AVP/TCP;unicast;mode=record;interleaved=%d-%d"
"\r\n", request.transports[0].interleaved_min,
request.transports[0].interleaved_max);
} else {
@@ -333,7 +333,7 @@ static int rtsp_read_setup(AVFormatContext *s, char*
host, char *controlurl)
localport = ff_rtp_get_local_rtp_port(rtsp_st->rtp_handle);
snprintf(responseheaders, sizeof(responseheaders), "Transport: "
- "RTP/AVP/UDP;unicast;mode=receive;source=%s;"
+ "RTP/AVP/UDP;unicast;mode=record;source=%s;"
"client_port=%d-%d;server_port=%d-%d\r\n",
host, request.transports[0].client_port_min,
request.transports[0].client_port_max, localport,
--
2.39.2
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat/rtsp: Fix server compatibility issues with rtspclientsink GStreamer plugin
2023-12-27 13:44 [FFmpeg-devel] [PATCH] avformat/rtsp: Fix server compatibility issues with rtspclientsink GStreamer plugin Paul Orlyk
@ 2023-12-28 19:33 ` Michael Niedermayer
2024-01-03 12:51 ` Paul Orlyk
0 siblings, 1 reply; 11+ messages in thread
From: Michael Niedermayer @ 2023-12-28 19:33 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 1708 bytes --]
On Wed, Dec 27, 2023 at 03:44:09PM +0200, Paul Orlyk wrote:
> mode field in Transport header can be sent in upper case so make string
> comparison case insensitive.
> Also, GStreamer expects to see mode=record instead of mode=receive in
> Transport header in response.
>
> Signed-off-by: Paul Orlyk <paul.orlyk@gmail.com>
> ---
> libavformat/rtsp.c | 4 ++--
> libavformat/rtspdec.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> index 583f5338e8..61e24a5c7a 100644
> --- a/libavformat/rtsp.c
> +++ b/libavformat/rtsp.c
> @@ -1012,8 +1012,8 @@ static void rtsp_parse_transport(AVFormatContext *s,
> if (*p == '=') {
> p++;
> get_word_sep(buf, sizeof(buf), ";, ", &p);
> - if (!strcmp(buf, "record") ||
> - !strcmp(buf, "receive"))
> + if (!av_strcasecmp(buf, "record") ||
> + !av_strcasecmp(buf, "receive"))
> th->mode_record = 1;
> }
> }
> diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
> index 39fd92fb66..d6a223cbc6 100644
> --- a/libavformat/rtspdec.c
> +++ b/libavformat/rtspdec.c
> @@ -303,7 +303,7 @@ static int rtsp_read_setup(AVFormatContext *s, char*
> host, char *controlurl)
> rtsp_st->interleaved_min = request.transports[0].interleaved_min;
patch is damaged by linebreaks
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat/rtsp: Fix server compatibility issues with rtspclientsink GStreamer plugin
2023-12-28 19:33 ` Michael Niedermayer
@ 2024-01-03 12:51 ` Paul Orlyk
2024-01-10 17:57 ` Paul Orlyk
2024-01-12 19:07 ` Michael Niedermayer
0 siblings, 2 replies; 11+ messages in thread
From: Paul Orlyk @ 2024-01-03 12:51 UTC (permalink / raw)
To: ffmpeg-devel
[-- Attachment #1: Type: text/plain, Size: 1629 bytes --]
On 12/28/23 21:33, Michael Niedermayer wrote:
> On Wed, Dec 27, 2023 at 03:44:09PM +0200, Paul Orlyk wrote:
>> mode field in Transport header can be sent in upper case so make string
>> comparison case insensitive.
>> Also, GStreamer expects to see mode=record instead of mode=receive in
>> Transport header in response.
>>
>> Signed-off-by: Paul Orlyk<paul.orlyk@gmail.com>
>> ---
>> libavformat/rtsp.c | 4 ++--
>> libavformat/rtspdec.c | 4 ++--
>> 2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
>> index 583f5338e8..61e24a5c7a 100644
>> --- a/libavformat/rtsp.c
>> +++ b/libavformat/rtsp.c
>> @@ -1012,8 +1012,8 @@ static void rtsp_parse_transport(AVFormatContext *s,
>> if (*p == '=') {
>> p++;
>> get_word_sep(buf, sizeof(buf), ";, ", &p);
>> - if (!strcmp(buf, "record") ||
>> - !strcmp(buf, "receive"))
>> + if (!av_strcasecmp(buf, "record") ||
>> + !av_strcasecmp(buf, "receive"))
>> th->mode_record = 1;
>> }
>> }
>> diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
>> index 39fd92fb66..d6a223cbc6 100644
>> --- a/libavformat/rtspdec.c
>> +++ b/libavformat/rtspdec.c
>> @@ -303,7 +303,7 @@ static int rtsp_read_setup(AVFormatContext*s, char*
>> host, char *controlurl)
>> rtsp_st->interleaved_min = request.transports[0].interleaved_min;
> patch is damaged by linebreaks
>
>
> [...]
Sorry for that. Please find it attached.
[-- Attachment #2: 0001-avformat-rtsp-Fix-server-compatibility-issues-with-r.patch --]
[-- Type: text/x-patch, Size: 2579 bytes --]
From 156ceeded6cd076b781205adc034144186a9a7ea Mon Sep 17 00:00:00 2001
From: Paul Orlyk <paul.orlyk@gmail.com>
Date: Wed, 27 Dec 2023 15:30:20 +0200
Subject: [PATCH] avformat/rtsp: Fix server compatibility issues with
rtspclientsink GStreamer plugin
mode field in Transport header can be sent in upper case so make string comparison case insensitive.
Also, GStreamer expects to see mode=record instead of mode=receive in Transport header in response.
Signed-off-by: Paul Orlyk <paul.orlyk@gmail.com>
---
libavformat/rtsp.c | 4 ++--
libavformat/rtspdec.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 583f5338e8..61e24a5c7a 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1012,8 +1012,8 @@ static void rtsp_parse_transport(AVFormatContext *s,
if (*p == '=') {
p++;
get_word_sep(buf, sizeof(buf), ";, ", &p);
- if (!strcmp(buf, "record") ||
- !strcmp(buf, "receive"))
+ if (!av_strcasecmp(buf, "record") ||
+ !av_strcasecmp(buf, "receive"))
th->mode_record = 1;
}
}
diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index 39fd92fb66..d6a223cbc6 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -303,7 +303,7 @@ static int rtsp_read_setup(AVFormatContext *s, char* host, char *controlurl)
rtsp_st->interleaved_min = request.transports[0].interleaved_min;
rtsp_st->interleaved_max = request.transports[0].interleaved_max;
snprintf(responseheaders, sizeof(responseheaders), "Transport: "
- "RTP/AVP/TCP;unicast;mode=receive;interleaved=%d-%d"
+ "RTP/AVP/TCP;unicast;mode=record;interleaved=%d-%d"
"\r\n", request.transports[0].interleaved_min,
request.transports[0].interleaved_max);
} else {
@@ -333,7 +333,7 @@ static int rtsp_read_setup(AVFormatContext *s, char* host, char *controlurl)
localport = ff_rtp_get_local_rtp_port(rtsp_st->rtp_handle);
snprintf(responseheaders, sizeof(responseheaders), "Transport: "
- "RTP/AVP/UDP;unicast;mode=receive;source=%s;"
+ "RTP/AVP/UDP;unicast;mode=record;source=%s;"
"client_port=%d-%d;server_port=%d-%d\r\n",
host, request.transports[0].client_port_min,
request.transports[0].client_port_max, localport,
--
2.39.2
[-- Attachment #3: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat/rtsp: Fix server compatibility issues with rtspclientsink GStreamer plugin
2024-01-03 12:51 ` Paul Orlyk
@ 2024-01-10 17:57 ` Paul Orlyk
2024-01-12 19:07 ` Michael Niedermayer
1 sibling, 0 replies; 11+ messages in thread
From: Paul Orlyk @ 2024-01-10 17:57 UTC (permalink / raw)
To: ffmpeg-devel
On 1/3/24 14:51, Paul Orlyk wrote:
> On 12/28/23 21:33, Michael Niedermayer wrote:
>> On Wed, Dec 27, 2023 at 03:44:09PM +0200, Paul Orlyk wrote:
>>> mode field in Transport header can be sent in upper case so make string
>>> comparison case insensitive.
>>> Also, GStreamer expects to see mode=record instead of mode=receive in
>>> Transport header in response.
>>>
>>> Signed-off-by: Paul Orlyk<paul.orlyk@gmail.com>
>>> ---
>>> libavformat/rtsp.c | 4 ++--
>>> libavformat/rtspdec.c | 4 ++--
>>> 2 files changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
>>> index 583f5338e8..61e24a5c7a 100644
>>> --- a/libavformat/rtsp.c
>>> +++ b/libavformat/rtsp.c
>>> @@ -1012,8 +1012,8 @@ static void
>>> rtsp_parse_transport(AVFormatContext *s,
>>> if (*p == '=') {
>>> p++;
>>> get_word_sep(buf, sizeof(buf), ";, ", &p);
>>> - if (!strcmp(buf, "record") ||
>>> - !strcmp(buf, "receive"))
>>> + if (!av_strcasecmp(buf, "record") ||
>>> + !av_strcasecmp(buf, "receive"))
>>> th->mode_record = 1;
>>> }
>>> }
>>> diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
>>> index 39fd92fb66..d6a223cbc6 100644
>>> --- a/libavformat/rtspdec.c
>>> +++ b/libavformat/rtspdec.c
>>> @@ -303,7 +303,7 @@ static int rtsp_read_setup(AVFormatContext*s, char*
>>> host, char *controlurl)
>>> rtsp_st->interleaved_min =
>>> request.transports[0].interleaved_min;
>> patch is damaged by linebreaks
>>
>>
>> [...]
>
>
> Sorry for that. Please find it attached.
Ping
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat/rtsp: Fix server compatibility issues with rtspclientsink GStreamer plugin
2024-01-03 12:51 ` Paul Orlyk
2024-01-10 17:57 ` Paul Orlyk
@ 2024-01-12 19:07 ` Michael Niedermayer
2024-01-12 20:46 ` Paul Orlyk
1 sibling, 1 reply; 11+ messages in thread
From: Michael Niedermayer @ 2024-01-12 19:07 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 3066 bytes --]
On Wed, Jan 03, 2024 at 02:51:36PM +0200, Paul Orlyk wrote:
> On 12/28/23 21:33, Michael Niedermayer wrote:
> > On Wed, Dec 27, 2023 at 03:44:09PM +0200, Paul Orlyk wrote:
> > > mode field in Transport header can be sent in upper case so make string
> > > comparison case insensitive.
> > > Also, GStreamer expects to see mode=record instead of mode=receive in
> > > Transport header in response.
> > >
> > > Signed-off-by: Paul Orlyk<paul.orlyk@gmail.com>
> > > ---
> > > libavformat/rtsp.c | 4 ++--
> > > libavformat/rtspdec.c | 4 ++--
> > > 2 files changed, 4 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> > > index 583f5338e8..61e24a5c7a 100644
> > > --- a/libavformat/rtsp.c
> > > +++ b/libavformat/rtsp.c
> > > @@ -1012,8 +1012,8 @@ static void rtsp_parse_transport(AVFormatContext *s,
> > > if (*p == '=') {
> > > p++;
> > > get_word_sep(buf, sizeof(buf), ";, ", &p);
> > > - if (!strcmp(buf, "record") ||
> > > - !strcmp(buf, "receive"))
> > > + if (!av_strcasecmp(buf, "record") ||
> > > + !av_strcasecmp(buf, "receive"))
> > > th->mode_record = 1;
> > > }
> > > }
> > > diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
> > > index 39fd92fb66..d6a223cbc6 100644
> > > --- a/libavformat/rtspdec.c
> > > +++ b/libavformat/rtspdec.c
> > > @@ -303,7 +303,7 @@ static int rtsp_read_setup(AVFormatContext*s, char*
> > > host, char *controlurl)
> > > rtsp_st->interleaved_min = request.transports[0].interleaved_min;
> > patch is damaged by linebreaks
> >
> >
> > [...]
>
>
> Sorry for that. Please find it attached.
> rtsp.c | 4 ++--
> rtspdec.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
> 8ed5709b8c5cb30aeaa18d609b86b9be0557a06e 0001-avformat-rtsp-Fix-server-compatibility-issues-with-r.patch
> From 156ceeded6cd076b781205adc034144186a9a7ea Mon Sep 17 00:00:00 2001
> From: Paul Orlyk <paul.orlyk@gmail.com>
> Date: Wed, 27 Dec 2023 15:30:20 +0200
> Subject: [PATCH] avformat/rtsp: Fix server compatibility issues with
> rtspclientsink GStreamer plugin
>
> mode field in Transport header can be sent in upper case so make string comparison case insensitive.
> Also, GStreamer expects to see mode=record instead of mode=receive in Transport header in response.
It appears to me that these are 2 seperate issues ?
if its 2 patches, i can apply the av_strcasecmp().
For the receive vs record i would prefer to see some quote from a RFC instead
of just an implementation
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
If you fake or manipulate statistics in a paper in physics you will never
get a job again.
If you fake or manipulate statistics in a paper in medicin you will get
a job for life at the pharma industry.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat/rtsp: Fix server compatibility issues with rtspclientsink GStreamer plugin
2024-01-12 19:07 ` Michael Niedermayer
@ 2024-01-12 20:46 ` Paul Orlyk
2024-01-13 18:22 ` Michael Niedermayer
0 siblings, 1 reply; 11+ messages in thread
From: Paul Orlyk @ 2024-01-12 20:46 UTC (permalink / raw)
To: ffmpeg-devel
On 1/12/24 21:07, Michael Niedermayer wrote:
> On Wed, Jan 03, 2024 at 02:51:36PM +0200, Paul Orlyk wrote:
>> On 12/28/23 21:33, Michael Niedermayer wrote:
>>> On Wed, Dec 27, 2023 at 03:44:09PM +0200, Paul Orlyk wrote:
>>>> mode field in Transport header can be sent in upper case so make string
>>>> comparison case insensitive.
>>>> Also, GStreamer expects to see mode=record instead of mode=receive in
>>>> Transport header in response.
>>>>
>>>> Signed-off-by: Paul Orlyk<paul.orlyk@gmail.com>
>>>> ---
>>>> libavformat/rtsp.c | 4 ++--
>>>> libavformat/rtspdec.c | 4 ++--
>>>> 2 files changed, 4 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
>>>> index 583f5338e8..61e24a5c7a 100644
>>>> --- a/libavformat/rtsp.c
>>>> +++ b/libavformat/rtsp.c
>>>> @@ -1012,8 +1012,8 @@ static void rtsp_parse_transport(AVFormatContext *s,
>>>> if (*p == '=') {
>>>> p++;
>>>> get_word_sep(buf, sizeof(buf), ";, ", &p);
>>>> - if (!strcmp(buf, "record") ||
>>>> - !strcmp(buf, "receive"))
>>>> + if (!av_strcasecmp(buf, "record") ||
>>>> + !av_strcasecmp(buf, "receive"))
>>>> th->mode_record = 1;
>>>> }
>>>> }
>>>> diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
>>>> index 39fd92fb66..d6a223cbc6 100644
>>>> --- a/libavformat/rtspdec.c
>>>> +++ b/libavformat/rtspdec.c
>>>> @@ -303,7 +303,7 @@ static int rtsp_read_setup(AVFormatContext*s, char*
>>>> host, char *controlurl)
>>>> rtsp_st->interleaved_min = request.transports[0].interleaved_min;
>>> patch is damaged by linebreaks
>>>
>>>
>>> [...]
>>
>>
>> Sorry for that. Please find it attached.
>
>> rtsp.c | 4 ++--
>> rtspdec.c | 4 ++--
>> 2 files changed, 4 insertions(+), 4 deletions(-)
>> 8ed5709b8c5cb30aeaa18d609b86b9be0557a06e 0001-avformat-rtsp-Fix-server-compatibility-issues-with-r.patch
>> From 156ceeded6cd076b781205adc034144186a9a7ea Mon Sep 17 00:00:00 2001
>> From: Paul Orlyk <paul.orlyk@gmail.com>
>> Date: Wed, 27 Dec 2023 15:30:20 +0200
>> Subject: [PATCH] avformat/rtsp: Fix server compatibility issues with
>> rtspclientsink GStreamer plugin
>>
>> mode field in Transport header can be sent in upper case so make string comparison case insensitive.
>
>> Also, GStreamer expects to see mode=record instead of mode=receive in Transport header in response.
>
> It appears to me that these are 2 seperate issues ?
> if its 2 patches, i can apply the av_strcasecmp().
Essentially they are. I combined them in the context of GStreamer compatibility.
Would it be better at this point to send them separately?
>
> For the receive vs record i would prefer to see some quote from a RFC instead
> of just an implementation
>
> thx
>
> [...]
Regarding receive vs record:
RFC 7826 "Real-Time Streaming Protocol Version 2.0" (https://datatracker.ietf.org/doc/html/rfc7826), section 18.54:
mode: The mode parameter indicates the methods to be supported for
this session. The currently defined valid value is "PLAY". If
not provided, the default is "PLAY". The "RECORD" value was
defined in RFC 2326; in this specification, it is unspecified
but reserved. RECORD and other values may be specified in the
future.
RFC 2326 "Real Time Streaming Protocol (RTSP)" (https://datatracker.ietf.org/doc/html/rfc2326), section 12.39:
mode:
The mode parameter indicates the methods to be supported for
this session. Valid values are PLAY and RECORD. If not
provided, the default is PLAY.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat/rtsp: Fix server compatibility issues with rtspclientsink GStreamer plugin
2024-01-12 20:46 ` Paul Orlyk
@ 2024-01-13 18:22 ` Michael Niedermayer
2024-01-15 20:37 ` [FFmpeg-devel] [PATCH v2 1/2] avformat/rtsp: Support mode field of Transport header being sent in upper case Paul Orlyk
2024-01-15 20:37 ` [FFmpeg-devel] [PATCH v2 2/2] avformat/rtsp: Send mode=record instead of mode=receive in Transport header Paul Orlyk
0 siblings, 2 replies; 11+ messages in thread
From: Michael Niedermayer @ 2024-01-13 18:22 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 4989 bytes --]
On Fri, Jan 12, 2024 at 10:46:41PM +0200, Paul Orlyk wrote:
> On 1/12/24 21:07, Michael Niedermayer wrote:
> > On Wed, Jan 03, 2024 at 02:51:36PM +0200, Paul Orlyk wrote:
> > > On 12/28/23 21:33, Michael Niedermayer wrote:
> > > > On Wed, Dec 27, 2023 at 03:44:09PM +0200, Paul Orlyk wrote:
> > > > > mode field in Transport header can be sent in upper case so make string
> > > > > comparison case insensitive.
> > > > > Also, GStreamer expects to see mode=record instead of mode=receive in
> > > > > Transport header in response.
> > > > >
> > > > > Signed-off-by: Paul Orlyk<paul.orlyk@gmail.com>
> > > > > ---
> > > > > libavformat/rtsp.c | 4 ++--
> > > > > libavformat/rtspdec.c | 4 ++--
> > > > > 2 files changed, 4 insertions(+), 4 deletions(-)
> > > > >
> > > > > diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> > > > > index 583f5338e8..61e24a5c7a 100644
> > > > > --- a/libavformat/rtsp.c
> > > > > +++ b/libavformat/rtsp.c
> > > > > @@ -1012,8 +1012,8 @@ static void rtsp_parse_transport(AVFormatContext *s,
> > > > > if (*p == '=') {
> > > > > p++;
> > > > > get_word_sep(buf, sizeof(buf), ";, ", &p);
> > > > > - if (!strcmp(buf, "record") ||
> > > > > - !strcmp(buf, "receive"))
> > > > > + if (!av_strcasecmp(buf, "record") ||
> > > > > + !av_strcasecmp(buf, "receive"))
> > > > > th->mode_record = 1;
> > > > > }
> > > > > }
> > > > > diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
> > > > > index 39fd92fb66..d6a223cbc6 100644
> > > > > --- a/libavformat/rtspdec.c
> > > > > +++ b/libavformat/rtspdec.c
> > > > > @@ -303,7 +303,7 @@ static int rtsp_read_setup(AVFormatContext*s, char*
> > > > > host, char *controlurl)
> > > > > rtsp_st->interleaved_min = request.transports[0].interleaved_min;
> > > > patch is damaged by linebreaks
> > > >
> > > >
> > > > [...]
> > >
> > >
> > > Sorry for that. Please find it attached.
> >
> > > rtsp.c | 4 ++--
> > > rtspdec.c | 4 ++--
> > > 2 files changed, 4 insertions(+), 4 deletions(-)
> > > 8ed5709b8c5cb30aeaa18d609b86b9be0557a06e 0001-avformat-rtsp-Fix-server-compatibility-issues-with-r.patch
> > > From 156ceeded6cd076b781205adc034144186a9a7ea Mon Sep 17 00:00:00 2001
> > > From: Paul Orlyk <paul.orlyk@gmail.com>
> > > Date: Wed, 27 Dec 2023 15:30:20 +0200
> > > Subject: [PATCH] avformat/rtsp: Fix server compatibility issues with
> > > rtspclientsink GStreamer plugin
> > >
> > > mode field in Transport header can be sent in upper case so make string comparison case insensitive.
> >
> > > Also, GStreamer expects to see mode=record instead of mode=receive in Transport header in response.
> >
> > It appears to me that these are 2 seperate issues ?
> > if its 2 patches, i can apply the av_strcasecmp().
>
> Essentially they are. I combined them in the context of GStreamer compatibility.
> Would it be better at this point to send them separately?
yes
>
> >
> > For the receive vs record i would prefer to see some quote from a RFC instead
> > of just an implementation
> >
> > thx
> >
> > [...]
>
> Regarding receive vs record:
>
> RFC 7826 "Real-Time Streaming Protocol Version 2.0" (https://datatracker.ietf.org/doc/html/rfc7826), section 18.54:
> mode: The mode parameter indicates the methods to be supported for
> this session. The currently defined valid value is "PLAY". If
> not provided, the default is "PLAY". The "RECORD" value was
> defined in RFC 2326; in this specification, it is unspecified
> but reserved. RECORD and other values may be specified in the
> future.
> RFC 2326 "Real Time Streaming Protocol (RTSP)" (https://datatracker.ietf.org/doc/html/rfc2326), section 12.39:
> mode:
> The mode parameter indicates the methods to be supported for
> this session. Valid values are PLAY and RECORD. If not
> provided, the default is PLAY.
Please add this to teh commit message
also if you can test with anything else than gstreamer, that would be great
rtsp/rtp is often regarded as a bit picky.
Reason why iam hesitant with applying patches on this, is i am affraid fixing
it in one case could break another
also if you can check git blame, why it was wrong, and add this too to
the commit message (like this was always this way or it is a regression since)
that also adds information.
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
If the United States is serious about tackling the national security threats
related to an insecure 5G network, it needs to rethink the extent to which it
values corporate profits and government espionage over security.-Bruce Schneier
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* [FFmpeg-devel] [PATCH v2 1/2] avformat/rtsp: Support mode field of Transport header being sent in upper case
2024-01-13 18:22 ` Michael Niedermayer
@ 2024-01-15 20:37 ` Paul Orlyk
2024-01-16 0:05 ` Michael Niedermayer
2024-01-15 20:37 ` [FFmpeg-devel] [PATCH v2 2/2] avformat/rtsp: Send mode=record instead of mode=receive in Transport header Paul Orlyk
1 sibling, 1 reply; 11+ messages in thread
From: Paul Orlyk @ 2024-01-15 20:37 UTC (permalink / raw)
To: ffmpeg-devel
Fixes server compatibility issues with rtspclientsink GStreamer plugin
Signed-off-by: Paul Orlyk <paul.orlyk@gmail.com>
---
libavformat/rtsp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 583f5338e8..61e24a5c7a 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1012,8 +1012,8 @@ static void rtsp_parse_transport(AVFormatContext *s,
if (*p == '=') {
p++;
get_word_sep(buf, sizeof(buf), ";, ", &p);
- if (!strcmp(buf, "record") ||
- !strcmp(buf, "receive"))
+ if (!av_strcasecmp(buf, "record") ||
+ !av_strcasecmp(buf, "receive"))
th->mode_record = 1;
}
}
--
2.43.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* [FFmpeg-devel] [PATCH v2 2/2] avformat/rtsp: Send mode=record instead of mode=receive in Transport header
2024-01-13 18:22 ` Michael Niedermayer
2024-01-15 20:37 ` [FFmpeg-devel] [PATCH v2 1/2] avformat/rtsp: Support mode field of Transport header being sent in upper case Paul Orlyk
@ 2024-01-15 20:37 ` Paul Orlyk
2024-01-16 0:20 ` Michael Niedermayer
1 sibling, 1 reply; 11+ messages in thread
From: Paul Orlyk @ 2024-01-15 20:37 UTC (permalink / raw)
To: ffmpeg-devel
Fixes server compatibility issues with rtspclientsink GStreamer plugin.
>From specification:
RFC 7826 "Real-Time Streaming Protocol Version 2.0" (https://datatracker.ietf.org/doc/html/rfc7826), section 18.54:
mode: The mode parameter indicates the methods to be supported for
this session. The currently defined valid value is "PLAY". If
not provided, the default is "PLAY". The "RECORD" value was
defined in RFC 2326; in this specification, it is unspecified
but reserved. RECORD and other values may be specified in the
future.
RFC 2326 "Real Time Streaming Protocol (RTSP)" (https://datatracker.ietf.org/doc/html/rfc2326), section 12.39:
mode:
The mode parameter indicates the methods to be supported for
this session. Valid values are PLAY and RECORD. If not
provided, the default is PLAY.
mode=receive was always like this, from the initial commit 'a8ad6ffa rtsp: Add listen mode'.
For comparison, Wowza was used to push RTSP stream to. Both GStreamer and FFmpeg had no issues.
Here is the capture of Wowza responding to SETUP request:
200 OK
CSeq: 3
Server: Wowza Streaming Engine 4.8.26+4 build20231212155517
Cache-Control: no-cache
Expires: Mon, 15 Jan 2024 19:40:31 GMT
Transport: RTP/AVP/UDP;unicast;client_port=11640-11641;mode=record;source=172.17.0.2;server_port=6976-6977
Date: Mon, 15 Jan 2024 19:40:31 GMT
Session: 1401457689;timeout=60
Test setup:
Server: ffmpeg -loglevel trace -y -rtsp_flags listen -i rtsp://0.0.0.0:30800/live.stream t.mp4
FFmpeg client: ffmpeg -re -i "Big Buck Bunny - FULL HD 30FPS.mp4" -c:v libx264 -f rtsp rtsp://127.0.0.1:30800/live.stream
GStreamer client: gst-launch-1.0 videotestsrc is-live=true pattern=smpte ! queue ! videorate ! videoscale ! video/x-raw,width=640,height=360,framerate=60/1 ! timeoverlay font-desc="Sans, 84" halignment=center valignment=center ! queue ! videoconvert ! tee name=t t. ! x264enc bitrate=9000 pass=cbr speed-preset=ultrafast byte-stream=false key-int-max=15 threads=1 ! video/x-h264,profile=baseline ! queue ! rsink. audiotestsrc ! voaacenc ! queue ! rsink. t. ! queue ! autovideosink rtspclientsink name=rsink location=rtsp://localhost:30800/live.stream
Test results:
modified FFmpeg client -> stock server : ok
stock FFmpeg client -> modified server : ok
modified FFmpeg client -> modified server : ok
GStreamer client -> modified server : ok
Signed-off-by: Paul Orlyk <paul.orlyk@gmail.com>
---
libavformat/rtspdec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index 39fd92fb66..d6a223cbc6 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -303,7 +303,7 @@ static int rtsp_read_setup(AVFormatContext *s, char* host, char *controlurl)
rtsp_st->interleaved_min = request.transports[0].interleaved_min;
rtsp_st->interleaved_max = request.transports[0].interleaved_max;
snprintf(responseheaders, sizeof(responseheaders), "Transport: "
- "RTP/AVP/TCP;unicast;mode=receive;interleaved=%d-%d"
+ "RTP/AVP/TCP;unicast;mode=record;interleaved=%d-%d"
"\r\n", request.transports[0].interleaved_min,
request.transports[0].interleaved_max);
} else {
@@ -333,7 +333,7 @@ static int rtsp_read_setup(AVFormatContext *s, char* host, char *controlurl)
localport = ff_rtp_get_local_rtp_port(rtsp_st->rtp_handle);
snprintf(responseheaders, sizeof(responseheaders), "Transport: "
- "RTP/AVP/UDP;unicast;mode=receive;source=%s;"
+ "RTP/AVP/UDP;unicast;mode=record;source=%s;"
"client_port=%d-%d;server_port=%d-%d\r\n",
host, request.transports[0].client_port_min,
request.transports[0].client_port_max, localport,
--
2.43.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2 1/2] avformat/rtsp: Support mode field of Transport header being sent in upper case
2024-01-15 20:37 ` [FFmpeg-devel] [PATCH v2 1/2] avformat/rtsp: Support mode field of Transport header being sent in upper case Paul Orlyk
@ 2024-01-16 0:05 ` Michael Niedermayer
0 siblings, 0 replies; 11+ messages in thread
From: Michael Niedermayer @ 2024-01-16 0:05 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 506 bytes --]
On Mon, Jan 15, 2024 at 10:37:09PM +0200, Paul Orlyk wrote:
> Fixes server compatibility issues with rtspclientsink GStreamer plugin
>
> Signed-off-by: Paul Orlyk <paul.orlyk@gmail.com>
> ---
> libavformat/rtsp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
will apply
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2 2/2] avformat/rtsp: Send mode=record instead of mode=receive in Transport header
2024-01-15 20:37 ` [FFmpeg-devel] [PATCH v2 2/2] avformat/rtsp: Send mode=record instead of mode=receive in Transport header Paul Orlyk
@ 2024-01-16 0:20 ` Michael Niedermayer
0 siblings, 0 replies; 11+ messages in thread
From: Michael Niedermayer @ 2024-01-16 0:20 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 3087 bytes --]
On Mon, Jan 15, 2024 at 10:37:25PM +0200, Paul Orlyk wrote:
> Fixes server compatibility issues with rtspclientsink GStreamer plugin.
>
> > From specification:
> RFC 7826 "Real-Time Streaming Protocol Version 2.0" (https://datatracker.ietf.org/doc/html/rfc7826), section 18.54:
> mode: The mode parameter indicates the methods to be supported for
> this session. The currently defined valid value is "PLAY". If
> not provided, the default is "PLAY". The "RECORD" value was
> defined in RFC 2326; in this specification, it is unspecified
> but reserved. RECORD and other values may be specified in the
> future.
> RFC 2326 "Real Time Streaming Protocol (RTSP)" (https://datatracker.ietf.org/doc/html/rfc2326), section 12.39:
> mode:
> The mode parameter indicates the methods to be supported for
> this session. Valid values are PLAY and RECORD. If not
> provided, the default is PLAY.
>
> mode=receive was always like this, from the initial commit 'a8ad6ffa rtsp: Add listen mode'.
>
> For comparison, Wowza was used to push RTSP stream to. Both GStreamer and FFmpeg had no issues.
> Here is the capture of Wowza responding to SETUP request:
> 200 OK
> CSeq: 3
> Server: Wowza Streaming Engine 4.8.26+4 build20231212155517
> Cache-Control: no-cache
> Expires: Mon, 15 Jan 2024 19:40:31 GMT
> Transport: RTP/AVP/UDP;unicast;client_port=11640-11641;mode=record;source=172.17.0.2;server_port=6976-6977
> Date: Mon, 15 Jan 2024 19:40:31 GMT
> Session: 1401457689;timeout=60
>
> Test setup:
> Server: ffmpeg -loglevel trace -y -rtsp_flags listen -i rtsp://0.0.0.0:30800/live.stream t.mp4
> FFmpeg client: ffmpeg -re -i "Big Buck Bunny - FULL HD 30FPS.mp4" -c:v libx264 -f rtsp rtsp://127.0.0.1:30800/live.stream
> GStreamer client: gst-launch-1.0 videotestsrc is-live=true pattern=smpte ! queue ! videorate ! videoscale ! video/x-raw,width=640,height=360,framerate=60/1 ! timeoverlay font-desc="Sans, 84" halignment=center valignment=center ! queue ! videoconvert ! tee name=t t. ! x264enc bitrate=9000 pass=cbr speed-preset=ultrafast byte-stream=false key-int-max=15 threads=1 ! video/x-h264,profile=baseline ! queue ! rsink. audiotestsrc ! voaacenc ! queue ! rsink. t. ! queue ! autovideosink rtspclientsink name=rsink location=rtsp://localhost:30800/live.stream
>
> Test results:
> modified FFmpeg client -> stock server : ok
> stock FFmpeg client -> modified server : ok
> modified FFmpeg client -> modified server : ok
> GStreamer client -> modified server : ok
>
> Signed-off-by: Paul Orlyk <paul.orlyk@gmail.com>
> ---
> libavformat/rtspdec.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Thats a nice commit message
will apply
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Whats the most studid thing your enemy could do ? Blow himself up
Whats the most studid thing you could do ? Give up your rights and
freedom because your enemy blew himself up.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-01-16 0:21 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-27 13:44 [FFmpeg-devel] [PATCH] avformat/rtsp: Fix server compatibility issues with rtspclientsink GStreamer plugin Paul Orlyk
2023-12-28 19:33 ` Michael Niedermayer
2024-01-03 12:51 ` Paul Orlyk
2024-01-10 17:57 ` Paul Orlyk
2024-01-12 19:07 ` Michael Niedermayer
2024-01-12 20:46 ` Paul Orlyk
2024-01-13 18:22 ` Michael Niedermayer
2024-01-15 20:37 ` [FFmpeg-devel] [PATCH v2 1/2] avformat/rtsp: Support mode field of Transport header being sent in upper case Paul Orlyk
2024-01-16 0:05 ` Michael Niedermayer
2024-01-15 20:37 ` [FFmpeg-devel] [PATCH v2 2/2] avformat/rtsp: Send mode=record instead of mode=receive in Transport header Paul Orlyk
2024-01-16 0:20 ` Michael Niedermayer
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 https://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/ https://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