MP4(3)
π MP4SetHintTrackRtpPayload β the MP4(3) page, bestie edition π
okay so you're here because you want the MP4 File Format Library to know how your hint track should pack its RTP payloads. this is that page. it's giving nerd, it's giving networking, it's giving lowkey iconic. let's go π
β¨ NAME β¨
MP4SetHintTrackRtpPayload β sets the RTP payload parameters of the hint track. yes bestie, that's literally the whole job and she does it beautifully π
πΈ SYNTAX πΈ
#include <mp4.h>
bool MP4SetHintTrackRtpPayload(
MP4FileHandle hFile,
MP4TrackId hintTrackId,
const char* pPayloadName,
u_int8_t* pPayloadNumber,
u_int16_t maxPayloadSize = 0
bool include_rtp_map = true
bool include_mpeg4_esid = true
)
look at her. seven arguments. no notes. π«Ά
π¦ ARGUMENTS π¦
hFileβ which mp4 file we're doing the operation on. that's the one, that's the file. β¨hintTrackIdβ which hint track we're doing the operation on. main character track energy only πpPayloadNameβ the RTP payload name. yes, we're naming the payload, she deserves a name.pPayloadNumberβ a pointer to the RTP payload number. pointer. as in it points. as in the library might write back through it πmaxPayloadSizeβ the biggest RTP payload size, in bytes. keep it cute, keep it small enough for the network πinclude_rtp_mapβ whether thea=rtpmapstatement gets included. yes or no, bestie, that's the vibe check.include_mpeg4_esidβ whether thea=mpeg4-esidstatement gets included. same energy π
β RETURN VALUES β
- Success?
true(1). π slay. - Error?
false(0). π not slay.
π DESCRIPTION π
MP4SetHintTrackRtpPayload sets the RTP payload parameters for the hint track. and what's an "RTP payload", you ask? it's the set of rules by which media samples are packed into RTP packets. that's it. that's the whole definition. rules for stuffing media into packets. periodt.
the payload name identifies which RTP payload is being used for the RTP packets created from the hint track. this value gets sent to the receiver in the SDP description. for example: MP3 audio sent according to the rules in IETF RFC 2250 uses the name "MPA" for the RTP payload. so that's the whole name thing, fr fr.
the payload number is a shorter form of the payload name. it gets associated with the payload name in the SDP description, and then it's sent in every single RTP packet. the rules on numbers, listen up:
- payload numbers
1thru95are statically assigned in IETF RFC 1890 π§ - numbers
96thru127are dynamically assigned within a session π
if the RTP payload in use is one of the statically assigned ones, you should pass this value to the library. if you need a dynamic payload number assigned, pass the define value MP4_SET_DYNAMIC_PAYLOAD for this parameter, and the library will choose a valid available number and return this value. so like, the library picks for you. she's got you π«Ά
the maxPayloadSize specifies the maximum number of bytes that should be placed in the RTP payload section of the RTP packets. and the why is so real: it's desirable that RTP packets not exceed the maximum transmission unit (MTU) of the IP network they travel over. because otherwise?? the packets must be fragmented at the IP level, which consumes router resources and can lead to less robust behavior in the face of packet loss. π do not do that to the routers. they're tired.
the default value for maxPayloadSize is 1460, which is the MTU for an Ethernet or similar network minus the standard sizes of the IP, UDP, and RTP headers. here's the math, bestie, it's literally:
1500 - 20 - 8 - 12 = 1460
β¨ ate. no crumbs. β¨
if you anticipate streaming over IP networks with smaller MTU sizes, or that extensions to the network headers might be used, a more conservative value should be chosen. and btw, the minimum MTU for an IP network is 576 bytes. remember that number, it's important π
π SEE ALSO π
MP4(3)MP4GetHintTrackPayload(3)
go read those too, they're the supporting cast and they serve π
and that's the page, bestie!! you understood it, i understood it, we all understood it. the hint track's RTP payload params are now officially set. πΈ
this little manual page came to you from Cisco Systems Inc., rockin' Version 0.9, dated in the classic MP4(3) way β mwah, kisses, bye!! πβ¨π
π¦ where this page comes from
- fedora 43: libmp4v2-devel 2.1.0-0.34.trunkREV507.fc43 Β· LicenseRef-Callaway-MPLv1.1
- fedora 43: libmp4v2-devel 2.1.0-0.34.trunkREV507.fc43 Β· LicenseRef-Callaway-MPLv1.1
- fedora 44: libmp4v2-devel 2.1.0-0.35.trunkREV507.fc44 Β· LicenseRef-Callaway-MPLv1.1
- fedora 44: libmp4v2-devel 2.1.0-0.35.trunkREV507.fc44 Β· LicenseRef-Callaway-MPLv1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms