MP4CloneTrack - Man Page

Make a clone of a specified track


#include <mp4.h>

MP4TrackId MP4CloneTrack(
MP4FileHandle srcFile,
MP4TrackId srcTrackId,
MP4FileHandle dstFile = MP4_INVALID_FILE_HANDLE,
MP4TrackId dstHintTrackReferenceTrack = MP4_INVALID_TRACK_ID



Specifies the mp4 file of the source track of the operation.


Specifies the track id of the track to be cloned.


Specifies the mp4 file of the new, cloned track. If the value is MP4_INVALID_FILE_HANDLE, the new track is created in the same file as the source track.


When cloning a hint track, this parameter specifies the track id of the reference track in the destination file.

Return Values

Upon success, the track id of the new track. Upon an error, MP4_INVALID_TRACK_ID.


MP4CloneTrack creates a new track to an mp4 file that is a copy of an existing track with respect to the track media type, and other control information.

Note this function does not copy the media samples of the source track to the new track. If you want to do that use MP4CopyTrack() instead.

See Also

MP4(3) MP4CopyTrack(3)

Referenced By


Version 0.9 Cisco Systems Inc. MP4 File Format Library