diff mbox series

[FFmpeg-devel,8/6] doc/protocols: Fill in missing HTTP options

Message ID 20240416135555.111773-2-derek.buitenhuis@gmail.com
State New
Headers show
Series HTTP rate limiting and retry improvements | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Derek Buitenhuis April 16, 2024, 1:55 p.m. UTC
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
---
 doc/protocols.texi | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

Comments

Stefano Sabatini April 16, 2024, 5:13 p.m. UTC | #1
On date Tuesday 2024-04-16 14:55:55 +0100, Derek Buitenhuis wrote:
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
> ---
>  doc/protocols.texi | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
> 
> diff --git a/doc/protocols.texi b/doc/protocols.texi
> index 5ce1ddc8f4..60c6d831dd 100644
> --- a/doc/protocols.texi
> +++ b/doc/protocols.texi
> @@ -492,6 +492,10 @@ contains the last non-empty metadata packet sent by the server. It should be
>  polled in regular intervals by applications interested in mid-stream metadata
>  updates.
>  
> +@item metadata
> +An exported dictionary containing Icecast metadata from the bitstream, if present.
> +Only useful with the C API.

Probably best to use impersonal verbal mode:
Set an exported ...

> +
>  @item auth_type
>  
>  Set HTTP authentication type. No option for Digest, since this method requires
> @@ -519,6 +523,10 @@ Send an Expect: 100-continue header for POST. If set to 1 it will send, if set
>  to 0 it won't, if set to -1 it will try to send if it is applicable. Default
>  value is -1.
>  

> +@item location
> +An exported dictionary containing the content location. Only useful with the C
> +API.

Ditto

> +
>  @item offset
>  Set initial byte offset.
>  
> @@ -535,6 +543,9 @@ be given a Bad Request response.
>  When unset the HTTP method is not checked for now. This will be replaced by
>  autodetection in the future.
>  
> +@item reconnect
> +Reconnect automatically when disconnected before EOF is hit.
> +
>  @item reconnect_at_eof
>  If set then eof is treated like an error and causes reconnection, this is useful
>  for live / endless streams.
> @@ -552,6 +563,14 @@ If set then even streamed/non seekable streams will be reconnected on errors.
>  @item reconnect_delay_max
>  Sets the maximum delay in seconds after which to give up reconnecting
>  

> +@item reconnect_max_retries
> +Sets the maximum number of times to retry a connection. Default unset.

Set the ...

> +
> +@item respect_retry_after
> +If enabled, and a Retry-After header is encountered, its requested reconnection
> +delay will be honored, rather than using exponential backoff. Useful for 429 and
> +503 errors. Default enabled.
> +
>  @item listen
>  If set to 1 enables experimental HTTP server. This can be used to send data when
>  used as an output option, or read data from a client with HTTP POST when used as
> @@ -578,6 +597,17 @@ ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://@var{server}:@var{p
>  wget --post-file=somefile.ogg http://@var{server}:@var{port}
>  @end example
>  

> +@item resource
> +The resource requested by a client, when the experimental HTTP server is in use.

Set the ...

also this might be more explicit (what is a resource in this context?)

> +
> +@item reply_code
> +The HTTP code returned to the client, when the experimental HTTP server is in use.
> +
> +@item short_seek_size
> +The threshold, in bytes, for when a readahead should be prefered over a seek and
> +new HTTP request. This is useful, for example, to make sure the same connection
> +is used for reading large video packets with small audio packets in between.

Set the ...
for consistency reasons

[...]

Should be good otherwise, thanks.
Derek Buitenhuis April 22, 2024, 2:26 p.m. UTC | #2
On 4/16/2024 6:13 PM, Stefano Sabatini wrote:
>> +@item metadata
>> +An exported dictionary containing Icecast metadata from the bitstream, if present.
>> +Only useful with the C API.
> 
> Probably best to use impersonal verbal mode:
> Set an exported ...

This is not quite right. This is not a user-settable option, but exported data from http.c
to be read by the user.

>> +@item location
>> +An exported dictionary containing the content location. Only useful with the C
>> +API.
> 
> Ditto

Same comment as above.


>> +@item reconnect_max_retries
>> +Sets the maximum number of times to retry a connection. Default unset.
> 
> Set the ...

Done.

>> +@item resource
>> +The resource requested by a client, when the experimental HTTP server is in use.
> 
> Set the ...

It is an export, as noted in a few of the above options, and not user-settable.

> also this might be more explicit (what is a resource in this context?)

Resource is a standard HTTP term: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Identifying_resources_on_the_Web

>> +@item short_seek_size
>> +The threshold, in bytes, for when a readahead should be prefered over a seek and
>> +new HTTP request. This is useful, for example, to make sure the same connection
>> +is used for reading large video packets with small audio packets in between.
> 
> Set the ...
> for consistency reasons

Done.

v2 patch set sent: https://ffmpeg.org//pipermail/ffmpeg-devel/2024-April/326065.html

- Derek
Stefano Sabatini April 22, 2024, 2:58 p.m. UTC | #3
On date Monday 2024-04-22 15:26:24 +0100, Derek Buitenhuis wrote:
> On 4/16/2024 6:13 PM, Stefano Sabatini wrote:
> >> +@item metadata
> >> +An exported dictionary containing Icecast metadata from the bitstream, if present.
> >> +Only useful with the C API.
> > 

> > Probably best to use impersonal verbal mode:
> > Set an exported ...
> 
> This is not quite right. This is not a user-settable option, but exported data from http.c
> to be read by the user.

Correct, so this is "abusing" AVOption to export a property.

Possibly this might be changed to:
@item metadata (@emph{read only})
Contain a dictionary with Icecast metadata from the bitstream, if present.
...

[...]

I'm fine with it either way, thanks.
diff mbox series

Patch

diff --git a/doc/protocols.texi b/doc/protocols.texi
index 5ce1ddc8f4..60c6d831dd 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -492,6 +492,10 @@  contains the last non-empty metadata packet sent by the server. It should be
 polled in regular intervals by applications interested in mid-stream metadata
 updates.
 
+@item metadata
+An exported dictionary containing Icecast metadata from the bitstream, if present.
+Only useful with the C API.
+
 @item auth_type
 
 Set HTTP authentication type. No option for Digest, since this method requires
@@ -519,6 +523,10 @@  Send an Expect: 100-continue header for POST. If set to 1 it will send, if set
 to 0 it won't, if set to -1 it will try to send if it is applicable. Default
 value is -1.
 
+@item location
+An exported dictionary containing the content location. Only useful with the C
+API.
+
 @item offset
 Set initial byte offset.
 
@@ -535,6 +543,9 @@  be given a Bad Request response.
 When unset the HTTP method is not checked for now. This will be replaced by
 autodetection in the future.
 
+@item reconnect
+Reconnect automatically when disconnected before EOF is hit.
+
 @item reconnect_at_eof
 If set then eof is treated like an error and causes reconnection, this is useful
 for live / endless streams.
@@ -552,6 +563,14 @@  If set then even streamed/non seekable streams will be reconnected on errors.
 @item reconnect_delay_max
 Sets the maximum delay in seconds after which to give up reconnecting
 
+@item reconnect_max_retries
+Sets the maximum number of times to retry a connection. Default unset.
+
+@item respect_retry_after
+If enabled, and a Retry-After header is encountered, its requested reconnection
+delay will be honored, rather than using exponential backoff. Useful for 429 and
+503 errors. Default enabled.
+
 @item listen
 If set to 1 enables experimental HTTP server. This can be used to send data when
 used as an output option, or read data from a client with HTTP POST when used as
@@ -578,6 +597,17 @@  ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://@var{server}:@var{p
 wget --post-file=somefile.ogg http://@var{server}:@var{port}
 @end example
 
+@item resource
+The resource requested by a client, when the experimental HTTP server is in use.
+
+@item reply_code
+The HTTP code returned to the client, when the experimental HTTP server is in use.
+
+@item short_seek_size
+The threshold, in bytes, for when a readahead should be prefered over a seek and
+new HTTP request. This is useful, for example, to make sure the same connection
+is used for reading large video packets with small audio packets in between.
+
 @end table
 
 @subsection HTTP Cookies