MP4(3)

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

πŸ’– MP4(3) β€” the MP4 File Format Library girlies' guide πŸ’–

okay so bestie, welcome to the MP4 File Format Library manual β€” this is section 3 of the manual, and today's main character is a lil function called MP4GetRtpTimestampStart. buckle up πŸŽ€


✨ NAME ✨

MP4GetRtpTimestampStart β€” get the RTP start time of a hint track πŸ¦‹


🌸 SYNTAX 🌸

#include <mp4.h>

MP4Timestamp MP4GetRtpTimestampStart(
     MP4FileHandle hFile,
     MP4TrackId hintTrackId
);

like, that's the whole vibe. two args, one return, no notes πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • hFile β€” specifies the mp4 file to which the operation applies. which file are we doing this to, bestie? this one. πŸ“
  • trackId β€” specifies the hint track to which the operation applies. which track? this one. (yes the syntax calls it hintTrackId, the docs call it trackId, we don't ask questions, we just pass the hint track id πŸ’€)

🫢 RETURN VALUES 🫢

upon success, you get the RTP start time in the RTP time scale β€” and lowkey that time scale is identical to the hint track time scale, so no conversion drama, we love that for us ✨

upon an error, you get MP4_INVALID_TIMESTAMP. that's the "nope, not today" value 😭


πŸ’œ DESCRIPTION πŸ’œ

so MP4GetRtpTimestampStart returns the RTP timestamp start of the hint track you specified. and bestie, typically this is a random value that gets chosen when the very first RTP packet is constructed by the MP4 library. it's giving spontaneous, it's giving unpredictable 🎲

BUT. the value can also be set explicitly for the hint track and stored. and typically that's what you do if you want those timestamps to start at zero. zero girlies rise πŸ‘‘

why do you even need this value? because an application needs it in order to construct RTCP Sender Reports that relate the hint track time to a real time clock. and the mp4broadcaster test program that ships with the MP4 library? yeah, that's the example of this exact thing. go look at it, it ate πŸ”₯

and if you want the full lore on RTP timestamps and RTCP, see IETF RFC 1889. required reading, no cap πŸ“š


🌈 SEE ALSO 🌈


πŸ’‘ heads up bestie: this is the getter. if you wanna set that start time yourself, that's MP4SetRtpTimestampStart(3). they're a matching set, iykyk πŸ’–

Cisco Systems Inc. Β· Version 0.9 Β· and yeah this whole thing lives in section MP4(3) of the manual. mwah, that's the page, periodt πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from