From 210603d7c44a4232db4dd4d1c1241e780ab9555a Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Wed, 31 May 2023 18:16:39 +0200 Subject: [PATCH] update documentation (#1885) --- README.md | 12 ++++++------ internal/core/rtmp_conn.go | 4 ++-- internal/formatprocessor/mpeg2audio.go | 2 +- internal/formatprocessor/processor.go | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 891d16c1..363fc17f 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,10 @@ Live streams can be published to the server with: |protocol|variants|video codecs|audio codecs| |--------|--------|------------|------------| |WebRTC|Browser-based, WHIP|AV1, VP9, VP8, H264|Opus, G722, G711| -|RTSP clients|UDP, TCP, RTSPS|AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-2 Video, M-JPEG and any RTP-compatible codec|Opus, MPEG-4 Audio (AAC), MPEG-2 Audio (MP3), G722, G711, LPCM and any RTP-compatible codec| -|RTSP servers and cameras|UDP, UDP-Multicast, TCP, RTSPS|AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-2 Video, M-JPEG and any RTP-compatible codec|Opus, MPEG-4 Audio (AAC), MPEG-2 Audio (MP3), G722, G711, LPCM and any RTP-compatible codec| -|RTMP clients (OBS Studio)|RTMP, RTMPS, Enhanced RTMP|AV1, H265, H264|MPEG-4 Audio (AAC), MPEG-2 Audio (MP3)| -|RTMP servers and cameras|RTMP, RTMPS, Enhanced RTMP|H264|MPEG-4 Audio (AAC), MPEG-2 Audio (MP3)| +|RTSP clients|UDP, TCP, RTSPS|AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, M-JPEG and any RTP-compatible codec|Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), G722, G711, LPCM and any RTP-compatible codec| +|RTSP servers and cameras|UDP, UDP-Multicast, TCP, RTSPS|AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, M-JPEG and any RTP-compatible codec|Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), G722, G711, LPCM and any RTP-compatible codec| +|RTMP clients (OBS Studio)|RTMP, RTMPS, Enhanced RTMP|AV1, H265, H264|MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3)| +|RTMP servers and cameras|RTMP, RTMPS, Enhanced RTMP|H264|MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3)| |HLS servers and cameras|Low-Latency HLS, MP4-based HLS, legacy HLS|H265, H264|Opus, MPEG-4 Audio (AAC)| |UDP/MPEG-TS streams|Unicast, broadcast, multicast|H265, H264|Opus, MPEG-4 Audio (AAC)| |Raspberry Pi Cameras||H264|| @@ -24,8 +24,8 @@ And can be read from the server with: |protocol|variants|video codecs|audio codecs| |--------|--------|------------|------------| |WebRTC|Browser-based, WHEP|AV1, VP9, VP8, H264|Opus, G722, G711| -|RTSP|UDP, UDP-Multicast, TCP, RTSPS|AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-2 Video, M-JPEG and any RTP-compatible codec|Opus, MPEG-4 Audio (AAC), MPEG-2 Audio (MP3), G722, G711, LPCM and any RTP-compatible codec| -|RTMP|RTMP, RTMPS, Enhanced RTMP|H264|MPEG-4 Audio (AAC), MPEG-2 Audio (MP3)| +|RTSP|UDP, UDP-Multicast, TCP, RTSPS|AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, M-JPEG and any RTP-compatible codec|Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), G722, G711, LPCM and any RTP-compatible codec| +|RTMP|RTMP, RTMPS, Enhanced RTMP|H264|MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3)| |HLS|Low-Latency HLS, MP4-based HLS, legacy HLS|H265, H264|Opus, MPEG-4 Audio (AAC)| Features: diff --git a/internal/core/rtmp_conn.go b/internal/core/rtmp_conn.go index cd81a15b..2c972b47 100644 --- a/internal/core/rtmp_conn.go +++ b/internal/core/rtmp_conn.go @@ -407,7 +407,7 @@ func (c *rtmpConn) runRead(ctx context.Context, u *url.URL) error { if videoFormat == nil && audioFormat == nil { return fmt.Errorf( - "the stream doesn't contain any supported codec, which are currently H264, MPEG-2 Audio, MPEG-4 Audio") + "the stream doesn't contain any supported codec, which are currently H264, MPEG-1/2 Audio, MPEG-4 Audio") } defer res.stream.readerRemove(c) @@ -655,7 +655,7 @@ func (c *rtmpConn) findAudioFormat(stream *stream, ringBuffer *ringbuffer.RingBu } if !(!h.MPEG2 && h.Layer == 3) { - return fmt.Errorf("RTMP only supports MPEG-1 audio layer 3") + return fmt.Errorf("RTMP only supports MPEG-1 layer 3 audio") } channels := uint8(flvio.SOUND_STEREO) diff --git a/internal/formatprocessor/mpeg2audio.go b/internal/formatprocessor/mpeg2audio.go index 446d7005..1bab0739 100644 --- a/internal/formatprocessor/mpeg2audio.go +++ b/internal/formatprocessor/mpeg2audio.go @@ -11,7 +11,7 @@ import ( "github.com/bluenviron/mediamtx/internal/logger" ) -// UnitMPEG2Audio is a MPEG-2 Audio data unit. +// UnitMPEG2Audio is a MPEG-1/2 Audio data unit. type UnitMPEG2Audio struct { RTPPackets []*rtp.Packet NTP time.Time diff --git a/internal/formatprocessor/processor.go b/internal/formatprocessor/processor.go index 4c9a7e60..133319db 100644 --- a/internal/formatprocessor/processor.go +++ b/internal/formatprocessor/processor.go @@ -19,7 +19,7 @@ type Processor interface { // cleans and normalizes a data unit. Process(Unit, bool) error - // returns an unit for the given RTP packet. + // wraps a RTP packet into a Unit. UnitForRTPPacket(pkt *rtp.Packet, ntp time.Time) Unit }