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