Commit Graph

247 Commits

Author SHA1 Message Date
Derek Buitenhuis 2d5fa816fb avformat/http: Add support for Retry-After header
429 and 503 codes can, and often do (e.g. all Google Cloud
Storage URLs can), return a Retry-After header with the error,
indicating how long to wait, asd either a date, or in seconds,
before retrying again. If it is not respected by, for example,
using our default backoff stratetgy instead, chances of success
are very unlikely.

Some references:
    * https://datatracker.ietf.org/doc/html/rfc6585
    * https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.3

This adds an AVOption to respect that header.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 15:21:25 +01:00
Derek Buitenhuis 1f8e5b6d95 doc/protocols: Fill in missing HTTP options
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 14:21:25 +01:00
Derek Buitenhuis 5d568b16a0 doc/protocols: Re-order HTTP options to match http.c order
This makes the list easier to maintain.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2024-04-25 14:20:28 +01:00
Steven Liu 637c761be1 avformat/rtmpproto: support enhanced rtmp
add option named rtmp_enhanced_codec,
it would support hvc1,av01,vp09 now,
the fourcc is using Array of strings.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2023-09-05 09:14:18 +08:00
jackarain 4d216654ca libavformat/tcp: add local_addr/local_port for network option
Signed-off-by: jackarain <jack.wgm@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2023-03-30 12:09:49 +02:00
Zhao Zhili 6e7c006e40 avformat/file: add fd protocol
Unlike the pipe protocol, fd protocol has seek support if it
corresponding to a regular file.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Zhao Zhili 49b8f043ca avformat/file: add fd option for pipe
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Derek Buitenhuis 5a46647f00 doc/protocols: Remove IPFS urls to specific content in examples
We shouldn't be providing links to unverified and non-FFmpeg-controlled
content in our documentation.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2022-12-12 21:47:02 +00:00
Derek Buitenhuis 27b5ce2805 doc/protocols: Remove third party server
We do not endorse or recommend specific third party servers or companies
that users' data will be funneled through.

It is also incorrectly describing how FFmpeg currently works.

Should have been part of 412922cc6f but was
missed.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2022-12-12 21:47:02 +00:00
Jun Zhao 307326b36d doc/protocols: update rtsp options
Split the rtsp options to muxer/demuxer, and update the options.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2022-10-29 12:26:42 +08:00
Gijs Peskens 7f3f3539e8 avformat/librist: allow setting fifo size and fail on overflow
Introduce fifo_size and overrun_nonfatal params to configure fifo buffer
behavior.

Use newly introduced RIST_DATA_FLAGS_OVERFLOW flag to check for overrun
and error out in that case.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-06-09 23:57:20 +02:00
Gyan Doshi 0dcbe1c1aa doc/protocols: add details and reformat IPFS section 2022-05-26 16:21:28 +05:30
Gyan Doshi 8a0f7f7bfe doc/protocols: sort IPFS section alphabetically 2022-05-26 16:20:49 +05:30
Mark Gaiser f889837e00 avformat: Add IPFS protocol support.
This patch adds support for:
- ffplay ipfs://<cid>
- ffplay ipns://<cid>

IPFS data can be played from so called "ipfs gateways".
A gateway is essentially a webserver that gives access to the
distributed IPFS network.

This protocol support (ipfs and ipns) therefore translates
ipfs:// and ipns:// to a http:// url. This resulting url is
then handled by the http protocol. It could also be https
depending on the gateway provided.

To use this protocol, a gateway must be provided.
If you do nothing it will try to find it in your
$HOME/.ipfs/gateway file. The ways to set it manually are:
1. Define a -gateway <url> to the gateway.
2. Define $IPFS_GATEWAY with the full http link to the gateway.
3. Define $IPFS_PATH and point it to the IPFS data path.
4. Have IPFS running in your local user folder (under $HOME/.ipfs).

Signed-off-by: Mark Gaiser <markg85@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-04-12 19:58:33 +02:00
Limin Wang 7bf4c06809 avformat/rtp: add localaddr for network interface selection
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-11-27 11:21:17 +08:00
Limin Wang 6260c611c5 avformat/libsrt: add snddropdelay parameter for srt
Reviewed-by: "zhilizhao(赵志立)" <quinkblack@foxmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-10-11 18:43:47 +08:00
James Almer 8c2c0135e5 avformat: add a concat protocol that takes a line break delimited list of resources
Suggested-by: ffmpeg@fb.com
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-02 10:21:06 -03:00
Thilo Borgmann 05f9b3a0a5 doc/protocols: Add remark about TCP_NODELAY to documentation of TCP 2021-06-20 22:46:00 +02:00
Nick Ruff ea24781a9b lavf/rtmp: Add option to set TCP_NODELAY for rtmp
Suggested-By: ffmpeg@fb.com
2021-06-20 22:45:35 +02:00
Zhao Zhili 58614f7bee avformat/libsrt: workaround conflict with ffmpeg cmdline option
Add 'srt_streamid' option as an alias for 'streamid'.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-06-09 00:09:33 +02:00
Zhao Zhili 55c54ff744 avformat/libsrt: add tsbpd option
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-06-09 00:07:10 +02:00
Andreas Rheinhardt 6f34f03190 avformat/rtsp: Remove deprecated old options, rename stimeout->timeout
Deprecated in ff46124b0d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt dc8e15ef15 avformat/http: Remove deprecated "user-agent" option
Deprecated in 27714b462d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andriy Gelman 282682a9fd doc/protocols: update rtsp options
Define listen_timeout and user_agent. Set timeout and user-agent to deprecated.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2021-04-10 16:18:04 -04:00
Jiangjie Gao 3e9284fccb avformat/rtsp: support buffer_size and pkt_size options for RTP
And forward it to the underlying UDP protocol.

Fixes ticket #7517.

Signed-off-by: Jiangjie Gao <gaojiangjie@live.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-03-19 23:13:26 +01:00
Moritz Barsnick 94b63e8ae8 avformat/http,tls: honor http_proxy command line variable for HTTPS
Add the "http_proxy" option and its handling to the "tls" protocol,
pass the option from the "https" protocol.

The "https" protocol already defines the "http_proxy" command line
option, like the "http" protocol does. The "http" protocol properly
honors that command line option in addition to the environment
variable. The "https" protocol doesn't, because the proxy is
evaluated in the underlying "tls" protocol, which doesn't have this
option, and thus only handles the environment variable, which it
has access to.

Fixes #7223.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-03-19 22:43:02 +01:00
Marton Balint 5bd1d0f4e7 avformat/librist: clarify and limit buffer_size
As suggested by librist developers.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-03-13 17:36:48 +01:00
Marton Balint 4217e091fe avformat/librist: increase default loglevel
Also remove AV_LOG_SIMULATE from the list as it is not used directly, and do
not use panic level on unknown loglevel, but make them warn. Also fix mapping of
NOTICE/INFO/VERBOSE and add documentation about when the option should actually
be used.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-03-13 17:36:48 +01:00
Marton Balint deffb5ddce avformat/librist: make packet size adjustable for writing, fix it for reading
Maximum packet size is 10000 (RIST_MAX_PACKET_SIZE, which is unfortunately
private) minus the RIST protocol overhead which is 28 bytes for the unencrypted
case, 36 for the encrypted case.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-03-13 17:36:48 +01:00
Paul B Mahol 4098f809d6 libavformat: add librist protocol
This work is sponsored by Open Broadcast Systems.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2021-03-13 17:36:48 +01:00
parazyd 51367267c8 avformat/gopher: Add support for Gopher over TLS
This commit adds a "gophers" handler to the gopher protocol. gophers
is a community-adopted protocol that acts the same way like normal
gopher with the added TLS encapsulation.

The gophers protocol is supported by gopher servers like geomydae(8),
and clients like curl(1), clic(1), and hurl(1).

This commit also adds compilation guards to both gopher and gophers,
since now there are two protocols in the file it makes sense to
have this addition.

Signed-off-by: parazyd <parazyd@dyne.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-03-11 23:47:19 +01:00
Lingjiang Fang c4407a3e00 doc/protocols: explain tcp listen option description
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-01-09 17:08:27 +01:00
erankor fde5593c7c avformat/http: support retry on connection error
Add 2 new options:
- reconnect_on_http_error - a list of http status codes that should be
    retried. the list can contain explicit status codes / the strings
    4xx/5xx.
- reconnect_on_network_error - reconnects on arbitrary errors during
    connect, e.g. ECONNRESET/ETIMEDOUT

the retry employs the same exponential backoff logic as the existing
reconnect/reconnect_at_eof flags.

related tickets:
https://trac.ffmpeg.org/ticket/6066
https://trac.ffmpeg.org/ticket/7768

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-01-03 16:47:29 +01:00
Gyan Doshi bff6fbead8 doc/protocols: document cache option
Add entry for read_ahead_limit
2020-12-27 14:50:24 +05:30
Andriy Gelman cd97e1ff4d avformat/libamqp: parse vhost in uri
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-12-21 01:27:33 -05:00
Limin Wang 2aceae1438 avformat/rtpproto: support for rtp read timeout
then we can set the rtp read timeout instead of infinite timeout.

How to test(5s timeout):
./ffprobe -i rtp://192.168.1.67:1234?timeout=5000000

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-10-22 20:53:56 +08:00
Jun Zhao 68c56082d3 doc/http: Update HTTP protocol options
remove the timeout option docs part for HTTP protocol and add
auth_type option part.

Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2020-07-19 08:41:32 +08:00
Marvin Scholz c0c45e238f avformat/icecast: Add option to use TLS connection
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-02 17:14:31 +02:00
Levis Florian bd6ae462f8 avformat/libamqp: add option delivery_mode
Reviewed-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Levis Florian <levis.florian@gmail.com>
2020-06-24 23:15:52 -04:00
Limin Wang 83ed11b12e doc/protocols: clarify timeout and latency unit of measurement for SRT
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-05-03 05:28:32 +08:00
Andriy Gelman e6c5329a43 avformat/libzmq: Make default pkt_size value consistent with amqp
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-03-09 22:07:18 +01:00
Andriy Gelman 1676d0fb25 avformat: Add AMQP version 0-9-1 protocol support
Supports connecting to a RabbitMQ broker via AMQP version 0-9-1.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-03-09 22:07:17 +01:00
Marton Balint 45085d8d3c doc/protocols: clarify SRT timeout options docs
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-02-24 00:14:21 +01:00
Marton Balint 006744bdbd avformat/libsrt: fix name of timeout option
rw_timeout is the generic URLcontext option, not the protocol specific timeout
option, also ?rw_timeout never worked because ?timeout was parsed instead.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-02-24 00:02:45 +01:00
Marton Balint 15d160cc0b avformat/udp: increase the default buffer size of a receiving socket to 384K
It is a common mistake that people only increase fifo_size when they experience
drops, unfortunately this does not help for higher bitrate (> 100 Mbps) streams
when the reader thread simply might not receive the packets in time (especially
under high CPU load) if the default 64 KB of kernel buffer size is used.

New default is determined so that common linux systems can set this buffer size
without tuning kernel parameters.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-01-25 23:16:47 +01:00
Jun Zhao 952fd0c768 lavf/libsrt: enable other encryption parameters
Enable the SRTO_ENFORCEDENCRYPTION/SRTO_KMREFRESHRATE/
SRTO_KMPREANNOUNCE for srt encryption control.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-12-11 14:23:26 +08:00
Jun Zhao 8d823e6005 lavf/libsrt: add linger parameter to libsrt
add linger parameter to libsrt, it's setting the number of seconds
that the socket waits for unsent data when closing.

Reviewed-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-12-11 14:23:26 +08:00
Nicolas Frattaroli a8ec0685ac avformat/ftp: add AVOptions for authentication
This introduces two new AVOption options for the FTP protocol,
one named ftp-user to supply the username to be used for auth,
one named ftp-password to supply the password to be used for auth.

These are useful for when an API user does not wish to deal with
URL manipulation and percent encoding.

Setting them while also having credentials in the URL will use the
credentials from the URL. The rationale for this is that credentials
embedded in the URL are probably more specific to what the user is
trying to do than anything set by some API user.

Signed-off-by: Nicolas Frattaroli <ffmpeg@fratti.ch>
Signed-off-by: Marton Balint <cus@passwd.hu>
2019-11-03 12:24:19 +01:00
Andriy Gelman ef43a4d6b3 avformat: Add ZeroMQ as a protocol
When ffmpeg was streaming, multiple clients were only supported by using a
multicast destination address. An alternative was to stream to a server which
re-distributes the content. This commit adds ZeroMQ as a protocol, which allows
multiple clients to connect to a single ffmpeg instance.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-09-02 23:08:43 +02:00
Marton Balint 3e10223385 avformat/file: add seekable option to disallow seeking
Signed-off-by: Marton Balint <cus@passwd.hu>
2019-04-11 21:18:51 +02:00