MP4(3)

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

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

okay bestie, welcome to the MP4(3) page from the MP4 File Format Library. this one's about MP4AddTrackEdit, and yes it's giving main character energy for timeline edits. periodt. πŸ’…


✨ NAME ✨

MP4AddTrackEdit - Add an edit segment to a track. that's it, that's the function, and it's lowkey iconic. 🎬


🌸 SYNTAX 🌸

#include <mp4.h>

MP4TrackId MP4AddTrackEdit(
     MP4FileHandle hFile,
     MP4TrackId trackId,
     MP4EditId editId,
     MP4Timestamp startTime = 0,
     MP4Duration duration = 0,
     bool dwell = false
)

πŸŽ€ ARGUMENTS πŸŽ€

  • hFile β€” Specifies the mp4 file to which the operation applies. like, which file are we editing, bestie? πŸ“
  • trackId β€” Specifies the track to which the operation applies. which track? say it. 🎡
  • editId β€” Specifies the desired position in the edit list sequence for the new edit segment. If the value is MP4_INVALID_EDIT_ID, then the edit segment is added at the end of the existing edit list. Note editId's start with the value of 1, not 0. not me side-eyeing the 1-based indexing. πŸ™ˆ
  • startTime β€” Specifies the starting time of the edit segment in the track time scale. default is 0. ⏰
  • duration β€” Specifies the duration of the edit segment in the track time scale. default is 0. βŒ›
  • dwell β€” If false, the track media should be played at its normal rate. If true, the media should be paused for the duration of this edit segment. This is a mechanism by which one can delay the start of a media track. so dwell = true is basically "hold up, wait a minute" for your track. πŸ›‘

πŸ’« RETURN VALUES πŸ’«

Upon success, the edit id of the new edit segment. Upon an error, MP4_INVALID_EDIT_ID. so if it works you get a cute little id, if not you get the invalid vibe. πŸ’”


πŸ¦‹ DESCRIPTION πŸ¦‹

MP4AddTrackEdit adds an edit segment to the track edit list. simple as that.

The track edit list is a feature that allows creation of an alternate timeline for the track, typically cutting out segments of the full track to form an shorten, cleaned up version. yes, "an shorten" is in the original, we're not fixing it, we're respecting the source. 😌 The edit segments that form the edit list are a sequence of track start times and durations, they do not alter the track media in any way. I.e. no data can be lost via edit list operations. so you can cut and rearrange the timeline without losing the actual media, no cap. 🎞️

To read out the editted version of the track, use MP4ReadSampleFromEditTime() instead of MP4ReadSample(). "editted" spelling stays, periodt.

To export the editted version of the track to a new track, potentially in a new mp4 file, see MP4CopyTrack().

Note with many media encodings such as MPEG-4, AAC, and MP3, care must be taken when choosing the edit segment start times. E.g. for video tracks a reference or key frame should be selected as the starting sample of any edit segment. For audio tracks, an audio sample start time should be used. so basically, choose your start points wisely, bestie, or the vibe check will fail. ⚠️


πŸ”₯ SEE ALSO πŸ”₯


Cisco Systems Inc. Β· Version 0.9 Β· MP4(3)

that's the whole page, bestie. go forth and edit those tracks. πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from