summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.h
Commit message (Collapse)AuthorAge
* avformat/rtsp: add satip_raw flag to receive raw mpegts streamAman Karmani2020-12-28
| | | | | | | | | | | | | | | | | | | This can be used to receive the raw mpegts stream from a SAT>IP server, by letting avformat handle the RTSP/RTP/UDP negotiation and setup, but then simply passing the MP2T stream through instead of demuxing it further. For example, this command would demux/remux the mpegts stream: SATIP_URL='satip://192.168.1.99:554/?src=1&freq=12188&pol=h&ro=0.35&msys=dvbs&mtype=qpsk&plts=off&sr=27500&fec=34&pids=0,17,18,167,136,47,71' ffmpeg -i $SATIP_URL -map 0 -c copy -f mpegts -y remux.ts Whereas this command will simply write out the raw stream, with the original PAT/PMT/PIDs intact: ffmpeg -rtsp_flags satip_raw -i $SATIP_URL -map 0 -c copy -f data -y raw.ts Signed-off-by: Aman Karmani <aman@tmm1.net>
* avformat/rtsp: add support for satip://Aman Karmani2020-12-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SAT>IP protocol[1] is similar to RTSP. However SAT>IP servers are assumed to speak only MP2T, so DESCRIBE is not used in the same way. When no streams are active, DESCRIBE will return 404 according to the spec (see section 3.5.7). When streams are active, DESCRIBE will return a list of all current streams along with information about their signal strengths. Previously, attemping to use ffmpeg with a rtsp:// url that points to a SAT>IP server would work with some devices, but fail due to 404 response on others. Further, if the SAT>IP server was already streaming, ffmpeg would incorrectly consume the DESCRIBE SDP response and join an existing tuner instead of requesting a new session with the URL provided by the user. These issues have been noted by many users across the internet[2][3][4]. This commit adds proper spec-compliant support for SAT>IP, including: - support for the satip:// psuedo-protocol[5] - avoiding the use of DESCRIBE - parsing and consuming the com.ses.streamID response header - using "Transport: RTP/AVP;unicast" because the optional "/UDP" suffix confuses some servers This patch has been validated against multiple SAT>IP vendor devices: - Telestar Digibit R2 (https://telestar.de/en/produkt/digibit-r1-2/) - Kathrein EXIP 418 (https://www.kathrein-ds.com/en/produkte/sat-zf-verteiltechnik/sat-ip/227/exip-418) - Kathrein EXIP 4124 (https://www.kathrein-ds.com/en/products/sat-if-signal-distribution/sat-ip/226/exip-4124) - Megasat MEG-8000 (https://www.megasat.tv/produkt/sat-ip-server-3/) - Megasat Twin (https://www.megasat.tv/en/produkt/sat-ip-server-twin/) - Triax TSS 400 (https://www.conrad.com/p/triax-tss-400-mkii-sat-ip-server-595256) [1] https://www.satip.info/sites/satip/files/resource/satip_specification_version_1_2_2.pdf [2] https://stackoverflow.com/questions/61194344/does-ffmpeg-violate-the-satip-specification-describe-syntax [3] https://github.com/kodi-pvr/pvr.iptvsimple/issues/196 [4] https://forum.kodi.tv/showthread.php?tid=359072&pid=2995884#pid2995884 [5] https://www.satip.info/resources/channel-lists/
* avformat/rtsp: prefer to use MAX_URL_SIZE for url and command bufferLimin Wang2020-12-05
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/rtsp: move SDP_MAX_SIZE macro definition to header fileLimin Wang2020-11-11
| | | | | | | | | | | | | move comments for the size of SDP_MAX_SIZE here: Some SDP lines, particularly for Realmedia or ASF RTSP streams, contain long SDP lines containing complete ASF Headers (several kB) or arrays of MDPR (RM stream descriptor) headers plus "rulebooks" describing their properties. Therefore, the SDP line buffer is large. The Vorbis FMTP line can be up to 16KB - see xiph_parse_sdp_line in rtpdec_xiph.c. Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* rtsp: increase the control uri sizeYigit Uyan2020-10-28
| | | | | | Current browsers support up to 2k characters. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* Merge commit '1e56173515826aa4d680d3b216d80a3879ed1c68'James Almer2019-05-02
|\ | | | | | | | | | | | | * commit '1e56173515826aa4d680d3b216d80a3879ed1c68': rtsp: add pkt_size option Merged-by: James Almer <jamrial@gmail.com>
| * rtsp: add pkt_size optionTristan Matthews2019-04-15
| | | | | | | | | | | | | | This allows users to specify an upper limit on the size of outgoing packets when publishing via RTSP. Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/rtsp: Add https tunneling supportJun Li2019-03-25
| | | | | | | | | | Add https based tunneling for RTSP/RTP. Tested on Axis and Bosch cameras. Https is widely used for security consideration.
* | lavf/rtpdec: Constify several pointers.Carl Eugen Hoyos2018-02-11
| | | | | | | | | | | | Fixes two warnings: libavformat/rtpdec.c:155:20: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] libavformat/rtpdec.c:168:20: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
* | Merge commit '79331df362fb05a0d04ca9489c87e5b80077a3f4'James Almer2017-10-03
|\| | | | | | | | | | | | | * commit '79331df362fb05a0d04ca9489c87e5b80077a3f4': rtsp: Lazily set up the pollfd array once Merged-by: James Almer <jamrial@gmail.com>
| * rtsp: Lazily set up the pollfd array onceLuca Barbato2017-02-28
| |
* | Merge commit 'bc2a32969eb4db17677971def5ad5b936d9d1648'Clément Bœsch2016-06-21
|\| | | | | | | | | | | | | * commit 'bc2a32969eb4db17677971def5ad5b936d9d1648': rtsp: Parse SSRC attributes in the SDP Merged-by: Clément Bœsch <u@pkh.me>
| * rtsp: Parse SSRC attributes in the SDPMartin Storsjö2016-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | When feeding input RTP packets to the depacketizer via custom IO, it needs to pick the right stream using the payload type for RTP packets, and using the SSRC for RTCP packets. If the first packet is an RTCP packet, we don't (currently) know the SSRC yet and thus can't pick the right RTP depacketizer to handle it. By parsing the SSRC attribute in the SDP, we can map initial RTCP packets to the right stream. Signed-off-by: Martin Storsjö <martin@martin.st>
| * urlprotocol: receive a list of protocols from the callerAnton Khirnov2016-02-22
| | | | | | | | | | This way, the decisions about which protocols are available for use in any given situations can be delegated to the caller.
* | Merge commit '2c17fb61ced2059034856a6c6cd303014aed01fe'Hendrik Leppkes2015-11-29
|\| | | | | | | | | | | | | * commit '2c17fb61ced2059034856a6c6cd303014aed01fe': rtsp: Log getaddrinfo failures Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * rtsp: Log getaddrinfo failuresLuca Barbato2015-11-25
| | | | | | | | And forward the logging contexts when needed.
* | Merge commit 'e3ec6fe7bb2a622a863e3912181717a659eb1bad'Michael Niedermayer2015-04-01
|\| | | | | | | | | | | | | | | | | | | * commit 'e3ec6fe7bb2a622a863e3912181717a659eb1bad': rtsp: Add a buffer_size option Conflicts: libavformat/rtsp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtsp: Add a buffer_size optionLuca Barbato2015-04-01
| | | | | | | | | | | | And forward it to rtp and udp. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * rtsp: parse lang attribute in SDPGilles Chanteperdrix2015-02-21
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/rtsp: parse lang attribute in SDPGilles Chanteperdrix2015-02-13
| | | | | | | | | | Reviewed-by: Thomas Volkert <silvo@gmx.net> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '8b2e9636c57b22582143467a8a06b509b47b92f9'Michael Niedermayer2014-10-10
|\| | | | | | | | | | | | | | | | | | | * commit '8b2e9636c57b22582143467a8a06b509b47b92f9': rtsp: Support tls-encapsulated RTSP Conflicts: libavformat/rtsp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtsp: Support tls-encapsulated RTSPLuca Barbato2014-10-10
| |
* | Add "prefer_tcp" flag to "rtsp_flags"Andrey Utkin2014-03-04
| | | | | | | | | | | | | | If set, and if TCP is available as RTSP RTP transport, then TCP will be tried first as RTP transport. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-11-01
|\| | | | | | | | | | | | | * qatar/master: rtspenc: Make sure BYE packets are sent before TEARDOWN Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtspenc: Make sure BYE packets are sent before TEARDOWNMartin Storsjö2013-11-01
| | | | | | | | | | | | | | Also make sure the BYE packets are sent at all when using TCP interleaved transport. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-08-14
|\| | | | | | | | | | | | | * qatar/master: sdp: Add an option for sending RTCP packets to the source of the last packets Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * sdp: Add an option for sending RTCP packets to the source of the last packetsMartin Storsjö2013-08-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An SDP description normally only contains the target IP address and port for the packets. This means that we don't really have any clue where to send the RTCP RR packets - previously they're sent to the destination IP written in the SDP (at the same port), which rarely is the actual peer. And if the source for the packets is on a different port than the destination, it's never correct. With a new option, we can choose to send the packets to the address that the latest packet on each socket arrived from. --- Some may even argue that this should be the default - perhaps, but I'd rather keep it optional at first. Additionally, I'm not sure if sending RTCP RR directly back to the source is desireable for e.g. multicast. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '1f57d60129b0e297cd197c6031c4439b30a6b503'Michael Niedermayer2013-07-30
|\| | | | | | | | | | | | | * commit '1f57d60129b0e297cd197c6031c4439b30a6b503': rtsp: Support RFC4570 (source specific multicast) more properly. Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtsp: Support RFC4570 (source specific multicast) more properly.Ed Torbett2013-07-29
| | | | | | | | | | | | | | Add support for domain names, for multiple source addresses, for exclusions, and for session level specification of addresses. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '36fb0d02a1faa11eaee51de01fb4061ad6092af9'Michael Niedermayer2013-07-20
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '36fb0d02a1faa11eaee51de01fb4061ad6092af9': rtsp: Support multicast source filters (RFC 4570) rtpproto: Check the source IP if one single source has been specified rtpproto: Support IGMPv3 source specific multicast inclusion Conflicts: libavformat/rtpproto.c libavformat/rtsp.c libavformat/rtsp.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtsp: Support multicast source filters (RFC 4570)Ed Torbett2013-07-19
| | | | | | | | | | | | | | | | | | | | This supports inclusion of one single IP address for now, at the media level. Specifying the filter at the session level (instead of at the media level), multiple source addresses, exclusion, or using FQDNs instead of plain IP addresses is not supported (yet at least). Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/rt*p: Joining a SSM multicast group using an SDP (Issue #2171)Ed Torbett2013-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Passes Source-Specific Multicast parameters read from an sdp file through to the UDP socket code, allowing source-specific multicast streams to be correctly received. As an integral part of this change, additional checking (currently only enabled in the case of SSM streams, but probably useful in similar scenarios) has been added to the RTP protocol handler to distinguish UDP packets arriving from multiple sources to the same port and process only the expected packets (those transmitted from the expected UDP source address). This resolves an issue identified when multiple instances of FFmpeg subscribe to different Source-Specific Multicast streams but with each sharing the same destination port. Signed-off-by: Edward Torbett <ed.torbett@simulation-systems.co.uk> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Supply a User-Agent header when opening rtsp streams.Carl Eugen Hoyos2013-07-11
| | | | | | | | | | | | Some rtsp servers like the IP Cam IcyBox IB-CAM2002 need it. Fixes ticket #2761. Reported, analyzed and tested by trac user imavra.
* | rtsp: add option to set the socket timeout of the lower protocol.Michael Niedermayer2013-04-08
| | | | | | | | | | | | Fixes Ticket2294 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '2f3bada63e57345329c4f9b48e9b81b5cfc03d05'Michael Niedermayer2013-01-15
|\| | | | | | | | | | | | | | | | | | | | | * commit '2f3bada63e57345329c4f9b48e9b81b5cfc03d05': lavf: Add a protocol for SRTP encryption/decryption rtsp: Support decryption of SRTP signalled via RFC 4568 (SDES) Conflicts: libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtsp: Support decryption of SRTP signalled via RFC 4568 (SDES)Martin Storsjö2013-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This only takes care of decrypting incoming packets; the outgoing RTCP packets are not encrypted. This is enough for some use cases, and signalling crypto keys for use with outgoing RTCP packets doesn't fit as simply into the API. If the SDP demuxer is hooked up with custom IO, the return packets can be encrypted e.g. via the SRTP protocol. If the SRTP keys aren't available within the SDP, the decryption can be handled externally as well (when using custom IO). Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '86d9181cf41edc3382bf2481f95a2fb321058689'Michael Niedermayer2013-01-09
|\| | | | | | | | | | | | | | | | | | | * commit '86d9181cf41edc3382bf2481f95a2fb321058689': rtpdec: Support sending RTCP feedback packets Conflicts: libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtpdec: Support sending RTCP feedback packetsMartin Storsjö2013-01-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This sends NACK for missed packets and PLI (picture loss indication) if a depacketizer indicates that it needs a new keyframe, according to RFC 4585. This is only enabled if the SDP indicated that feedback is supported (via the AVPF or SAVPF profile names). The feedback packets are throttled to a certain maximum interval (currently 250 ms) to make sure the feedback packets don't eat up too much bandwidth (which might be counterproductive). The RFC specifies a more elaborate feedback packet scheduling. The feedback packets are currently sent independently from normal RTCP RR packets, which is not totally spec compliant, but works fine in the environments I've tested it in. (RFC 5506 allows this, but requires a SDP attribute for enabling it.) Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'e96406eda4f143f101bd44372f7b2d542183000a'Michael Niedermayer2013-01-04
|\| | | | | | | | | | | | | | | | | | | * commit 'e96406eda4f143f101bd44372f7b2d542183000a': rtsp: Add support for depacketizing RTP data via custom IO Conflicts: libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtsp: Add support for depacketizing RTP data via custom IOMartin Storsjö2013-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To use this, set sdpflags=custom_io to the sdp demuxer. During the avformat_open_input call, the SDP is read from the AVFormatContext AVIOContext (ctx->pb) - after the avformat_open_input call, during the av_read_frame() calls, the same ctx->pb is used for reading packets (and sending back RTCP RR packets). Normally, one would use this with a read-only AVIOContext for the SDP during the avformat_open_input call, then close that one and replace it with a read-write one for the packets after the avformat_open_input call has returned. This allows using the RTP depacketizers as "pure" demuxers, without having them tied to the libavformat network IO. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'c3e15f7b39aac2012f09ee4ca86d2bc674ffdbd4'Michael Niedermayer2012-10-22
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'c3e15f7b39aac2012f09ee4ca86d2bc674ffdbd4': rtpdec: Don't pass a non-AVClass pointer as log context rtsp: Update a comment to the current filename scheme avcodec: handle AVERROR_EXPERIMENTAL avutil: Add AVERROR_EXPERIMENTAL avcodec: prefer decoders without CODEC_CAP_EXPERIMENTAL Conflicts: doc/APIchanges ffmpeg.c libavcodec/utils.c libavformat/rtpdec.c libavutil/error.c libavutil/error.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtsp: Update a comment to the current filename schemeMartin Storsjö2012-10-22
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '1cd432e167b1a80853760c89a33606e2b5f229c2'Michael Niedermayer2012-10-19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '1cd432e167b1a80853760c89a33606e2b5f229c2': configure: fix libcdio check rtsp: Allow setting the reordering buffer size via an AVOption rtsp: Vertically align a constant definition rtp: Update the check for distinguishing between RTP and RTCP aac: fix build with hardcoded tables fate: dependencies for screen codec tests riff: Move functions around to be covered by appropriate #ifdefs Conflicts: configure tests/fate/screen.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtsp: Allow setting the reordering buffer size via an AVOptionMartin Storsjö2012-10-18
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
| * rtsp: Vertically align a constant definitionMartin Storsjö2012-10-18
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-08-09
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: mpegvideo: reduce excessive inlining of mpeg_motion() mpegvideo: convert mpegvideo_common.h to a .c file build: factor out mpegvideo.o dependencies to CONFIG_MPEGVIDEO Move MASK_ABS macro to libavcodec/mathops.h x86: move MANGLE() and related macros to libavutil/x86/asm.h x86: rename libavutil/x86_cpu.h to libavutil/x86/asm.h aacdec: Don't fall back to the old output configuration when no old configuration is present. rtmp: Add message tracking rtsp: Support mpegts in raw udp packets rtsp: Support receiving plain data over UDP without any RTP encapsulation rtpdec: Remove an unused include rtpenc: Remove an av_abort() that depends on user-supplied data vsrc_movie: discourage its use with avconv. avconv: allow no input files. avconv: prevent invalid reads in transcode_init() avconv: rename OutputStream.is_past_recording_time to finished. Conflicts: configure doc/filters.texi ffmpeg.c ffmpeg.h libavcodec/Makefile libavcodec/aacdec.c libavcodec/mpegvideo.c libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtsp: Support mpegts in raw udp packetsMartin Storsjö2012-08-09
| | | | | | | | | | | | | | This is basically the same way as mpegts packets are parsed in rtpdec.c. Signed-off-by: Martin Storsjö <martin@martin.st>
| * rtsp: Support receiving plain data over UDP without any RTP encapsulationMartin Storsjö2012-08-09
| | | | | | | | | | | | | | EvoStream Media Server can serve data in this format, and VLC/live555 already supports it. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-07-11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: configure: Check for the math function rint TechSmith Screen Codec 2 decoder rtsp: Add listen mode rtsp: Make rtsp_open_transport_ctx() non-static rtsp: Move rtsp_read_close rtsp: Parse the mode=receive/record parameter in transport lines Conflicts: Changelog libavcodec/avcodec.h libavcodec/version.h libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtsp: Add listen modeJordi Ortiz2012-07-10
| | | | | | | | | | | | | | This makes the RTSP demuxer act as a server, listening for an incoming connection. Signed-off-by: Martin Storsjö <martin@martin.st>