MP4(3)

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

πŸ’– MP4(3) β€” MP4 File Format Library πŸ’–

okay bestie, sit down, hydrate, and let me tell you about MP4GetHintTrackRtpPayload β€” one lil function from the MP4 File Format Library (that's the MP4(3) manual, iykyk) and she is so useful.


✨ NAME ✨

MP4GetHintTrackRtpPayload β€” get the RTP payload parameters of the hint track. that's it, that's the job, and she does it flawlessly πŸ’…


🌸 SYNTAX 🌸

#include <mp4.h>

bool MP4GetHintTrackRtpPayload(
     MP4FileHandle hFile,
     MP4TrackId hintTrackId,
     char** ppPayloadName = NULL,
     u_int8_t* pPayloadNumber = NULL,
     u_int16_t* pMaxPayloadSize = NULL
)

look at her. so clean. so structured. the last three args even come with = NULL defaults because she's generous like that 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • hFile β€” the mp4 file we're doing the operation on. which file? this file bestie, you point at it πŸ’β€β™€οΈ
  • hintTrackId β€” the hint track we're doing the operation on. again: which one? this one, queen.
  • ppPayloadName β€” a pointer to the variable that's gonna receive the RTP payload name string. it's a pointer to a pointer, yes, we're being fancy ✨
  • pPayloadNumber β€” a pointer to the variable that's gonna receive the RTP payload number.
  • pMaxPayloadSize β€” a pointer to the variable that's gonna receive the maximum RTP payload size, in bytes.

πŸ¦‹ RETURN VALUES πŸ¦‹

  • Slayed successfully? β†’ true (1) πŸŽ‰
  • Something went wrong? β†’ false (0) 😭

πŸ‘‘ DESCRIPTION πŸ‘‘

So. MP4GetHintTrackRtpPayload grabs the RTP payload parameters for the hint track. and what even is an RTP payload, you ask? it's literally the set of rules for how media samples get packed into RTP packets. that's the whole vibe. this call is typically used when you're constructing the SDP media level description for the hint track β€” like, that's her moment, that's her main character era.

The payloadName tells you which RTP payload is being used for the RTP packets that get created from the hint track. this value gets sent to the receiver in the SDP description. for example (and this one's iconic): MP3 audio sent according to the rules in IETF RFC 2250 uses the name "MPA" for the RTP payload. yes bestie, "MPA". not "MP3". we don't make the rules, the RFC does.

The payloadNumber is basically the glow-up short-form of the payloadName. it gets associated with the payload name in the SDP description, and then it's sent in every single RTP packet. no skips. the ranges, memorise them:

  • payload numbers 1 thru 95 β€” statically assigned in IETF RFC 1890 (these are the pre-approved girlies)
  • payload numbers 96 thru 127 β€” dynamically assigned within a session (these get their assignment in real time, very spontaneous of them)

The maxPayloadSize specifies the maximum number of bytes that should be placed in the RTP payload section of the RTP packets. respect the limit or she will not be happy πŸ’€


🌈 SEE ALSO 🌈

  • MP4(3)
  • MP4SetHintTrackPayload(3)

and that's the whole page, bestie!! this lil gem was brought to you by Cisco Systems Inc., rocking Version 0.9 of the MP4 File Format Library. go forth and construct those SDP descriptions, you absolute legend πŸ§šβœ¨πŸ’–

πŸ“¦ where this page comes from