include/mp4v2/track.h Source File
track.h
1 #ifndef MP4V2_TRACK_H
2 #define MP4V2_TRACK_H
3 
4 /**************************************************************************/
28 MP4V2_EXPORT
29 MP4TrackId MP4AddTrack(
30  MP4FileHandle hFile,
31  const char* type,
32  uint32_t timeScale DEFAULT(MP4_MSECS_TIME_SCALE) );
33 
52 MP4V2_EXPORT
53 MP4TrackId MP4AddSystemsTrack(
54  MP4FileHandle hFile,
55  const char* type );
56 
73 MP4V2_EXPORT
74 MP4TrackId MP4AddODTrack(
75  MP4FileHandle hFile );
76 
93 MP4V2_EXPORT
94 MP4TrackId MP4AddSceneTrack(
95  MP4FileHandle hFile );
96 
120 MP4V2_EXPORT
121 MP4TrackId MP4AddAudioTrack(
122  MP4FileHandle hFile,
123  uint32_t timeScale,
124  MP4Duration sampleDuration,
125  uint8_t audioType DEFAULT(MP4_MPEG4_AUDIO_TYPE) );
126 
138 MP4V2_EXPORT
140  MP4FileHandle hFile,
141  uint32_t timeScale);
142 
154 MP4V2_EXPORT
156  MP4FileHandle hFile,
157  uint32_t timeScale);
158 
159 MP4V2_EXPORT
160 MP4TrackId MP4AddAC3AudioTrack(
161  MP4FileHandle hFile,
162  uint32_t samplingRate,
163  uint8_t fscod,
164  uint8_t bsid,
165  uint8_t bsmod,
166  uint8_t acmod,
167  uint8_t lfeon,
168  uint8_t bit_rate_code );
169 
170 MP4V2_EXPORT
171 MP4TrackId MP4AddAmrAudioTrack(
172  MP4FileHandle hFile,
173  uint32_t timeScale,
174  uint16_t modeSet,
175  uint8_t modeChangePeriod,
176  uint8_t framesPerSample,
177  bool isAmrWB );
178 
179 MP4V2_EXPORT
180 void MP4SetAmrVendor(
181  MP4FileHandle hFile,
182  MP4TrackId trackId,
183  uint32_t vendor );
184 
185 MP4V2_EXPORT
186 void MP4SetAmrDecoderVersion(
187  MP4FileHandle hFile,
188  MP4TrackId trackId,
189  uint8_t decoderVersion );
190 
191 MP4V2_EXPORT
192 void MP4SetAmrModeSet(
193  MP4FileHandle hFile,
194  MP4TrackId trakId,
195  uint16_t modeSet );
196 
197 MP4V2_EXPORT
198 uint16_t MP4GetAmrModeSet(
199  MP4FileHandle hFile,
200  MP4TrackId trackId );
201 
202 MP4V2_EXPORT
203 MP4TrackId MP4AddHrefTrack(
204  MP4FileHandle hFile,
205  uint32_t timeScale,
206  MP4Duration sampleDuration,
207  const char* base_url DEFAULT(NULL) );
208 
209 MP4V2_EXPORT
210 const char* MP4GetHrefTrackBaseUrl(
211  MP4FileHandle hFile,
212  MP4TrackId trackId );
213 
240 MP4V2_EXPORT
241 MP4TrackId MP4AddVideoTrack(
242  MP4FileHandle hFile,
243  uint32_t timeScale,
244  MP4Duration sampleDuration,
245  uint16_t width,
246  uint16_t height,
247  uint8_t videoType DEFAULT(MP4_MPEG4_VIDEO_TYPE) );
248 
249 MP4V2_EXPORT
250 MP4TrackId MP4AddH264VideoTrack(
251  MP4FileHandle hFile,
252  uint32_t timeScale,
253  MP4Duration sampleDuration,
254  uint16_t width,
255  uint16_t height,
256  uint8_t AVCProfileIndication,
257  uint8_t profile_compat,
258  uint8_t AVCLevelIndication,
259  uint8_t sampleLenFieldSizeMinusOne );
260 
261 MP4V2_EXPORT
262 void MP4AddH264SequenceParameterSet(
263  MP4FileHandle hFile,
264  MP4TrackId trackId,
265  const uint8_t* pSequence,
266  uint16_t sequenceLen );
267 
268 MP4V2_EXPORT
269 void MP4AddH264PictureParameterSet(
270  MP4FileHandle hFile,
271  MP4TrackId trackId,
272  const uint8_t* pPict,
273  uint16_t pictLen );
274 
275 MP4V2_EXPORT
276 void MP4SetH263Vendor(
277  MP4FileHandle hFile,
278  MP4TrackId trackId,
279  uint32_t vendor );
280 
281 MP4V2_EXPORT
282 void MP4SetH263DecoderVersion(
283  MP4FileHandle hFile,
284  MP4TrackId trackId,
285  uint8_t decoderVersion );
286 
287 MP4V2_EXPORT
288 void MP4SetH263Bitrates(
289  MP4FileHandle hFile,
290  MP4TrackId trackId,
291  uint32_t avgBitrate,
292  uint32_t maxBitrate );
293 
294 MP4V2_EXPORT
295 MP4TrackId MP4AddH263VideoTrack(
296  MP4FileHandle hFile,
297  uint32_t timeScale,
298  MP4Duration sampleDuration,
299  uint16_t width,
300  uint16_t height,
301  uint8_t h263Level,
302  uint8_t h263Profile,
303  uint32_t avgBitrate,
304  uint32_t maxBitrate );
305 
329 MP4V2_EXPORT
330 MP4TrackId MP4AddHintTrack(
331  MP4FileHandle hFile,
332  MP4TrackId refTrackId );
333 
334 MP4V2_EXPORT
335 MP4TrackId MP4AddTextTrack(
336  MP4FileHandle hFile,
337  MP4TrackId refTrackId );
338 
339 MP4V2_EXPORT
340 MP4TrackId MP4AddSubtitleTrack(
341  MP4FileHandle hFile,
342  uint32_t timescale,
343  uint16_t width,
344  uint16_t height );
345 
346 MP4V2_EXPORT
347 MP4TrackId MP4AddSubpicTrack(
348  MP4FileHandle hFile,
349  uint32_t timescale,
350  uint16_t width,
351  uint16_t height );
352 
353 MP4V2_EXPORT
354 MP4TrackId MP4AddPixelAspectRatio(
355  MP4FileHandle hFile,
356  MP4TrackId refTrackId,
357  uint32_t hSpacing,
358  uint32_t vSpacing );
359 
360 MP4V2_EXPORT
361 MP4TrackId MP4AddColr(
362  MP4FileHandle hFile,
363  MP4TrackId refTrackId,
364  uint16_t primary,
365  uint16_t transfer,
366  uint16_t matrix );
367 
368 MP4V2_EXPORT
369 MP4TrackId MP4CloneTrack(
370  MP4FileHandle srcFile,
371  MP4TrackId srcTrackId,
372  MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE),
373  MP4TrackId dstHintTrackReferenceTrack DEFAULT(MP4_INVALID_TRACK_ID) );
374 
375 MP4V2_EXPORT
376 MP4TrackId MP4CopyTrack(
377  MP4FileHandle srcFile,
378  MP4TrackId srcTrackId,
379  MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE),
380  bool applyEdits DEFAULT(false),
381  MP4TrackId dstHintTrackReferenceTrack DEFAULT(MP4_INVALID_TRACK_ID) );
382 
383 MP4V2_EXPORT
384 bool MP4DeleteTrack(
385  MP4FileHandle hFile,
386  MP4TrackId trackId );
387 
388 MP4V2_EXPORT
389 uint32_t MP4GetNumberOfTracks(
390  MP4FileHandle hFile,
391  const char* type DEFAULT(NULL),
392  uint8_t subType DEFAULT(0) );
393 
394 MP4V2_EXPORT
395 MP4TrackId MP4FindTrackId(
396  MP4FileHandle hFile,
397  uint16_t index,
398  const char* type DEFAULT(NULL),
399  uint8_t subType DEFAULT(0) );
400 
401 MP4V2_EXPORT
402 uint16_t MP4FindTrackIndex(
403  MP4FileHandle hFile,
404  MP4TrackId trackId );
405 
416 MP4V2_EXPORT
418  MP4FileHandle hFile,
419  MP4TrackId trackId,
420  MP4Duration* duration );
421 
432 MP4V2_EXPORT
434  MP4FileHandle hFile,
435  MP4TrackId trackId,
436  MP4Duration duration );
437 
444 MP4V2_EXPORT
446  MP4FileHandle hFile,
447  MP4TrackId trackId );
448 
451 #endif /* MP4V2_TRACK_H */
MP4AddODTrack
MP4TrackId MP4AddODTrack(MP4FileHandle hFile)
Add a object descriptor (OD) track.
MP4AddALawAudioTrack
MP4TrackId MP4AddALawAudioTrack(MP4FileHandle hFile, uint32_t timeScale)
Add alaw track to mp4 file.
MP4GetTrackDurationPerChunk
bool MP4GetTrackDurationPerChunk(MP4FileHandle hFile, MP4TrackId trackId, MP4Duration *duration)
Get maximum duration of chunk.
MP4AddAudioTrack
MP4TrackId MP4AddAudioTrack(MP4FileHandle hFile, uint32_t timeScale, MP4Duration sampleDuration, uint8_t audioType=MP4_MPEG4_AUDIO_TYPE)
Add audio track to mp4 file.
MP4AddULawAudioTrack
MP4TrackId MP4AddULawAudioTrack(MP4FileHandle hFile, uint32_t timeScale)
Add ulaw track to mp4 file.
MP4AddIPodUUID
bool MP4AddIPodUUID(MP4FileHandle hFile, MP4TrackId trackId)
MP4_INVALID_TRACK_ID
#define MP4_INVALID_TRACK_ID
Constant: invalid MP4TrackId.
Definition: general.h:49
MP4AddSceneTrack
MP4TrackId MP4AddSceneTrack(MP4FileHandle hFile)
Add a scene (BIFS) track.
MP4_INVALID_FILE_HANDLE
#define MP4_INVALID_FILE_HANDLE
Constant: invalid MP4FileHandle.
Definition: general.h:48
MP4AddSystemsTrack
MP4TrackId MP4AddSystemsTrack(MP4FileHandle hFile, const char *type)
Add an MPEG-4 systems track.
MP4AddTrack
MP4TrackId MP4AddTrack(MP4FileHandle hFile, const char *type, uint32_t timeScale=MP4_MSECS_TIME_SCALE)
Add a user defined track.
MP4AddHintTrack
MP4TrackId MP4AddHintTrack(MP4FileHandle hFile, MP4TrackId refTrackId)
Add a hint track.
MP4AddVideoTrack
MP4TrackId MP4AddVideoTrack(MP4FileHandle hFile, uint32_t timeScale, MP4Duration sampleDuration, uint16_t width, uint16_t height, uint8_t videoType=MP4_MPEG4_VIDEO_TYPE)
Add a video track.
MP4SetTrackDurationPerChunk
bool MP4SetTrackDurationPerChunk(MP4FileHandle hFile, MP4TrackId trackId, MP4Duration duration)
Set maximum duration of chunk.