|
arduino-audio-tools
|
H.264 (AVC) format for RTSP video streaming, per RFC 6184. More...
#include <RTSPFormat.h>
Public Member Functions | |
| RTSPFormatH264 (int width=1280, int height=720, float framerate=15.0f) | |
| virtual AudioInfo | audioInfo () |
| virtual void | begin (AudioInfo info) |
| virtual void | begin (RTSPVideoInfo info) |
| virtual int | convert (void *data, int sampleCount) |
| AudioInfo | defaultConfig () override |
| RTSPVideoInfo | defaultVideoConfig () override |
| const char * | format (char *buffer, int len) override |
| virtual int | fragmentSize () |
| Fragment (=write) size in bytes. | |
| float | getFramerate () const |
| Get framerate. | |
| int | getHeight () const |
| Get video height. | |
| int | getWidth () const |
| Get video width. | |
| 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 video framerate. | |
| void | setName (const char *name) |
| Defines the name of the stream. | |
| void | setProfileLevelId (const char *hex6) override |
| void | setSpropParameterSets (const char *base64Sps, const char *base64Pps) override |
| void | setTimerPeriodUs (int period) |
| Defines the timer period in microseconds. | |
| virtual void | setUseRfc2250Header (bool) |
| Optional: Configure RFC2250 header usage (default: no-op) | |
| void | setVideoDimensions (int width, int height) |
| Set video dimensions. | |
| virtual int | timerPeriodUs () |
| Timer period in microseconds. | |
| int | timestampIncrement () override |
| Override timestamp increment for video (90kHz clock) | |
| virtual bool | useRfc2250Header () const |
| virtual RTSPVideoInfo | videoInfo () |
Protected Attributes | |
| AudioInfo | cfg {16000, 1, 16} |
| int | fragment_size = 640 |
| const char * | name_str = "RTSPAudioTools" |
| String | profile_level_id = "42E01E" |
| String | sprop_parameter_sets |
| 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 = 15.0f |
| int | video_height = 720 |
| int | video_width = 1280 |
H.264 (AVC) format for RTSP video streaming, per RFC 6184.
Unlike JPEG's static payload type 26, H.264 has no static RTP payload type, so this uses a dynamic one (96) with packetization-mode=1 (non-interleaved: single-NAL-unit packets plus FU-A fragmentation for large NALs, no STAP-A aggregation).
The sprop-parameter-sets/profile-level-id SDP attributes need the stream's actual SPS/PPS, but most H.264 encoders (including codec-h264-ESP32S3) only emit SPS/PPS embedded in the first encoded IDR frame - there is no way to query them ahead of time. H264RtpEncoder pushes them into this format via setSpropParameterSets()/setProfileLevelId() as soon as they become available; until then, format() simply omits those attributes. Conformant clients still work either way because H264RtpEncoder also (re-)sends SPS/PPS in-band before every IDR frame.
SDP format: m=video 0 RTP/AVP 96 a=rtpmap:96 H264/90000 a=fmtp:96 packetization-mode=1[;profile-level-id=...;sprop-parameter-sets=...]
|
inline |
|
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.
|
inlineoverridevirtual |
Reimplemented from RTSPFormat.
|
inlineoverridevirtual |
Implements RTSPFormat.
|
inlinevirtualinherited |
Fragment (=write) size in bytes.
Reimplemented in RTSPFormatMP3.
|
inline |
Get framerate.
|
inline |
Get video height.
|
inline |
Get video width.
|
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 video framerate.
|
inlineinherited |
Defines the name of the stream.
|
inlineoverridevirtual |
Called by H264RtpEncoder with the 3-byte profile-level-id (as 6 hex digits) parsed from the SPS.
Reimplemented from RTSPFormat.
|
inlineoverridevirtual |
Called by H264RtpEncoder once it has extracted SPS/PPS from the stream, so DESCRIBE responses can advertise sprop-parameter-sets.
Reimplemented from RTSPFormat.
|
inlineinherited |
Defines the timer period in microseconds.
|
inlinevirtualinherited |
Optional: Configure RFC2250 header usage (default: no-op)
Reimplemented in RTSPFormatMP3.
|
inline |
Set video dimensions.
|
inlinevirtualinherited |
Timer period in microseconds.
Reimplemented in RTSPFormatADPCM< AudioEncoder >, RTSPFormatMP3, and RTSPFormatMTS.
|
inlineoverridevirtual |
Override timestamp increment for video (90kHz clock)
Reimplemented from RTSPFormat.
|
inlinevirtualinherited |
Reimplemented in RTSPFormatMP3.
|
inlinevirtualinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protected |