|
arduino-audio-tools
|
MPEG-2 Transport Stream (MP2T) format for RTSP streaming of a pre-muxed audio+video container, per RFC 2250. More...
#include <RTSPFormat.h>
Public Member Functions | |
| RTSPFormatMTS (float framerate=25.0f) | |
| virtual AudioInfo | audioInfo () |
| virtual void | begin (AudioInfo info) |
| virtual void | begin (RTSPVideoInfo info) |
| virtual int | convert (void *data, int sampleCount) |
| AudioInfo | defaultConfig () override |
| virtual RTSPVideoInfo | defaultVideoConfig () |
| const char * | format (char *buffer, int len) override |
| virtual int | fragmentSize () |
| Fragment (=write) size in bytes. | |
| MediaType | mediaType () override |
| Override media type for video. | |
| virtual const char * | name () |
| virtual int | readHeader (uint8_t *data) |
| Optional header: e.g. rfc2250. | |
| int | rtpPayloadType () override |
| default dynamic | |
| void | setFragmentSize (int fragmentSize) |
| Defines the fragment size in bytes. | |
| void | setFramerate (float fps) |
| Set the fragment pacing rate (see constructor note) | |
| void | setName (const char *name) |
| Defines the name of the stream. | |
| virtual void | setProfileLevelId (const char *) |
| virtual void | setSpropParameterSets (const char *, const char *) |
| void | setTimerPeriodUs (int period) |
| Defines the timer period in microseconds. | |
| virtual void | setUseRfc2250Header (bool) |
| Optional: Configure RFC2250 header usage (default: no-op) | |
| int | timerPeriodUs () override |
| Timer period in microseconds. | |
| virtual int | timestampIncrement () |
| Fragment size in samples (for audio) or timestamp increment (for video) | |
| virtual bool | useRfc2250Header () const |
| virtual RTSPVideoInfo | videoInfo () |
Protected Attributes | |
| AudioInfo | cfg {16000, 1, 16} |
| int | fragment_size = 640 |
| const char * | name_str = "RTSPAudioTools" |
| const char * | STD_URL_PRE_SUFFIX = "trackID" |
| int | timer_period_us = 10000 |
| RTSPVideoInfo | video_cfg {640, 480, 30.0f, RTSPVideoFormat::MJPEG, 24} |
| float | video_framerate = 25.0f |
MPEG-2 Transport Stream (MP2T) format for RTSP streaming of a pre-muxed audio+video container, per RFC 2250.
All the other RTSPFormat subclasses carry a single elementary stream, so a server needs one RTSPServer/RTSPMediaStreamer instance per media type (audio, video) - there is no multi-track SDP support (no way to combine separate m=audio/m=video lines into one session). Muxing audio and video into MPEG-TS first (e.g. with MuxerMTS, see ContainerMTS.h) and streaming that as MP2T sidesteps the issue entirely: the interleaved, PTS-synced container travels as a single "m=video ... RTP/AVP 33" track that any RTSP client already knows how to demux into its two streams - no RTSP/SDP changes needed.
Payload type 33 is static (RFC 3551), so no a=rtpmap is required. The source feeding this format needs no per-fragment RTP header beyond the generic one RTSPMediaStreamer already adds - just chunk the muxed byte stream to a whole number of 188-byte TS packets via setFragmentSize() (e.g. 7 * 188 = 1316 bytes, comfortably under a typical 1500-byte MTU).
SDP format: m=video 0 RTP/AVP 33
|
inline |
| framerate | Only used to pace how often one RTP fragment is sent (timerPeriodUs()) - unrelated to the muxed stream's own frame rate, which MPEG-TS carries internally via PCR/PTS. |
|
inlinevirtualinherited |
Reimplemented in RTSPFormatMP3, and RTSPFormatADPCM< AudioEncoder >.
|
inlinevirtualinherited |
Reimplemented in RTSPFormatPCM, RTSPFormatOpus, RTSPFormatAbtX, RTSPFormatPCM8, RTSPFormatADPCM< AudioEncoder >, RTSPFormatMP3, and RTSPFormatAAC.
|
inlinevirtualinherited |
|
inlinevirtualinherited |
Reimplemented in RTSPFormatPCM.
|
inlineoverridevirtual |
Implements RTSPFormat.
|
inlinevirtualinherited |
Reimplemented in RTSPFormatMJPEG, and RTSPFormatH264.
|
inlineoverridevirtual |
Implements RTSPFormat.
|
inlinevirtualinherited |
Fragment (=write) size in bytes.
Reimplemented in RTSPFormatMP3.
|
inlineoverridevirtual |
Override media type for video.
Reimplemented from RTSPFormat.
|
inlinevirtualinherited |
|
inlinevirtualinherited |
Optional header: e.g. rfc2250.
|
inlineoverridevirtual |
default dynamic
Reimplemented from RTSPFormat.
|
inlineinherited |
Defines the fragment size in bytes.
|
inline |
Set the fragment pacing rate (see constructor note)
|
inlineinherited |
Defines the name of the stream.
|
inlinevirtualinherited |
Optional: receives the 3-byte profile-level-id (as 6 hex digits) once an encoder has parsed it from the SPS. Default no-op; only RTSPFormatH264 acts on it.
Reimplemented in RTSPFormatH264.
|
inlinevirtualinherited |
Optional: receives base64-encoded SPS/PPS once an encoder has learned them (H.264 sprop-parameter-sets). Default no-op; only RTSPFormatH264 acts on it. Declared here (rather than only on RTSPFormatH264) so video encoders (see RTSPVideoEncoder) can push this through a generic RTSPFormat* without needing to know the concrete format type.
Reimplemented in RTSPFormatH264.
|
inlineinherited |
Defines the timer period in microseconds.
|
inlinevirtualinherited |
Optional: Configure RFC2250 header usage (default: no-op)
Reimplemented in RTSPFormatMP3.
|
inlineoverridevirtual |
Timer period in microseconds.
Reimplemented from RTSPFormat.
|
inlinevirtualinherited |
Fragment size in samples (for audio) or timestamp increment (for video)
Reimplemented in RTSPFormatMP3, RTSPFormatMJPEG, and RTSPFormatH264.
|
inlinevirtualinherited |
Reimplemented in RTSPFormatMP3.
|
inlinevirtualinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |