Commit Graph

398 Commits

Author SHA1 Message Date
aler9 10d47f8631 update gortsplib 2022-06-21 15:50:15 +02:00
aler9 e45820b2c0 hls server: show real client IPs when behind a proxy (#955) 2022-06-21 13:54:19 +02:00
aler9 039d106efa update gortsplib 2022-06-14 15:34:45 +02:00
aler9 d6bd722a7a update gortsplib 2022-06-11 19:30:41 +02:00
aler9 9d3fd3bc37 update gortsplib 2022-06-05 01:36:29 +02:00
aler9 c8f40f448a fix EOF error during DTS extraction 2022-06-03 12:48:45 +02:00
aler9 9bd8b2cfb6 rtmp server, hls muxer: fix DTS in case of B-frames and remove PTS-DTS offset 2022-06-03 11:31:39 +02:00
aler9 4073013f68 hls muxer: stop normalizing PTS 2022-06-02 22:37:46 +02:00
aler9 acd788d632 update gortsplib 2022-06-02 20:58:48 +02:00
aler9 e7f88bc12f move DTS extractor into gortsplib 2022-06-02 11:55:12 +02:00
aler9 93975552ac hls muxer: improve performance, decrease memory consumption 2022-06-01 10:13:37 +02:00
Alessandro Ros e115983296
Implement Low-Latency HLS (#938)
* add hlsVariant parameter

* hls: split muxer into variants

* hls: implement fmp4 segments

* hls muxer: implement low latency mode

* hls muxer: support audio with fmp4 mode

* hls muxer: rewrite file router

* hls muxer: implement preload hint

* hls muxer: add various error codes

* hls muxer: use explicit flags

* hls muxer: fix error in aac pts

* hls muxer: fix sudden freezes with video+audio

* hls muxer: skip empty parts

* hls muxer: fix video FPS

* hls muxer: add parameter hlsPartDuration

* hls muxer: refactor fmp4 muxer

* hls muxer: fix CAN-SKIP-UNTIL

* hls muxer: refactor code

* hls muxer: show only parts of last 2 segments

* hls muxer: implementa playlist delta updates

* hls muxer: change playlist content type

* hls muxer: improve video dts precision

* hls muxer: fix video sample flags

* hls muxer: improve iphone audio support

* hls muxer: improve mp4 timestamp precision

* hls muxer: add offset between pts and dts

* hls muxer: close muxer in case of error

* hls muxer: stop logging requests with the info level

* hls muxer: rename entry into sample

* hls muxer: compensate video dts error over time

* hls muxer: change default segment count

* hls muxer: add starting gap

* hls muxer: set default part duration to 200ms

* hls muxer: fix audio-only streams on ios

* hls muxer: add playsinline attribute to video tag of default web page

* hls muxer: keep mpegts as the default hls variant

* hls muxer: implement encryption

* hls muxer: rewrite dts estimation

* hls muxer: improve DTS precision

* hls muxer: use right SPS/PPS for each sample

* hls muxer: adjust part duration dynamically

* add comments

* update readme

* hls muxer: fix memory leak

* hls muxer: decrease ram consumption
2022-05-31 19:17:26 +02:00
aler9 6de8277cb7 support SDPs with TIAS bandwidths (#948) 2022-05-23 21:30:41 +02:00
aler9 2fba878755 rtsp server: fix wrong RTP-Info header (#922)
- fix truncation to seconds of RTP time in RTP-Info
- add a small quantity to rtptime in RTP-Info
- add 1 to last sequence number in RTP-Info
2022-05-16 14:37:05 +02:00
aler9 7ecd52808a rtsp source: support cameras that provide base URL inside control attribute (#683) 2022-05-11 16:54:07 +02:00
aler9 d6a804f592 rtsp server: improve performance when reading with TCP 2022-05-11 16:37:33 +02:00
aler9 f521049e2f rtsp source: restore support for cameras with percent sign in password 2022-05-10 17:33:34 +02:00
aler9 901eae2f6b fix bias error in AAC timestamp 2022-05-10 13:29:32 +02:00
aler9 1ad0df128d rtsp source: fix timeout (https://github.com/aler9/rtsp-simple-server/discussions/897)
that happens when there's a UDP->TCP switch and Content-Base contains
an absolute URL
2022-05-02 19:03:00 +02:00
aler9 6c95ea2837 rtsp source: support AUs wrapped inside ADTS (#855) 2022-04-29 12:33:33 +02:00
aler9 411fb989eb hls client: add limit on NALU size 2022-04-29 12:23:13 +02:00
aler9 35b3541e4f hls client: add limit on AU size 2022-04-29 12:02:11 +02:00
aler9 91ce2dd886 rtsp server: fix reading with multicast when host is macOS (#895) 2022-04-21 13:54:19 +02:00
aler9 c700e309ce rtsp server: fix reading with ffplay and stateless ipv6 2022-04-21 13:16:56 +02:00
aler9 0912042fb1 hls muxer: do not increase version number of MPEG-TS tables unless there's a reason (https://github.com/asticode/go-astits/pull/38) 2022-04-21 09:20:08 +02:00
aler9 9098644802 rtsp source: fix parsing of transport header with dahua rtsp server (https://github.com/aler9/gortsplib/issues/121) 2022-04-21 09:02:44 +02:00
aler9 385e301728 rtsp server/source: support AAC tracks with indexlength=0 2022-04-15 18:44:00 +02:00
aler9 6b86607092 rtsp source: improve support for AAC tracks with custom parameters 2022-04-15 17:01:18 +02:00
aler9 db7ee22789 rtsp source: support AAC tracks with custom sizelength, indexlength and indexdeltalength
(https://github.com/aler9/gortsplib/pull/118)
2022-04-15 13:17:00 +02:00
aler9 2a0dc3b63d rtsp: improve performance; add upper limit on NALU/AU size to prevent RAM exhaustion 2022-04-10 15:34:33 +02:00
aler9 98c6cd4650 RTSP: automatically remux oversized RTP/H264 packets; drop parameter ReadBufferSize 2022-04-09 20:20:14 +02:00
aler9 50d1079f70 RTSP: fix multicast TTL; set default multicast TTL to 16 (#873) 2022-04-09 11:28:40 +02:00
aler9 d929197b21 propagate H264 packets throughout the server 2022-04-08 18:19:53 +02:00
aler9 3fc4ca6465 update gortsplib; downgrade pion/rtp to v1 2022-04-01 12:04:21 +02:00
aler9 f53b316c0d rtsp server: generate RTCP sender reports automatically; stop routing RTCP packets 2022-03-24 15:44:34 +01:00
aler9 a6986e9fa4 update gortsplib 2022-03-24 12:59:22 +01:00
aler9 8cb2a7ffd4 rtsp source: support servers that sends UDP packets with a different IP (https://github.com/aler9/gortsplib/pull/108) 2022-03-18 16:58:28 +01:00
aler9 544c192103 update gortsplib 2022-03-15 12:59:10 +01:00
aler9 e611c7ddfd RTSP source: skip tracks with an invalid clock rate (#832) 2022-03-15 12:37:02 +01:00
aler9 245d58ee47 RTSP server: set timeout in Session header only when client is playing and protocol is UDP 2022-03-09 10:09:03 +01:00
aler9 6dc11c2906 RTSP server/source: fix encoding of RTP packets with padding
This fixes a SIGSEGV with GStreamer.
2022-03-08 12:54:23 +01:00
aler9 20a8862b2f RTSP source: restore packet buffering with the UDP transport 2022-03-07 22:45:23 +01:00
aler9 87f24f1704 update gortsplib 2022-02-19 23:06:24 +01:00
aler9 d7edf42c40 rtsp server: restore authentication (#840) 2022-02-19 22:06:57 +01:00
aler9 5f9b705a03 RTSP server: remove Session header from ANNOUNCE responses (#840) 2022-02-19 19:25:27 +01:00
aler9 16df033d21 update gortsplib 2022-02-19 16:08:10 +01:00
aler9 43471a05ab update gortsplib 2022-02-18 10:24:33 +01:00
aler9 5504ff44b6 rtsp: parse all incoming RTP/RTCP packets 2022-02-18 00:14:52 +01:00
aler9 ae7b1c2ea6 rtmp, hls: fix wrong timestamp computation that happened at 28h28m
this was caused by a int64 overflow.
2022-02-13 17:03:19 +01:00
aler9 7c1d329d61 rtsp server: fix multicast listen error on Windows (#742)
This happened when the system has network interfaces that don't support multicast.
2022-02-02 18:32:09 +01:00
aler9 6c7fd8ee6f fix bad track cloning and restore HLS audio support (#808) 2022-02-01 19:24:33 +01:00
aler9 f330cc6997 rtsp source: fix crash in case a PLAY request fails 2022-01-31 10:03:55 +01:00
aler9 343a5f17fb hls: add new parameter hlsSegmentMaxSize 2022-01-30 17:54:05 +01:00
aler9 2bfdcc7d89 update gortsplib 2022-01-30 17:43:03 +01:00
aler9 9bc364fa21 support H264 tracks that contains extra data in sprop-parameter-set 2022-01-30 14:30:01 +01:00
aler9 b8bf747796 update gortsplib 2022-01-23 22:41:07 +01:00
aler9 6f5bc158cd do not treat generic bytes as strings into errors
this avoid invalid log messages
2022-01-23 12:43:50 +01:00
aler9 54d950b0af RTSP server: send session timeout to clients through the session header (#702) 2022-01-20 16:39:07 +01:00
aler9 c6a4794a25 RTSP source: set keepalive by using the session header
This fixes timeouts with a lot of cameras, when using UDP.
2022-01-20 12:04:07 +01:00
aler9 530e8f8467 rtsp source: fix '401 Unauthorized' error with some Hikvision cameras
when automatically switching protocol
2022-01-18 16:22:31 +01:00
aler9 7005108313 hls, rtmp: fix timestamp decoding in case of an overflow followed by a negative time diff 2022-01-18 11:56:09 +01:00
aler9 8a9c8243e4 fix transport header error with some Hikvision cameras
fixes 'invalid transport header: encoding/hex: invalid byte: U+0020 ' ''.
2022-01-05 12:10:21 +01:00
aler9 de70566179 hls, rtmp: fix DTS generation, avoid non-increasing DTS 2021-12-10 23:03:17 +01:00
aler9 a54ecaefe1 hls, rtmp: compute duration correctly in case of an RTP overflow 2021-12-09 20:28:45 +01:00
aler9 9a19635b1c restore 32bit support 2021-12-08 18:18:14 +01:00
aler9 f041af2b65 rtsp server: slightly improve performance when reading with TCP 2021-12-08 17:54:05 +01:00
aler9 26facc24f2 rtsp server: write UDP packets in parallel.
A goroutine writer is allocated for each session and
for each multicast stream.

This increases bandwidth and prevents freezes caused
by lagging readers.
2021-12-07 23:13:55 +01:00
aler9 8cf40a21d8 rtsp server, rtsp source: send receiver reports only after receiving a sender report 2021-12-06 17:17:59 +01:00
aler9 c65f4509bd update gortsplib 2021-12-05 14:36:57 +01:00
aler9 a1fed6fb38 rtsp source: set ServerName when using TLS (#708) 2021-12-03 23:33:28 +01:00
aler9 6c3302a83f rtsp source: send receiver reports even with sourceAnyPortEnable (#698) 2021-11-30 22:24:37 +01:00
aler9 05b1a7e720 update gortsplib 2021-11-28 13:04:00 +01:00
aler9 21cf17e65e rtsp server: reply with code 454 when session is not found 2021-11-26 15:53:59 +01:00
aler9 411a35e89f rtsp source: fix EOF error that happens when using TCP with some cameras (#548) 2021-11-18 12:18:56 +01:00
aler9 b4155a4fdf rtsp: support reading with VLC and multicast 2021-11-15 17:58:14 +01:00
aler9 958c333cde rtsp source: support reading from servers that use random UDP ports (#691) 2021-11-13 10:15:58 +01:00
aler9 f7419586af update gortsplib 2021-11-12 22:29:56 +01:00
aler9 d5c55a8ddc move test into gortsplib 2021-11-06 13:38:51 +01:00
aler9 5f3ceb6d1e rtsp source: fix detection of GET_PARAMETER support 2021-11-06 12:09:46 +01:00
aler9 a867c469fd fix automatic deletion of regexp paths (#664) (#680) 2021-11-03 22:28:50 +01:00
aler9 eab2663420 move VLC authentication hack into gortsplib 2021-10-30 15:05:27 +02:00
aler9 0c4cfd0e53 update gortsplib 2021-10-30 13:55:05 +02:00
aler9 8df5c52a6c rtsp: make VLC-related error message more clear when 2021-10-28 18:40:57 +02:00
aler9 8875c8eaa6 rtsp: print exact reason when a session is destroyed (#649) 2021-10-27 19:49:43 +02:00
aler9 509bed355a update gortsplib 2021-10-22 18:41:10 +02:00
aler9 ae0d959892 update go-astits 2021-10-01 14:05:20 +02:00
aler9 fc46c33a96 avoid crash when proxing HLS (#558) 2021-09-30 11:49:06 +02:00
aler9 e851640ab6 avoid crash in case of invalid H264 SPS (#590) 2021-09-28 22:26:26 +02:00
aler9 e78544f23e update gortsplib 2021-09-28 15:47:56 +02:00
aler9 54292d712e convert the configuration into JSON before loading it 2021-09-27 16:40:49 +02:00
aler9 68ab5c05f6 move aac utilities into gortsplib 2021-09-23 20:24:10 +02:00
aler9 3b0327233e move hls utils into gortsplib 2021-09-23 20:14:20 +02:00
aler9 aec5f53756 rtsp: do not allow a client to control a session created with a different IP 2021-09-23 19:54:29 +02:00
aler9 2d5e1fa823 use crypto/rand instead of math/rand to avoid port conflicts and security issues 2021-09-23 19:38:40 +02:00
aler9 21539d341c update gortsplib; this include:
* do not allow a session to setup UDP tracks from different IPs
* do not allow a reader to use the same UDP ports of another reader
2021-09-23 19:20:34 +02:00
aler9 df4c268813 support proxying HLS 2021-09-05 18:00:29 +02:00
aler9 b65207012c update gortsplib 2021-08-25 19:51:59 +02:00
aler9 57f465ccd8 rtsp source: support servers that change interleaved IDs 2021-08-25 18:10:20 +02:00
aler9 20ac25571c api: add "state" field to RTSP sessions and RTMP connections 2021-08-11 12:25:19 +02:00
aler9 6163095a11 fix crash that happens when sourceOnDemand is true and a source times out 2021-08-10 18:36:34 +02:00
aler9 ed375583d0 Implement an HTTP API to query and control the server 2021-08-07 19:20:39 +02:00
aler9 be1e7c5cc9 move code into gortsplib 2021-07-31 21:27:55 +02:00
aler9 c3c643c602 hls: move muxer into dedicated object 2021-07-24 18:31:54 +02:00
aler9 3107b09dfe switch to asticode/go-astits 2021-07-05 13:10:43 +02:00
aler9 a6d9578d4c RTSP server: support setupping tracks with arbitrary interleaved IDs (#402) 2021-06-26 13:46:31 +02:00
aler9 0d34a10c1c RTSP source: always set Range header inside PLAY requests, fixing compatibility with Parrot Streaming Server (#413) 2021-06-22 22:54:30 +02:00
aler9 a8a0944c09 RTSP source: fix reading with multicast 2021-06-19 21:29:56 +02:00
aler9 fbe3d9c67e RTSP server: use one IP for each multicast stream; add multicast parameter to the configuration file 2021-06-19 21:29:56 +02:00
aler9 64273b9682 RTSP server: fix bug that prevents clients from receiving with multicast after all previous clients have disconnected 2021-06-19 16:16:50 +02:00
aler9 e64edcfda9 RTSP source: support proxing with UDP-multicast 2021-06-19 16:16:47 +02:00
aler9 75e1e3e4dc RTSP server: support reading with multicast (#214) (#324) 2021-06-19 16:16:35 +02:00
aler9 d21841c1b7 RTSP source: add option sourceAnyPortEnable to support cameras that don't provide server ports (#407) 2021-06-03 23:51:37 +02:00
aler9 9f0c519582 update gortsplib 2021-05-30 12:57:23 +02:00
aler9 2897288651 RTSP source: fix authentication during SETUP, preventing 401s during protocol switches (#392) 2021-05-30 12:02:03 +02:00
aler9 396f578fb5 headers: support SSRCs with length < 4 (#396) 2021-05-29 22:23:55 +02:00
aler9 63164c85e1 RTSP source: support SSRCs with missing zeros (#396) 2021-05-29 19:20:16 +02:00
aler9 344e75a9bd update gortsplib 2021-05-29 19:12:26 +02:00
aler9 cfbea7eedc RTSP source: support cameras that use non-conventional Transport headers 2021-05-21 13:08:07 +02:00
aler9 96de32f0ff fix crash that can happen during publisher override 2021-05-16 21:32:10 +02:00
aler9 79a3ab316f RTSP: add SSRC to Transport header (#380) 2021-05-16 16:27:08 +02:00
aler9 07765f0a63 HLS converter: skip packets that are part of frames sent before initialization of the converter (#374) 2021-05-14 23:20:15 +02:00
aler9 bb995ad2fe strictly follow the specification when generating SDP of AAC tracks (#112) 2021-05-13 09:51:33 +02:00
aler9 f086b624c1 use hierarchical contexts 2021-05-11 17:20:32 +02:00
aler9 e558b245e7 use contexts anywhere is possible 2021-05-11 12:17:48 +02:00
aler9 6d02ec9478 update gortsplib 2021-05-10 23:23:56 +02:00
aler9 51843fc577 clientrtsp: do not show in logs 'ERR: terminated' 2021-05-09 14:24:00 +02:00
aler9 4d260412c4 remove number of clients from logs 2021-05-08 22:52:10 +02:00
aler9 8531fc49dc cleanup log 2021-05-08 22:30:22 +02:00
aler9 4da59604e1 RTSP session: add author connection to log messages 2021-05-08 22:18:30 +02:00
aler9 d4af264fe4 RTSP client: close sessions when they have no clients 2021-05-08 17:10:44 +02:00
aler9 c986cb254b implement RTSP sessions (#149) 2021-05-07 23:07:31 +02:00
aler9 35a7644ee6 add colors to terminal output 2021-04-27 21:24:00 +02:00
aler9 a1a56ff203 allow to set a different listen IP for each listener (#343) 2021-04-24 18:52:13 +02:00
aler9 97a9cedb1e client: fix crash that happened in case of invalid TCP frames (#348) 2021-04-24 17:21:28 +02:00
aler9 dee045f961 implement reading with HLS 2021-04-18 23:02:19 +02:00
aler9 258a6b55b1 RTSP source: fix inversion of track data that happened randomly in case of multiple tracks (#353) 2021-04-17 19:49:39 +02:00
aler9 fb0122ba18 RTMP client: speed up video reading by 1 frame 2021-04-05 18:15:51 +02:00
aler9 f208026338 RTSP source: apply TCP timeout correctly (#335) 2021-04-04 19:53:58 +02:00
aler9 90bc09c93c RTSP source: ignore non-standard keys in headers (#336) 2021-04-04 19:53:49 +02:00
aler9 5d57bd8165 speed up tests 2021-04-03 18:02:56 +02:00
aler9 9287e0fe98 RTSP source: build track URLs by using Content-Base when provided by server, fixing many timeouts 2021-04-03 17:15:26 +02:00
aler9 99a07c0d33 rtmp client: speed up acceptance of clients by moving handshake inside client routine 2021-04-03 12:08:07 +02:00
aler9 8acfb5b2b1 support RTP-Infos with spaces (#333) 2021-04-02 18:13:53 +02:00
aler9 69be41d997 support RTP-Info headers with paths instead of URLs (#250) 2021-03-30 11:07:43 +02:00
aler9 64cf3a4181 rtsp client: fix channel of RTCP packets, avoiding client timeouts 2021-03-28 15:21:44 +02:00
aler9 79190f7da8 rtsp client: do not return a timeout error in case UDP packets are being received from a single track 2021-03-28 15:21:36 +02:00
aler9 2ad109a2af remove debug messages 2021-03-27 14:48:32 +01:00
aler9 d40a8bb144 client: switch to TCP if no UDP packets have been received within a timeout (#173) 2021-03-26 23:04:01 +01:00
aler9 87dd87aa49 sourcertsp: do not exit in case UDP packets are being received from a single track, improving UDP robustness 2021-03-26 12:20:48 +01:00
aler9 10bf7bad43 support reading AAC frames bigger than 1460 bytes with RTMP (#206) 2021-03-24 21:35:23 +01:00