MP4(3)

πŸ“¦ version 2.1.0, in fedora 43, fedora 44

πŸ’– 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 the a=rtpmap statement gets included. yes or no, bestie, that's the vibe check.
  • include_mpeg4_esid β€” whether the a=mpeg4-esid statement 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 1 thru 95 are statically assigned in IETF RFC 1890 🧚
  • numbers 96 thru 127 are 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