Commit Graph

1382 Commits

Author SHA1 Message Date
aler9
aca56089c1 move codec-specific utilities into pkg/codecs 2022-12-27 17:19:56 +01:00
aler9
68d617ef51 update golangci-lint 2022-12-27 16:58:15 +01:00
Alessandro Ros
91f18ab6d9 Add RTP/MJPEG decoder and encoder (#165)
* rename format.JPEG into format.MJPEG

* add examples/client-publish-format-mjpeg

* add rtp/mjpeg decoder and encoder
2022-12-27 13:43:23 +01:00
aler9
cd8cc2cdb1 improve H265 SPS parser 2022-12-27 12:00:00 +00:00
aler9
06041a264e rename parameter in H264 SPS 2022-12-27 12:00:00 +00:00
aler9
a18f80f09f h265: add SPS.FPS() 2022-12-27 12:00:00 +00:00
aler9
3da2abc0f8 h264, h264: fix removal of emulation prevention byte
sequence [0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00]
was not handled correctly
2022-12-27 12:00:00 +00:00
aler9
9acff114b7 improve performance of H264/H265 SPS parsers 2022-12-24 12:25:08 +01:00
aler9
db251994aa add H265 SPS parser 2022-12-24 11:42:51 +01:00
aler9
8320b1aceb improve coverage 2022-12-23 14:27:44 +01:00
aler9
d71991d929 improve coverage 2022-12-23 13:54:59 +01:00
Chen Mingliang
57707b8629 Improved support for he_aac (#164)
* Improved support for he_aac_v2 and fixed he_aac warning "Audio object type SBR+0 is not implemented" via ffmpeg.

* fix linting

* rename ExtType into ExtensionType

* parse FrameLengthFlag, DependsOnCoreCoder, CoreCoderDelay even with SBR / PS object types

* when extension type is SBR or PS, check that object type is AAC-LC

Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
2022-12-23 13:24:39 +01:00
aler9
389252b621 server: use UUIDs as session secrets 2022-12-22 20:40:42 +01:00
aler9
5a2ea9cf9c partially revert cabfcd6 2022-12-22 20:36:41 +01:00
Alessandro Ros
ae9dac0ad3 use random UUIDs as media IDs (#163)
* remove Medias.Clone(), Media.Clone(), Format.Clone()

* server: use random UUIDs as media IDs

* client: use random UUIDs as media IDs
2022-12-22 20:32:28 +01:00
aler9
cabfcd627b client: do not override media controls inside Announce()
this fixes the client-read-republish example and allows users to set
their own media controls.

Function medias.SetControls() is provided in order to automatically set
media controls and must be called manually.
2022-12-22 18:54:09 +01:00
aler9
ffe8c87c38 fix overriding of previously-received RTP packets that leaded to crashes
RTP packets were previously take from a buffer pool. This was messing
up the Client, since that buffer pool was used by multiple routines at
once, and was probably messing up the Server too, since packets can be
pushed to different queues and there's no guarantee that these queues
have an overall size less than ReadBufferCount.

This buffer pool is removed; this decreases performance but avoids bugs.
2022-12-19 13:51:49 +01:00
aler9
b3de3cf80e move media-related logics into serverStreamMedia 2022-12-19 13:06:08 +01:00
aler9
e1c07a1c8d add VP8.CreateEncoder(), VP9.CreateEncoder() 2022-12-14 22:06:11 +01:00
aler9
d43cb0455e rtph265: add Decoder.DecodeUntilMarker() 2022-12-14 17:57:33 +01:00
aler9
6141afcfc4 add H264 NALU types 2022-12-14 14:57:02 +01:00
aler9
ba8a0b7bbd move all H264 NALU types into h264 package 2022-12-14 14:56:53 +01:00
aler9
93792de859 improve coverage 2022-12-14 09:51:37 +01:00
aler9
04d1de7177 rtph264: add ErrNonStartingPacketAndNoPrevious 2022-12-13 21:19:04 +01:00
aler9
60596c32d1 fix parsing of H264 tracks with empty sprop-parameter-sets 2022-12-13 19:02:01 +01:00
aler9
b9a15679b3 update readme 2022-12-13 18:23:26 +01:00
aler9
f62da20a99 rename files 2022-12-13 18:07:38 +01:00
aler9
38b24b8e26 rename 'track' references into 'format' 2022-12-13 18:06:41 +01:00
aler9
50d6b2e916 fix race condition when calling format.Clone() 2022-12-13 17:10:01 +01:00
aler9
0f87a1cf41 server: add ServerSession.SetuppedMedias() 2022-12-12 20:10:24 +01:00
aler9
6f452f32aa Merge branch 'v1' 2022-12-12 18:19:16 +01:00
aler9
107d7b618d fix support for LPCM tracks with no explicit channel count
(https://github.com/aler9/rtsp-simple-server/issues/1292)
v1.0.1
2022-12-12 18:13:16 +01:00
aler9
d58970493e update readme 2022-12-12 16:16:36 +01:00
aler9
442cfcf2df media: remove pointer from Medias.FindFormat() 2022-12-12 01:00:25 +01:00
aler9
d74b7429ca update docs link 2022-12-12 00:21:02 +01:00
aler9
233a51b388 update readme 2022-12-12 00:19:37 +01:00
aler9
a50247956f rename medias.Format into medias.FindFormat 2022-12-12 00:16:25 +01:00
aler9
46cbb885b7 improve coverage 2022-12-11 23:40:01 +01:00
aler9
0c13440721 rename rtpcodecs into formatdecenc 2022-12-11 22:56:59 +01:00
aler9
256877086b merge serverWriter and clientWriter 2022-12-11 22:54:16 +01:00
Alessandro Ros
a1396206b5 convert Tracks into Medias and Formats (#155)
* split tracks from medias

* move tracks into dedicated package

* move media into dedicated package

* edit Medias.Marshal() in order to return SDP

* add medias.Find() and simplify examples

* improve coverage

* fix rebase errors

* replace TrackIDs with MediaIDs

* implement media-specific and track-specific callbacks for reading RTCP and RTP packets

* rename publish into record, read into play

* add v2 tag

* rename tracks into formats
2022-12-11 22:03:22 +01:00
aler9
2a5b3e3ee5 server: return error in case of unexpected interleaved frames v1.0.0 2022-12-11 17:59:58 +01:00
aler9
fa95f5a86b add Client.SetupAll() 2022-12-11 14:25:35 +01:00
aler9
99855bd3a2 allow invalid RTCP packets in both client and server
(https://github.com/aler9/rtsp-simple-server/issues/1085)

Invalid RTCP packets, in both server and client, do not trigger a fatal
error anymore but they're just blocked. OnDecodeError() is called in
order to emit a warning.
2022-12-09 12:48:33 +01:00
aler9
00efb912aa avoid using fmt.Print* in example 2022-12-09 12:45:16 +01:00
aler9
e6e7f11ee1 improve coverage 2022-12-09 12:31:18 +01:00
Alessandro Ros
8515d62735 fix codecov / github api limits (#157) 2022-11-29 15:48:15 +01:00
aler9
d521a785c4 support tracks without clock rate 2022-11-27 21:17:48 +01:00
aler9
f16cb173b7 rename read-codec and publish-codec examples into read-track and publish-track 2022-11-27 19:42:05 +01:00
aler9
ab0c9e64c9 merge TrackPCMA and TrackPCMU into Track G711 2022-11-27 19:36:46 +01:00