MP4(3)

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

πŸ’– MP4FindTrackId β€” find a track id πŸ’–

okay bestie, welcome to the MP4 File Format Library manual page for MP4FindTrackId, and yes this is a <mp4.h> situation, we're doing C today, let's go ✨


🌸 NAME 🌸

MP4FindTrackId β€” Find a track id πŸŽ€


✨ SYNTAX ✨

#include <mp4.h>

MP4TrackId MP4FindTrackId(
     MP4FileHandle hFile,
     u_int16_t index,
     const char* type = NULL,
     u_int8_t subType = 0
)

like. the whole vibe. she's a function, she takes four things, she gives you a track id back. periodt πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • hFile β€” Specifies the mp4 file to which the operation applies. this is the file we're poking at, no file no function, iykyk πŸ™ˆ
  • index β€” Specifies which track is desired from matching tracks. so like... out of all the tracks that match, which one do you want? that's the one 🫢
  • type β€” Specifies the type of track to be matched. A NULL value implies any type of track. See MP4GetTrackType() for predefined values. leaving it as NULL is giving "i don't care, surprise me" energy 🌈
  • subType β€” Specifies the subtype of the track to be matched. Subtypes are only defined for audio and video tracks, see MP4GetAudioTrackType() and MP4GetVideoTrackType() for predefined values. A zero value implies any subtype. so 0 = no preference, i'm flexible bestie πŸ’œ

⭐ RETURN VALUES ⭐

Upon success, the track id of the specified track. πŸŽ‰

Upon an error, MP4_INVALID_TRACK_ID. πŸ’€

like. check your return value. please. not me begging. okay i'm begging a little.


πŸ‘‘ DESCRIPTION πŸ‘‘

MP4FindTrackId gets the track id associated with the index'th track of the specified track type. slay.

for example, to get the track id of the first video track:

MP4FindTrackId(hFile, 0, MP4_VIDEO_TRACK_TYPE);

okay and for audio and video tracks, a subtype can be specified to find a track of a particular encoding. cute right? for example, to get the track id of the first audio track encoded with MPEG-1 audio:

MP4FindTrackId(hFile, 0, MP4_AUDIO_TRACK_TYPE, MP4_MPEG1_AUDIO_TYPE);
Caveat: The track id's do not imply anything about the ordering of the track information within the mp4 file. bestie this is so important, do NOT assume track id 0 comes "first" in the file, that is not the lore, that is not the situation, that is not what's happening 😭 the numbers are just labels fr fr

🌈 SEE ALSO 🌈


and that's the whole page, you ate that, go find some tracks πŸ’…βœ¨

this iconic little number came to you from Cisco Systems Inc., Version 0.9 β€” mwah, take care of her πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from