1MP4(3)                      MP4 File Format Library                     MP4(3)
2
3
4

NAME

6       MP4AddTrackEdit - Add an edit segment to a track
7

SYNTAX

9       #include <mp4.h>
10
11       MP4TrackId MP4AddTrackEdit(
12            MP4FileHandle hFile,
13            MP4TrackId trackId,
14            MP4EditId editId,
15            MP4Timestamp startTime = 0,
16            MP4Duration duration = 0,
17            bool dwell = false
18       )
19

ARGUMENTS

21       hFile  Specifies the mp4 file to which the operation applies.
22
23       trackId
24              Specifies the track to which the operation applies.
25
26       editId Specifies the desired position in the edit list sequence for the
27              new edit segment. If the value is MP4_INVALID_EDIT_ID, then  the
28              edit segment is added at the end of the existing edit list. Note
29              editId's start with the value of 1, not 0.
30
31       startTime
32              Specifies the starting time of the edit  segment  in  the  track
33              time scale.
34
35       duration
36              Specifies  the  duration  of  the edit segment in the track time
37              scale.
38
39       dwell  If false, the track media should be played at its  normal  rate.
40              If  true,  the  media  should be paused for the duration of this
41              edit segment. This is a mechanism by which  one  can  delay  the
42              start of a media track.
43
44

RETURN VALUES

46       Upon  success,  the  edit  id  of  the new edit segment. Upon an error,
47       MP4_INVALID_EDIT_ID.
48
49

DESCRIPTION

51       MP4AddTrackEdit adds an edit segment to the track edit list.
52
53       The track edit list is a feature that allows creation of  an  alternate
54       timeline  for  the  track,  typically  cutting out segments of the full
55       track to form an shorten, cleaned up version. The  edit  segments  that
56       form  the  edit list are a sequence of track start times and durations,
57       they do not alter the track media in any way. I.e. no data can be  lost
58       via edit list operations.
59
60       To  read  out  the  editted  version  of  the track, use MP4ReadSample‐
61       FromEditTime() instead of MP4ReadSample().
62
63       To export the editted version of the track to a new track,  potentially
64       in a new mp4 file, see MP4CopyTrack().
65
66       Note  with many media encodings such as MPEG-4, AAC, and MP3, care must
67       be taken when choosing the edit segment start  times.  E.g.  for  video
68       tracks a reference or key frame should be selected as the starting sam‐
69       ple of any edit segment. For audio tracks, an audio sample  start  time
70       should be used.
71
72
73

SEE ALSO

75       MP4(3)   MP4DeleteTrackEdit(3)   MP4ReadSampleFromEditTime(3)  MP4Copy‐
76       Track(3)
77
78
79
80Cisco Systems Inc.                Version 0.9                           MP4(3)
Impressum