diff mbox series

[FFmpeg-devel] avformat/libsrt: Change latency option to milliseconds

Message ID ecec232b-cc81-b544-db5c-56752f1b889b@obsproject.com
State New
Headers show
Series [FFmpeg-devel] avformat/libsrt: Change latency option to milliseconds | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

pkv April 7, 2020, 6:25 p.m. UTC
Hi

new patch for latency option following the comments from N. George.

=====

Updated protocol doc for srt to specify the unit of various latency options.
Furthermore the type of the latency options is changed to 
AV_OPT_TYPE_DURATION
(following comment from N. George).

The microsecond unit has caused confusion for both FFmpeg and obs-studio 
users:
- https://github.com/Haivision/srt/issues/1223

- https://obsproject.com/mantis/view.php?id=1617

=====

Regards
From 1dd49812553f44bc5f1ed60660a2365d6a036c97 Mon Sep 17 00:00:00 2001
From: pkv <pkv@obsproject.com>
Date: Tue, 7 Apr 2020 18:08:22 +0200
Subject: [PATCH] avformat/libsrt: Document latency options unit

Updated protocol doc for srt to specify the unit of various latency options.
Furthermore the type of the latency options is changed to AV_OPT_TYPE_DURATION
(following comment from N. George).

The microsecond unit has caused confusion for both FFmpeg and obs-studio users:
- https://github.com/Haivision/srt/issues/1223

- https://obsproject.com/mantis/view.php?id=1617
---
 doc/protocols.texi   | 6 +++---
 libavformat/libsrt.c | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

Comments

Nicolas George April 7, 2020, 6:32 p.m. UTC | #1
pkv (12020-04-07):
> new patch for latency option following the comments from N. George.

Thanks.

> 
> =====
> 
> Updated protocol doc for srt to specify the unit of various latency options.
> Furthermore the type of the latency options is changed to
> AV_OPT_TYPE_DURATION
> (following comment from N. George).
> 
> The microsecond unit has caused confusion for both FFmpeg and obs-studio
> users:
> - https://github.com/Haivision/srt/issues/1223
> 
> - https://obsproject.com/mantis/view.php?id=1617
> 
> =====
> 
> Regards
> 

> From 1dd49812553f44bc5f1ed60660a2365d6a036c97 Mon Sep 17 00:00:00 2001
> From: pkv <pkv@obsproject.com>
> Date: Tue, 7 Apr 2020 18:08:22 +0200
> Subject: [PATCH] avformat/libsrt: Document latency options unit
> 
> Updated protocol doc for srt to specify the unit of various latency options.
> Furthermore the type of the latency options is changed to AV_OPT_TYPE_DURATION
> (following comment from N. George).
> 
> The microsecond unit has caused confusion for both FFmpeg and obs-studio users:
> - https://github.com/Haivision/srt/issues/1223
> 
> - https://obsproject.com/mantis/view.php?id=1617
> ---
>  doc/protocols.texi   | 6 +++---
>  libavformat/libsrt.c | 6 +++---
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/doc/protocols.texi b/doc/protocols.texi
> index e510019f2d..ebf9dec529 100644
> --- a/doc/protocols.texi
> +++ b/doc/protocols.texi
> @@ -1286,8 +1286,8 @@ IP Type of Service. Applies to sender only. Default value is 0xB8.
>  @item ipttl=@var{ttl}
>  IP Time To Live. Applies to sender only. Default value is 64.
>  
> -@item latency
> -Timestamp-based Packet Delivery Delay.

> +@item latency=@var{microseconds}

There's a = instead of a space.

> +Timestamp-based Packet Delivery Delay in microseconds.

IIRC, we already had a similar discussion. For the API, as an integer,
it's indeed microseconds, but from the user interface, durations are
expressed with units, and if the unit is omitted it's seconds.

Therefore, it would be better to say it's a duration, and link tho the
corresponding documentation:

@ref{time duration syntax,,the Time duration section in the
ffmpeg-utils(1) manual,ffmpeg-utils}

>  Used to absorb bursts of missed packet retransmissions.
>  This flag sets both @option{rcvlatency} and @option{peerlatency}
>  to the same value. Note that prior to version 1.3.0
> @@ -1389,7 +1389,7 @@ Not required on receiver (set to 0),
>  key size obtained from sender in HaiCrypt handshake.
>  Default value is 0.
>  
> -@item rcvlatency

> +@item rcvlatency@var{microseconds}

Missing space.

>  The time that should elapse since the moment when the
>  packet was sent and the moment when it's delivered to
>  the receiver application in the receiving function.
> diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
> index 2d6fc4b7e7..5c61f9e0d7 100644
> --- a/libavformat/libsrt.c
> +++ b/libavformat/libsrt.c
> @@ -118,10 +118,10 @@ static const AVOption libsrt_options[] = {
>      { "iptos",          "IP Type of Service",                                                   OFFSET(iptos),            AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, 255,       .flags = D|E },
>      { "inputbw",        "Estimated input stream rate",                                          OFFSET(inputbw),          AV_OPT_TYPE_INT64,    { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>      { "oheadbw",        "MaxBW ceiling based on % over input stream rate",                      OFFSET(oheadbw),          AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, 100,       .flags = D|E },
> -    { "latency",        "receiver delay to absorb bursts of missed packet retransmissions",     OFFSET(latency),          AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> +    { "latency",        "receiver delay to absorb bursts of missed packet retransmissions",     OFFSET(latency),          AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>      { "tsbpddelay",     "deprecated, same effect as latency option",                            OFFSET(latency),          AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> -    { "rcvlatency",     "receive latency",                                                      OFFSET(rcvlatency),       AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> -    { "peerlatency",    "peer latency",                                                         OFFSET(peerlatency),      AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> +    { "rcvlatency",     "receive latency",                                                      OFFSET(rcvlatency),       AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> +    { "peerlatency",    "peer latency",                                                         OFFSET(peerlatency),      AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>      { "tlpktdrop",      "Enable receiver pkt drop",                                             OFFSET(tlpktdrop),        AV_OPT_TYPE_BOOL,     { .i64 = -1 }, -1, 1,         .flags = D|E },
>      { "nakreport",      "Enable receiver to send periodic NAK reports",                         OFFSET(nakreport),        AV_OPT_TYPE_BOOL,     { .i64 = -1 }, -1, 1,         .flags = D|E },
>      { "connect_timeout", "Connect timeout. Caller default: 3000, rendezvous (x 10)",            OFFSET(connect_timeout),  AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },

Regards,
Lance Wang April 7, 2020, 10:33 p.m. UTC | #2
On Tue, Apr 07, 2020 at 08:25:44PM +0200, pkv wrote:
> Hi
> 
> new patch for latency option following the comments from N. George.

I recall I had submit a patchset for related option incliding latency.
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200331140808.8839-2-lance.lmwang@gmail.com/

Why I haven't change to use AV_OPT_TYPE_DURATION, for the latency can
be used in format srt://xxxx:port?latency=?, it's in unit of ms, 
in addition, AV_OPT_TYPE_DURATION is in unit of second default, it'll
break the old user.


> 
> =====
> 
> Updated protocol doc for srt to specify the unit of various latency options.
> Furthermore the type of the latency options is changed to
> AV_OPT_TYPE_DURATION
> (following comment from N. George).
> 
> The microsecond unit has caused confusion for both FFmpeg and
> obs-studio users:
> - https://github.com/Haivision/srt/issues/1223
> 
> - https://obsproject.com/mantis/view.php?id=1617
> 
> =====
> 
> Regards
> 

> From 1dd49812553f44bc5f1ed60660a2365d6a036c97 Mon Sep 17 00:00:00 2001
> From: pkv <pkv@obsproject.com>
> Date: Tue, 7 Apr 2020 18:08:22 +0200
> Subject: [PATCH] avformat/libsrt: Document latency options unit
> 
> Updated protocol doc for srt to specify the unit of various latency options.
> Furthermore the type of the latency options is changed to AV_OPT_TYPE_DURATION
> (following comment from N. George).
> 
> The microsecond unit has caused confusion for both FFmpeg and obs-studio users:
> - https://github.com/Haivision/srt/issues/1223
> 
> - https://obsproject.com/mantis/view.php?id=1617
> ---
>  doc/protocols.texi   | 6 +++---
>  libavformat/libsrt.c | 6 +++---
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/doc/protocols.texi b/doc/protocols.texi
> index e510019f2d..ebf9dec529 100644
> --- a/doc/protocols.texi
> +++ b/doc/protocols.texi
> @@ -1286,8 +1286,8 @@ IP Type of Service. Applies to sender only. Default value is 0xB8.
>  @item ipttl=@var{ttl}
>  IP Time To Live. Applies to sender only. Default value is 64.
>  
> -@item latency
> -Timestamp-based Packet Delivery Delay.
> +@item latency=@var{microseconds}
> +Timestamp-based Packet Delivery Delay in microseconds.
>  Used to absorb bursts of missed packet retransmissions.
>  This flag sets both @option{rcvlatency} and @option{peerlatency}
>  to the same value. Note that prior to version 1.3.0
> @@ -1389,7 +1389,7 @@ Not required on receiver (set to 0),
>  key size obtained from sender in HaiCrypt handshake.
>  Default value is 0.
>  
> -@item rcvlatency
> +@item rcvlatency@var{microseconds}
>  The time that should elapse since the moment when the
>  packet was sent and the moment when it's delivered to
>  the receiver application in the receiving function.
> diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
> index 2d6fc4b7e7..5c61f9e0d7 100644
> --- a/libavformat/libsrt.c
> +++ b/libavformat/libsrt.c
> @@ -118,10 +118,10 @@ static const AVOption libsrt_options[] = {
>      { "iptos",          "IP Type of Service",                                                   OFFSET(iptos),            AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, 255,       .flags = D|E },
>      { "inputbw",        "Estimated input stream rate",                                          OFFSET(inputbw),          AV_OPT_TYPE_INT64,    { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>      { "oheadbw",        "MaxBW ceiling based on % over input stream rate",                      OFFSET(oheadbw),          AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, 100,       .flags = D|E },
> -    { "latency",        "receiver delay to absorb bursts of missed packet retransmissions",     OFFSET(latency),          AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> +    { "latency",        "receiver delay to absorb bursts of missed packet retransmissions",     OFFSET(latency),          AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>      { "tsbpddelay",     "deprecated, same effect as latency option",                            OFFSET(latency),          AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> -    { "rcvlatency",     "receive latency",                                                      OFFSET(rcvlatency),       AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> -    { "peerlatency",    "peer latency",                                                         OFFSET(peerlatency),      AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> +    { "rcvlatency",     "receive latency",                                                      OFFSET(rcvlatency),       AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> +    { "peerlatency",    "peer latency",                                                         OFFSET(peerlatency),      AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>      { "tlpktdrop",      "Enable receiver pkt drop",                                             OFFSET(tlpktdrop),        AV_OPT_TYPE_BOOL,     { .i64 = -1 }, -1, 1,         .flags = D|E },
>      { "nakreport",      "Enable receiver to send periodic NAK reports",                         OFFSET(nakreport),        AV_OPT_TYPE_BOOL,     { .i64 = -1 }, -1, 1,         .flags = D|E },
>      { "connect_timeout", "Connect timeout. Caller default: 3000, rendezvous (x 10)",            OFFSET(connect_timeout),  AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> -- 
> 2.24.1.windows.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".
pkv April 8, 2020, 12:16 a.m. UTC | #3
Hi

Le 08/04/2020 à 12:33 am, Limin Wang a écrit :
> On Tue, Apr 07, 2020 at 08:25:44PM +0200, pkv wrote:
>> Hi
>>
>> new patch for latency option following the comments from N. George.
> I recall I had submit a patchset for related option incliding latency.
> https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200331140808.8839-2-lance.lmwang@gmail.com/

hadn't spotted it; why was it not merged ?


>
> Why I haven't change to use AV_OPT_TYPE_DURATION, for the latency can
> be used in format srt://xxxx:port?latency=?, it's in unit of ms,
> in addition, AV_OPT_TYPE_DURATION is in unit of second default, it'll
> break the old user.
i tested with ffmpeg.exe; the change to

AV_OPT_TYPE_DURATION

didn't seem to break anything.

The default is still set to whatever the libsrt API has set (120 ms for 
transtype=live).

Can you produce code broken by that change ?

Regards


>
>> =====
>>
>> Updated protocol doc for srt to specify the unit of various latency options.
>> Furthermore the type of the latency options is changed to
>> AV_OPT_TYPE_DURATION
>> (following comment from N. George).
>>
>> The microsecond unit has caused confusion for both FFmpeg and
>> obs-studio users:
>> - https://github.com/Haivision/srt/issues/1223
>>
>> - https://obsproject.com/mantis/view.php?id=1617
>>
>> =====
>>
>> Regards
>>
>>  From 1dd49812553f44bc5f1ed60660a2365d6a036c97 Mon Sep 17 00:00:00 2001
>> From: pkv <pkv@obsproject.com>
>> Date: Tue, 7 Apr 2020 18:08:22 +0200
>> Subject: [PATCH] avformat/libsrt: Document latency options unit
>>
>> Updated protocol doc for srt to specify the unit of various latency options.
>> Furthermore the type of the latency options is changed to AV_OPT_TYPE_DURATION
>> (following comment from N. George).
>>
>> The microsecond unit has caused confusion for both FFmpeg and obs-studio users:
>> - https://github.com/Haivision/srt/issues/1223
>>
>> - https://obsproject.com/mantis/view.php?id=1617
>> ---
>>   doc/protocols.texi   | 6 +++---
>>   libavformat/libsrt.c | 6 +++---
>>   2 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/doc/protocols.texi b/doc/protocols.texi
>> index e510019f2d..ebf9dec529 100644
>> --- a/doc/protocols.texi
>> +++ b/doc/protocols.texi
>> @@ -1286,8 +1286,8 @@ IP Type of Service. Applies to sender only. Default value is 0xB8.
>>   @item ipttl=@var{ttl}
>>   IP Time To Live. Applies to sender only. Default value is 64.
>>   
>> -@item latency
>> -Timestamp-based Packet Delivery Delay.
>> +@item latency=@var{microseconds}
>> +Timestamp-based Packet Delivery Delay in microseconds.
>>   Used to absorb bursts of missed packet retransmissions.
>>   This flag sets both @option{rcvlatency} and @option{peerlatency}
>>   to the same value. Note that prior to version 1.3.0
>> @@ -1389,7 +1389,7 @@ Not required on receiver (set to 0),
>>   key size obtained from sender in HaiCrypt handshake.
>>   Default value is 0.
>>   
>> -@item rcvlatency
>> +@item rcvlatency@var{microseconds}
>>   The time that should elapse since the moment when the
>>   packet was sent and the moment when it's delivered to
>>   the receiver application in the receiving function.
>> diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
>> index 2d6fc4b7e7..5c61f9e0d7 100644
>> --- a/libavformat/libsrt.c
>> +++ b/libavformat/libsrt.c
>> @@ -118,10 +118,10 @@ static const AVOption libsrt_options[] = {
>>       { "iptos",          "IP Type of Service",                                                   OFFSET(iptos),            AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, 255,       .flags = D|E },
>>       { "inputbw",        "Estimated input stream rate",                                          OFFSET(inputbw),          AV_OPT_TYPE_INT64,    { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>>       { "oheadbw",        "MaxBW ceiling based on % over input stream rate",                      OFFSET(oheadbw),          AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, 100,       .flags = D|E },
>> -    { "latency",        "receiver delay to absorb bursts of missed packet retransmissions",     OFFSET(latency),          AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>> +    { "latency",        "receiver delay to absorb bursts of missed packet retransmissions",     OFFSET(latency),          AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>>       { "tsbpddelay",     "deprecated, same effect as latency option",                            OFFSET(latency),          AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>> -    { "rcvlatency",     "receive latency",                                                      OFFSET(rcvlatency),       AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>> -    { "peerlatency",    "peer latency",                                                         OFFSET(peerlatency),      AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>> +    { "rcvlatency",     "receive latency",                                                      OFFSET(rcvlatency),       AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>> +    { "peerlatency",    "peer latency",                                                         OFFSET(peerlatency),      AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>>       { "tlpktdrop",      "Enable receiver pkt drop",                                             OFFSET(tlpktdrop),        AV_OPT_TYPE_BOOL,     { .i64 = -1 }, -1, 1,         .flags = D|E },
>>       { "nakreport",      "Enable receiver to send periodic NAK reports",                         OFFSET(nakreport),        AV_OPT_TYPE_BOOL,     { .i64 = -1 }, -1, 1,         .flags = D|E },
>>       { "connect_timeout", "Connect timeout. Caller default: 3000, rendezvous (x 10)",            OFFSET(connect_timeout),  AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>> -- 
>> 2.24.1.windows.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".
>
Lance Wang April 8, 2020, 1:45 a.m. UTC | #4
On Wed, Apr 08, 2020 at 02:16:23AM +0200, pkv wrote:
> Hi
> 
> Le 08/04/2020 à 12:33 am, Limin Wang a écrit :
> >On Tue, Apr 07, 2020 at 08:25:44PM +0200, pkv wrote:
> >>Hi
> >>
> >>new patch for latency option following the comments from N. George.
> >I recall I had submit a patchset for related option incliding latency.
> >https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200331140808.8839-2-lance.lmwang@gmail.com/
> 
> hadn't spotted it; why was it not merged ?
> 
> 
> >
> >Why I haven't change to use AV_OPT_TYPE_DURATION, for the latency can
> >be used in format srt://xxxx:port?latency=?, it's in unit of ms,
> >in addition, AV_OPT_TYPE_DURATION is in unit of second default, it'll
> >break the old user.
> i tested with ffmpeg.exe; the change to
> 
> AV_OPT_TYPE_DURATION
> 
> didn't seem to break anything.
> 
> The default is still set to whatever the libsrt API has set (120 ms
> for transtype=live).
> 
> Can you produce code broken by that change ?

What's your command line? 
I recall If use AV_OPT_TYPE_DURATION for option, the default is in unit of second if your
don't add suffix of ms, us. However the old is us, so it'll cause old user
setting broken.


> 
> Regards
> 
> 
> >
> >>=====
> >>
> >>Updated protocol doc for srt to specify the unit of various latency options.
> >>Furthermore the type of the latency options is changed to
> >>AV_OPT_TYPE_DURATION
> >>(following comment from N. George).
> >>
> >>The microsecond unit has caused confusion for both FFmpeg and
> >>obs-studio users:
> >>- https://github.com/Haivision/srt/issues/1223
> >>
> >>- https://obsproject.com/mantis/view.php?id=1617
> >>
> >>=====
> >>
> >>Regards
> >>
> >> From 1dd49812553f44bc5f1ed60660a2365d6a036c97 Mon Sep 17 00:00:00 2001
> >>From: pkv <pkv@obsproject.com>
> >>Date: Tue, 7 Apr 2020 18:08:22 +0200
> >>Subject: [PATCH] avformat/libsrt: Document latency options unit
> >>
> >>Updated protocol doc for srt to specify the unit of various latency options.
> >>Furthermore the type of the latency options is changed to AV_OPT_TYPE_DURATION
> >>(following comment from N. George).
> >>
> >>The microsecond unit has caused confusion for both FFmpeg and obs-studio users:
> >>- https://github.com/Haivision/srt/issues/1223
> >>
> >>- https://obsproject.com/mantis/view.php?id=1617
> >>---
> >>  doc/protocols.texi   | 6 +++---
> >>  libavformat/libsrt.c | 6 +++---
> >>  2 files changed, 6 insertions(+), 6 deletions(-)
> >>
> >>diff --git a/doc/protocols.texi b/doc/protocols.texi
> >>index e510019f2d..ebf9dec529 100644
> >>--- a/doc/protocols.texi
> >>+++ b/doc/protocols.texi
> >>@@ -1286,8 +1286,8 @@ IP Type of Service. Applies to sender only. Default value is 0xB8.
> >>  @item ipttl=@var{ttl}
> >>  IP Time To Live. Applies to sender only. Default value is 64.
> >>-@item latency
> >>-Timestamp-based Packet Delivery Delay.
> >>+@item latency=@var{microseconds}
> >>+Timestamp-based Packet Delivery Delay in microseconds.
> >>  Used to absorb bursts of missed packet retransmissions.
> >>  This flag sets both @option{rcvlatency} and @option{peerlatency}
> >>  to the same value. Note that prior to version 1.3.0
> >>@@ -1389,7 +1389,7 @@ Not required on receiver (set to 0),
> >>  key size obtained from sender in HaiCrypt handshake.
> >>  Default value is 0.
> >>-@item rcvlatency
> >>+@item rcvlatency@var{microseconds}
> >>  The time that should elapse since the moment when the
> >>  packet was sent and the moment when it's delivered to
> >>  the receiver application in the receiving function.
> >>diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
> >>index 2d6fc4b7e7..5c61f9e0d7 100644
> >>--- a/libavformat/libsrt.c
> >>+++ b/libavformat/libsrt.c
> >>@@ -118,10 +118,10 @@ static const AVOption libsrt_options[] = {
> >>      { "iptos",          "IP Type of Service",                                                   OFFSET(iptos),            AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, 255,       .flags = D|E },
> >>      { "inputbw",        "Estimated input stream rate",                                          OFFSET(inputbw),          AV_OPT_TYPE_INT64,    { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> >>      { "oheadbw",        "MaxBW ceiling based on % over input stream rate",                      OFFSET(oheadbw),          AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, 100,       .flags = D|E },
> >>-    { "latency",        "receiver delay to absorb bursts of missed packet retransmissions",     OFFSET(latency),          AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> >>+    { "latency",        "receiver delay to absorb bursts of missed packet retransmissions",     OFFSET(latency),          AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> >>      { "tsbpddelay",     "deprecated, same effect as latency option",                            OFFSET(latency),          AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> >>-    { "rcvlatency",     "receive latency",                                                      OFFSET(rcvlatency),       AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> >>-    { "peerlatency",    "peer latency",                                                         OFFSET(peerlatency),      AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> >>+    { "rcvlatency",     "receive latency",                                                      OFFSET(rcvlatency),       AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> >>+    { "peerlatency",    "peer latency",                                                         OFFSET(peerlatency),      AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> >>      { "tlpktdrop",      "Enable receiver pkt drop",                                             OFFSET(tlpktdrop),        AV_OPT_TYPE_BOOL,     { .i64 = -1 }, -1, 1,         .flags = D|E },
> >>      { "nakreport",      "Enable receiver to send periodic NAK reports",                         OFFSET(nakreport),        AV_OPT_TYPE_BOOL,     { .i64 = -1 }, -1, 1,         .flags = D|E },
> >>      { "connect_timeout", "Connect timeout. Caller default: 3000, rendezvous (x 10)",            OFFSET(connect_timeout),  AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> >>-- 
> >>2.24.1.windows.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".
> >
> _______________________________________________
> 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".
Moritz Barsnick April 8, 2020, 6:31 a.m. UTC | #5
On Wed, Apr 08, 2020 at 09:45:57 +0800, Limin Wang wrote:
> On Wed, Apr 08, 2020 at 02:16:23AM +0200, pkv wrote:
> > Can you produce code broken by that change ?
>
> What's your command line?
> I recall If use AV_OPT_TYPE_DURATION for option, the default is in unit of second if your
> don't add suffix of ms, us. However the old is us, so it'll cause old user
> setting broken.

And if it changes behavior, that would at least imply you should bump
MICRO, especially since external projects are depending on the
behavior.

Moritz
Hendrik Leppkes April 8, 2020, 7:07 a.m. UTC | #6
On Wed, Apr 8, 2020 at 3:46 AM Limin Wang <lance.lmwang@gmail.com> wrote:
>
> On Wed, Apr 08, 2020 at 02:16:23AM +0200, pkv wrote:
> > Hi
> >
> > Le 08/04/2020 à 12:33 am, Limin Wang a écrit :
> > >On Tue, Apr 07, 2020 at 08:25:44PM +0200, pkv wrote:
> > >>Hi
> > >>
> > >>new patch for latency option following the comments from N. George.
> > >I recall I had submit a patchset for related option incliding latency.
> > >https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200331140808.8839-2-lance.lmwang@gmail.com/
> >
> > hadn't spotted it; why was it not merged ?
> >
> >
> > >
> > >Why I haven't change to use AV_OPT_TYPE_DURATION, for the latency can
> > >be used in format srt://xxxx:port?latency=?, it's in unit of ms,
> > >in addition, AV_OPT_TYPE_DURATION is in unit of second default, it'll
> > >break the old user.
> > i tested with ffmpeg.exe; the change to
> >
> > AV_OPT_TYPE_DURATION
> >
> > didn't seem to break anything.
> >
> > The default is still set to whatever the libsrt API has set (120 ms
> > for transtype=live).
> >
> > Can you produce code broken by that change ?
>
> What's your command line?
> I recall If use AV_OPT_TYPE_DURATION for option, the default is in unit of second if your
> don't add suffix of ms, us. However the old is us, so it'll cause old user
> setting broken.
>

Any change to the options, including the original patch, would require
users to adjust, would it not?
If we require them to adjust anyway, then using AV_OPT_TYPE_DURATION
is the proper choice.

- Hendrik
pkv April 8, 2020, 7:34 a.m. UTC | #7
Le 08/04/2020 à 3:45 am, Limin Wang a écrit :
> On Wed, Apr 08, 2020 at 02:16:23AM +0200, pkv wrote:
>> Hi
>>
>> Le 08/04/2020 à 12:33 am, Limin Wang a écrit :
>>> On Tue, Apr 07, 2020 at 08:25:44PM +0200, pkv wrote:
>>>> Hi
>>>>
>>>> new patch for latency option following the comments from N. George.
>>> I recall I had submit a patchset for related option incliding latency.
>>> https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200331140808.8839-2-lance.lmwang@gmail.com/
>> hadn't spotted it; why was it not merged ?
>>
>>
>>> Why I haven't change to use AV_OPT_TYPE_DURATION, for the latency can
>>> be used in format srt://xxxx:port?latency=?, it's in unit of ms,
>>> in addition, AV_OPT_TYPE_DURATION is in unit of second default, it'll
>>> break the old user.
>> i tested with ffmpeg.exe; the change to
>>
>> AV_OPT_TYPE_DURATION
>>
>> didn't seem to break anything.
>>
>> The default is still set to whatever the libsrt API has set (120 ms
>> for transtype=live).
>>
>> Can you produce code broken by that change ?
> What's your command line?
> I recall If use AV_OPT_TYPE_DURATION for option, the default is in unit of second if your
> don't add suffix of ms, us. However the old is us, so it'll cause old user
> setting broken.
>
Ok I get your point.

here are the commands I tested with:

ffmpeg.exe -re -i source.mp4 -c copy -f mpegts srt:://dest:port

and

ffmpeg.exe -re -i source.mp4 -c copy -f mpegts 
srt:://dest:port?latency=400000

These two don't break anything.

But indeed

ffmpeg.exe -re -i source.mp4 -c copy -latency=400000 -f mpegts 
srt:://dest:port

is breaking stuff.

I'll revert the change suggested by N. George in that case.

Thanks.

Regards



>> Regards
>>
>>
>>>> =====
>>>>
>>>> Updated protocol doc for srt to specify the unit of various latency options.
>>>> Furthermore the type of the latency options is changed to
>>>> AV_OPT_TYPE_DURATION
>>>> (following comment from N. George).
>>>>
>>>> The microsecond unit has caused confusion for both FFmpeg and
>>>> obs-studio users:
>>>> - https://github.com/Haivision/srt/issues/1223
>>>>
>>>> - https://obsproject.com/mantis/view.php?id=1617
>>>>
>>>> =====
>>>>
>>>> Regards
>>>>
>>>>  From 1dd49812553f44bc5f1ed60660a2365d6a036c97 Mon Sep 17 00:00:00 2001
>>>> From: pkv <pkv@obsproject.com>
>>>> Date: Tue, 7 Apr 2020 18:08:22 +0200
>>>> Subject: [PATCH] avformat/libsrt: Document latency options unit
>>>>
>>>> Updated protocol doc for srt to specify the unit of various latency options.
>>>> Furthermore the type of the latency options is changed to AV_OPT_TYPE_DURATION
>>>> (following comment from N. George).
>>>>
>>>> The microsecond unit has caused confusion for both FFmpeg and obs-studio users:
>>>> - https://github.com/Haivision/srt/issues/1223
>>>>
>>>> - https://obsproject.com/mantis/view.php?id=1617
>>>> ---
>>>>   doc/protocols.texi   | 6 +++---
>>>>   libavformat/libsrt.c | 6 +++---
>>>>   2 files changed, 6 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/doc/protocols.texi b/doc/protocols.texi
>>>> index e510019f2d..ebf9dec529 100644
>>>> --- a/doc/protocols.texi
>>>> +++ b/doc/protocols.texi
>>>> @@ -1286,8 +1286,8 @@ IP Type of Service. Applies to sender only. Default value is 0xB8.
>>>>   @item ipttl=@var{ttl}
>>>>   IP Time To Live. Applies to sender only. Default value is 64.
>>>> -@item latency
>>>> -Timestamp-based Packet Delivery Delay.
>>>> +@item latency=@var{microseconds}
>>>> +Timestamp-based Packet Delivery Delay in microseconds.
>>>>   Used to absorb bursts of missed packet retransmissions.
>>>>   This flag sets both @option{rcvlatency} and @option{peerlatency}
>>>>   to the same value. Note that prior to version 1.3.0
>>>> @@ -1389,7 +1389,7 @@ Not required on receiver (set to 0),
>>>>   key size obtained from sender in HaiCrypt handshake.
>>>>   Default value is 0.
>>>> -@item rcvlatency
>>>> +@item rcvlatency@var{microseconds}
>>>>   The time that should elapse since the moment when the
>>>>   packet was sent and the moment when it's delivered to
>>>>   the receiver application in the receiving function.
>>>> diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
>>>> index 2d6fc4b7e7..5c61f9e0d7 100644
>>>> --- a/libavformat/libsrt.c
>>>> +++ b/libavformat/libsrt.c
>>>> @@ -118,10 +118,10 @@ static const AVOption libsrt_options[] = {
>>>>       { "iptos",          "IP Type of Service",                                                   OFFSET(iptos),            AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, 255,       .flags = D|E },
>>>>       { "inputbw",        "Estimated input stream rate",                                          OFFSET(inputbw),          AV_OPT_TYPE_INT64,    { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>>>>       { "oheadbw",        "MaxBW ceiling based on % over input stream rate",                      OFFSET(oheadbw),          AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, 100,       .flags = D|E },
>>>> -    { "latency",        "receiver delay to absorb bursts of missed packet retransmissions",     OFFSET(latency),          AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>>>> +    { "latency",        "receiver delay to absorb bursts of missed packet retransmissions",     OFFSET(latency),          AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>>>>       { "tsbpddelay",     "deprecated, same effect as latency option",                            OFFSET(latency),          AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>>>> -    { "rcvlatency",     "receive latency",                                                      OFFSET(rcvlatency),       AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>>>> -    { "peerlatency",    "peer latency",                                                         OFFSET(peerlatency),      AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>>>> +    { "rcvlatency",     "receive latency",                                                      OFFSET(rcvlatency),       AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>>>> +    { "peerlatency",    "peer latency",                                                         OFFSET(peerlatency),      AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>>>>       { "tlpktdrop",      "Enable receiver pkt drop",                                             OFFSET(tlpktdrop),        AV_OPT_TYPE_BOOL,     { .i64 = -1 }, -1, 1,         .flags = D|E },
>>>>       { "nakreport",      "Enable receiver to send periodic NAK reports",                         OFFSET(nakreport),        AV_OPT_TYPE_BOOL,     { .i64 = -1 }, -1, 1,         .flags = D|E },
>>>>       { "connect_timeout", "Connect timeout. Caller default: 3000, rendezvous (x 10)",            OFFSET(connect_timeout),  AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
>>>> -- 
>>>> 2.24.1.windows.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".
>> _______________________________________________
>> 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".
Jack Waller April 8, 2020, 7:45 a.m. UTC | #8
On Wed, Apr 8, 2020 at 3:34 PM pkv <pkv@obsproject.com> wrote:

>
> Le 08/04/2020 à 3:45 am, Limin Wang a écrit :
> > On Wed, Apr 08, 2020 at 02:16:23AM +0200, pkv wrote:
> >> Hi
> >>
> >> Le 08/04/2020 à 12:33 am, Limin Wang a écrit :
> >>> On Tue, Apr 07, 2020 at 08:25:44PM +0200, pkv wrote:
> >>>> Hi
> >>>>
> >>>> new patch for latency option following the comments from N. George.
> >>> I recall I had submit a patchset for related option incliding latency.
> >>>
> https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200331140808.8839-2-lance.lmwang@gmail.com/
> >> hadn't spotted it; why was it not merged ?
> >>
> >>
> >>> Why I haven't change to use AV_OPT_TYPE_DURATION, for the latency can
> >>> be used in format srt://xxxx:port?latency=?, it's in unit of ms,
> >>> in addition, AV_OPT_TYPE_DURATION is in unit of second default, it'll
> >>> break the old user.
> >> i tested with ffmpeg.exe; the change to
> >>
> >> AV_OPT_TYPE_DURATION
> >>
> >> didn't seem to break anything.
> >>
> >> The default is still set to whatever the libsrt API has set (120 ms
> >> for transtype=live).
> >>
> >> Can you produce code broken by that change ?
> > What's your command line?
> > I recall If use AV_OPT_TYPE_DURATION for option, the default is in unit
> of second if your
> > don't add suffix of ms, us. However the old is us, so it'll cause old
> user
> > setting broken.
> >
> Ok I get your point.
>
> here are the commands I tested with:
>
> ffmpeg.exe -re -i source.mp4 -c copy -f mpegts srt:://dest:port
>
> and
>
> ffmpeg.exe -re -i source.mp4 -c copy -f mpegts
> srt:://dest:port?latency=400000
>
> These two don't break anything.
>
> But indeed
>
> ffmpeg.exe -re -i source.mp4 -c copy -latency=400000 -f mpegts
> srt:://dest:port
>
> is breaking stuff.
>
> I'll revert the change suggested by N. George in that case.
>

DO NOT CHANGE,

Microsecond is better than millisecond. it's compatible with other ffmpeg
options

The fault is srt's implementation, not ffmpeg's
Lance Wang April 8, 2020, 7:57 a.m. UTC | #9
On Wed, Apr 08, 2020 at 09:34:45AM +0200, pkv wrote:
> 
> Le 08/04/2020 à 3:45 am, Limin Wang a écrit :
> >On Wed, Apr 08, 2020 at 02:16:23AM +0200, pkv wrote:
> >>Hi
> >>
> >>Le 08/04/2020 à 12:33 am, Limin Wang a écrit :
> >>>On Tue, Apr 07, 2020 at 08:25:44PM +0200, pkv wrote:
> >>>>Hi
> >>>>
> >>>>new patch for latency option following the comments from N. George.
> >>>I recall I had submit a patchset for related option incliding latency.
> >>>https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200331140808.8839-2-lance.lmwang@gmail.com/
> >>hadn't spotted it; why was it not merged ?
> >>
> >>
> >>>Why I haven't change to use AV_OPT_TYPE_DURATION, for the latency can
> >>>be used in format srt://xxxx:port?latency=?, it's in unit of ms,
> >>>in addition, AV_OPT_TYPE_DURATION is in unit of second default, it'll
> >>>break the old user.
> >>i tested with ffmpeg.exe; the change to
> >>
> >>AV_OPT_TYPE_DURATION
> >>
> >>didn't seem to break anything.
> >>
> >>The default is still set to whatever the libsrt API has set (120 ms
> >>for transtype=live).
> >>
> >>Can you produce code broken by that change ?
> >What's your command line?
> >I recall If use AV_OPT_TYPE_DURATION for option, the default is in unit of second if your
> >don't add suffix of ms, us. However the old is us, so it'll cause old user
> >setting broken.
> >
> Ok I get your point.
> 
> here are the commands I tested with:
> 
> ffmpeg.exe -re -i source.mp4 -c copy -f mpegts srt:://dest:port
> 
> and
> 
> ffmpeg.exe -re -i source.mp4 -c copy -f mpegts
> srt:://dest:port?latency=400000
> 
> These two don't break anything.
> 
> But indeed
> 
> ffmpeg.exe -re -i source.mp4 -c copy -latency=400000 -f mpegts
> srt:://dest:port
> 
> is breaking stuff.
> 
> I'll revert the change suggested by N. George in that case.

I have ping for my old patchset for review, it change all the time related option document


> 
> Thanks.
> 
> Regards
> 
> 
> 
> >>Regards
> >>
> >>
> >>>>=====
> >>>>
> >>>>Updated protocol doc for srt to specify the unit of various latency options.
> >>>>Furthermore the type of the latency options is changed to
> >>>>AV_OPT_TYPE_DURATION
> >>>>(following comment from N. George).
> >>>>
> >>>>The microsecond unit has caused confusion for both FFmpeg and
> >>>>obs-studio users:
> >>>>- https://github.com/Haivision/srt/issues/1223
> >>>>
> >>>>- https://obsproject.com/mantis/view.php?id=1617
> >>>>
> >>>>=====
> >>>>
> >>>>Regards
> >>>>
> >>>> From 1dd49812553f44bc5f1ed60660a2365d6a036c97 Mon Sep 17 00:00:00 2001
> >>>>From: pkv <pkv@obsproject.com>
> >>>>Date: Tue, 7 Apr 2020 18:08:22 +0200
> >>>>Subject: [PATCH] avformat/libsrt: Document latency options unit
> >>>>
> >>>>Updated protocol doc for srt to specify the unit of various latency options.
> >>>>Furthermore the type of the latency options is changed to AV_OPT_TYPE_DURATION
> >>>>(following comment from N. George).
> >>>>
> >>>>The microsecond unit has caused confusion for both FFmpeg and obs-studio users:
> >>>>- https://github.com/Haivision/srt/issues/1223
> >>>>
> >>>>- https://obsproject.com/mantis/view.php?id=1617
> >>>>---
> >>>>  doc/protocols.texi   | 6 +++---
> >>>>  libavformat/libsrt.c | 6 +++---
> >>>>  2 files changed, 6 insertions(+), 6 deletions(-)
> >>>>
> >>>>diff --git a/doc/protocols.texi b/doc/protocols.texi
> >>>>index e510019f2d..ebf9dec529 100644
> >>>>--- a/doc/protocols.texi
> >>>>+++ b/doc/protocols.texi
> >>>>@@ -1286,8 +1286,8 @@ IP Type of Service. Applies to sender only. Default value is 0xB8.
> >>>>  @item ipttl=@var{ttl}
> >>>>  IP Time To Live. Applies to sender only. Default value is 64.
> >>>>-@item latency
> >>>>-Timestamp-based Packet Delivery Delay.
> >>>>+@item latency=@var{microseconds}
> >>>>+Timestamp-based Packet Delivery Delay in microseconds.
> >>>>  Used to absorb bursts of missed packet retransmissions.
> >>>>  This flag sets both @option{rcvlatency} and @option{peerlatency}
> >>>>  to the same value. Note that prior to version 1.3.0
> >>>>@@ -1389,7 +1389,7 @@ Not required on receiver (set to 0),
> >>>>  key size obtained from sender in HaiCrypt handshake.
> >>>>  Default value is 0.
> >>>>-@item rcvlatency
> >>>>+@item rcvlatency@var{microseconds}
> >>>>  The time that should elapse since the moment when the
> >>>>  packet was sent and the moment when it's delivered to
> >>>>  the receiver application in the receiving function.
> >>>>diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
> >>>>index 2d6fc4b7e7..5c61f9e0d7 100644
> >>>>--- a/libavformat/libsrt.c
> >>>>+++ b/libavformat/libsrt.c
> >>>>@@ -118,10 +118,10 @@ static const AVOption libsrt_options[] = {
> >>>>      { "iptos",          "IP Type of Service",                                                   OFFSET(iptos),            AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, 255,       .flags = D|E },
> >>>>      { "inputbw",        "Estimated input stream rate",                                          OFFSET(inputbw),          AV_OPT_TYPE_INT64,    { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> >>>>      { "oheadbw",        "MaxBW ceiling based on % over input stream rate",                      OFFSET(oheadbw),          AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, 100,       .flags = D|E },
> >>>>-    { "latency",        "receiver delay to absorb bursts of missed packet retransmissions",     OFFSET(latency),          AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> >>>>+    { "latency",        "receiver delay to absorb bursts of missed packet retransmissions",     OFFSET(latency),          AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> >>>>      { "tsbpddelay",     "deprecated, same effect as latency option",                            OFFSET(latency),          AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> >>>>-    { "rcvlatency",     "receive latency",                                                      OFFSET(rcvlatency),       AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> >>>>-    { "peerlatency",    "peer latency",                                                         OFFSET(peerlatency),      AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> >>>>+    { "rcvlatency",     "receive latency",                                                      OFFSET(rcvlatency),       AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> >>>>+    { "peerlatency",    "peer latency",                                                         OFFSET(peerlatency),      AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> >>>>      { "tlpktdrop",      "Enable receiver pkt drop",                                             OFFSET(tlpktdrop),        AV_OPT_TYPE_BOOL,     { .i64 = -1 }, -1, 1,         .flags = D|E },
> >>>>      { "nakreport",      "Enable receiver to send periodic NAK reports",                         OFFSET(nakreport),        AV_OPT_TYPE_BOOL,     { .i64 = -1 }, -1, 1,         .flags = D|E },
> >>>>      { "connect_timeout", "Connect timeout. Caller default: 3000, rendezvous (x 10)",            OFFSET(connect_timeout),  AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
> >>>>-- 
> >>>>2.24.1.windows.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".
> >>_______________________________________________
> >>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".
> _______________________________________________
> 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".
diff mbox series

Patch

diff --git a/doc/protocols.texi b/doc/protocols.texi
index e510019f2d..ebf9dec529 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -1286,8 +1286,8 @@  IP Type of Service. Applies to sender only. Default value is 0xB8.
 @item ipttl=@var{ttl}
 IP Time To Live. Applies to sender only. Default value is 64.
 
-@item latency
-Timestamp-based Packet Delivery Delay.
+@item latency=@var{microseconds}
+Timestamp-based Packet Delivery Delay in microseconds.
 Used to absorb bursts of missed packet retransmissions.
 This flag sets both @option{rcvlatency} and @option{peerlatency}
 to the same value. Note that prior to version 1.3.0
@@ -1389,7 +1389,7 @@  Not required on receiver (set to 0),
 key size obtained from sender in HaiCrypt handshake.
 Default value is 0.
 
-@item rcvlatency
+@item rcvlatency@var{microseconds}
 The time that should elapse since the moment when the
 packet was sent and the moment when it's delivered to
 the receiver application in the receiving function.
diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
index 2d6fc4b7e7..5c61f9e0d7 100644
--- a/libavformat/libsrt.c
+++ b/libavformat/libsrt.c
@@ -118,10 +118,10 @@  static const AVOption libsrt_options[] = {
     { "iptos",          "IP Type of Service",                                                   OFFSET(iptos),            AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, 255,       .flags = D|E },
     { "inputbw",        "Estimated input stream rate",                                          OFFSET(inputbw),          AV_OPT_TYPE_INT64,    { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
     { "oheadbw",        "MaxBW ceiling based on % over input stream rate",                      OFFSET(oheadbw),          AV_OPT_TYPE_INT,      { .i64 = -1 }, -1, 100,       .flags = D|E },
-    { "latency",        "receiver delay to absorb bursts of missed packet retransmissions",     OFFSET(latency),          AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
+    { "latency",        "receiver delay to absorb bursts of missed packet retransmissions",     OFFSET(latency),          AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
     { "tsbpddelay",     "deprecated, same effect as latency option",                            OFFSET(latency),          AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
-    { "rcvlatency",     "receive latency",                                                      OFFSET(rcvlatency),       AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
-    { "peerlatency",    "peer latency",                                                         OFFSET(peerlatency),      AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
+    { "rcvlatency",     "receive latency",                                                      OFFSET(rcvlatency),       AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
+    { "peerlatency",    "peer latency",                                                         OFFSET(peerlatency),      AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },
     { "tlpktdrop",      "Enable receiver pkt drop",                                             OFFSET(tlpktdrop),        AV_OPT_TYPE_BOOL,     { .i64 = -1 }, -1, 1,         .flags = D|E },
     { "nakreport",      "Enable receiver to send periodic NAK reports",                         OFFSET(nakreport),        AV_OPT_TYPE_BOOL,     { .i64 = -1 }, -1, 1,         .flags = D|E },
     { "connect_timeout", "Connect timeout. Caller default: 3000, rendezvous (x 10)",            OFFSET(connect_timeout),  AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, .flags = D|E },