MP4v2
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
53MP4V2_EXPORT
55 MP4FileHandle hFile,
56 const char* type );
57
74MP4V2_EXPORT
75MP4TrackId MP4AddODTrack(
76 MP4FileHandle hFile );
77
94MP4V2_EXPORT
96 MP4FileHandle hFile );
97
121MP4V2_EXPORT
123 MP4FileHandle hFile,
124 uint32_t timeScale,
125 MP4Duration sampleDuration,
126 uint8_t audioType DEFAULT(MP4_MPEG4_AUDIO_TYPE) );
127
139MP4V2_EXPORT
141 MP4FileHandle hFile,
142 uint32_t timeScale);
143
155MP4V2_EXPORT
157 MP4FileHandle hFile,
158 uint32_t timeScale);
159
160MP4V2_EXPORT
161MP4TrackId MP4AddAC3AudioTrack(
162 MP4FileHandle hFile,
163 uint32_t samplingRate,
164 uint8_t fscod,
165 uint8_t bsid,
166 uint8_t bsmod,
167 uint8_t acmod,
168 uint8_t lfeon,
169 uint8_t bit_rate_code );
170
171MP4V2_EXPORT
172MP4TrackId MP4AddAmrAudioTrack(
173 MP4FileHandle hFile,
174 uint32_t timeScale,
175 uint16_t modeSet,
176 uint8_t modeChangePeriod,
177 uint8_t framesPerSample,
178 bool isAmrWB );
179
180MP4V2_EXPORT
181void MP4SetAmrVendor(
182 MP4FileHandle hFile,
183 MP4TrackId trackId,
184 uint32_t vendor );
185
186MP4V2_EXPORT
187void MP4SetAmrDecoderVersion(
188 MP4FileHandle hFile,
189 MP4TrackId trackId,
190 uint8_t decoderVersion );
191
192MP4V2_EXPORT
193void MP4SetAmrModeSet(
194 MP4FileHandle hFile,
195 MP4TrackId trakId,
196 uint16_t modeSet );
197
198MP4V2_EXPORT
199uint16_t MP4GetAmrModeSet(
200 MP4FileHandle hFile,
201 MP4TrackId trackId );
202
203MP4V2_EXPORT
204MP4TrackId MP4AddHrefTrack(
205 MP4FileHandle hFile,
206 uint32_t timeScale,
207 MP4Duration sampleDuration,
208 const char* base_url DEFAULT(NULL) );
209
210MP4V2_EXPORT
211const char* MP4GetHrefTrackBaseUrl(
212 MP4FileHandle hFile,
213 MP4TrackId trackId );
214
241MP4V2_EXPORT
243 MP4FileHandle hFile,
244 uint32_t timeScale,
245 MP4Duration sampleDuration,
246 uint16_t width,
247 uint16_t height,
248 uint8_t videoType DEFAULT(MP4_MPEG4_VIDEO_TYPE) );
249
250MP4V2_EXPORT
251MP4TrackId MP4AddH264VideoTrack(
252 MP4FileHandle hFile,
253 uint32_t timeScale,
254 MP4Duration sampleDuration,
255 uint16_t width,
256 uint16_t height,
257 uint8_t AVCProfileIndication,
258 uint8_t profile_compat,
259 uint8_t AVCLevelIndication,
260 uint8_t sampleLenFieldSizeMinusOne );
261
262MP4V2_EXPORT
263void MP4AddH264SequenceParameterSet(
264 MP4FileHandle hFile,
265 MP4TrackId trackId,
266 const uint8_t* pSequence,
267 uint16_t sequenceLen );
268
269MP4V2_EXPORT
270void MP4AddH264PictureParameterSet(
271 MP4FileHandle hFile,
272 MP4TrackId trackId,
273 const uint8_t* pPict,
274 uint16_t pictLen );
275
276MP4V2_EXPORT
277void MP4SetH263Vendor(
278 MP4FileHandle hFile,
279 MP4TrackId trackId,
280 uint32_t vendor );
281
282MP4V2_EXPORT
283void MP4SetH263DecoderVersion(
284 MP4FileHandle hFile,
285 MP4TrackId trackId,
286 uint8_t decoderVersion );
287
288MP4V2_EXPORT
289void MP4SetH263Bitrates(
290 MP4FileHandle hFile,
291 MP4TrackId trackId,
292 uint32_t avgBitrate,
293 uint32_t maxBitrate );
294
295MP4V2_EXPORT
296MP4TrackId MP4AddH263VideoTrack(
297 MP4FileHandle hFile,
298 uint32_t timeScale,
299 MP4Duration sampleDuration,
300 uint16_t width,
301 uint16_t height,
302 uint8_t h263Level,
303 uint8_t h263Profile,
304 uint32_t avgBitrate,
305 uint32_t maxBitrate );
306
330MP4V2_EXPORT
332 MP4FileHandle hFile,
333 MP4TrackId refTrackId );
334
335MP4V2_EXPORT
336MP4TrackId MP4AddTextTrack(
337 MP4FileHandle hFile,
338 MP4TrackId refTrackId );
339
340MP4V2_EXPORT
341MP4TrackId MP4AddSubtitleTrack(
342 MP4FileHandle hFile,
343 uint32_t timescale,
344 uint16_t width,
345 uint16_t height );
346
347MP4V2_EXPORT
348MP4TrackId MP4AddSubpicTrack(
349 MP4FileHandle hFile,
350 uint32_t timescale,
351 uint16_t width,
352 uint16_t height );
353
354MP4V2_EXPORT
355MP4TrackId MP4AddPixelAspectRatio(
356 MP4FileHandle hFile,
357 MP4TrackId refTrackId,
358 uint32_t hSpacing,
359 uint32_t vSpacing );
360
361MP4V2_EXPORT
362MP4TrackId MP4AddColr(
363 MP4FileHandle hFile,
364 MP4TrackId refTrackId,
365 uint16_t primary,
366 uint16_t transfer,
367 uint16_t matrix );
368
391MP4V2_EXPORT
392MP4TrackId MP4CloneTrack(
393 MP4FileHandle srcFile,
394 MP4TrackId srcTrackId,
395 MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE),
396 MP4TrackId dstHintTrackReferenceTrack DEFAULT(MP4_INVALID_TRACK_ID) );
397
431MP4V2_EXPORT
432MP4TrackId MP4CopyTrack(
433 MP4FileHandle srcFile,
434 MP4TrackId srcTrackId,
435 MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE),
436 bool applyEdits DEFAULT(false),
437 MP4TrackId dstHintTrackReferenceTrack DEFAULT(MP4_INVALID_TRACK_ID) );
438
454MP4V2_EXPORT
456 MP4FileHandle hFile,
457 MP4TrackId trackId );
458
482MP4V2_EXPORT
484 MP4FileHandle hFile,
485 const char* type DEFAULT(NULL),
486 uint8_t subType DEFAULT(0) );
487
523MP4V2_EXPORT
524MP4TrackId MP4FindTrackId(
525 MP4FileHandle hFile,
526 uint16_t index,
527 const char* type DEFAULT(NULL),
528 uint8_t subType DEFAULT(0) );
529
542MP4V2_EXPORT
544 MP4FileHandle hFile,
545 MP4TrackId trackId );
546
557MP4V2_EXPORT
559 MP4FileHandle hFile,
560 MP4TrackId trackId,
561 MP4Duration* duration );
562
573MP4V2_EXPORT
575 MP4FileHandle hFile,
576 MP4TrackId trackId,
577 MP4Duration duration );
578
585MP4V2_EXPORT
587 MP4FileHandle hFile,
588 MP4TrackId trackId );
589
592#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.
uint32_t MP4GetNumberOfTracks(MP4FileHandle hFile, const char *type=NULL, uint8_t subType=0)
Get the number of tracks.
MP4TrackId MP4CopyTrack(MP4FileHandle srcFile, MP4TrackId srcTrackId, MP4FileHandle dstFile=MP4_INVALID_FILE_HANDLE, bool applyEdits=false, MP4TrackId dstHintTrackReferenceTrack=MP4_INVALID_TRACK_ID)
Make a copy of a specified track.
MP4TrackId MP4AddODTrack(MP4FileHandle hFile)
Add a object descriptor (OD) track.
uint16_t MP4FindTrackIndex(MP4FileHandle hFile, MP4TrackId trackId)
Find a track index.
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 MP4FindTrackId(MP4FileHandle hFile, uint16_t index, const char *type=NULL, uint8_t subType=0)
Find a track id.
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.
MP4TrackId MP4CloneTrack(MP4FileHandle srcFile, MP4TrackId srcTrackId, MP4FileHandle dstFile=MP4_INVALID_FILE_HANDLE, MP4TrackId dstHintTrackReferenceTrack=MP4_INVALID_TRACK_ID)
Make a clone of a specified track.
bool MP4DeleteTrack(MP4FileHandle hFile, MP4TrackId trackId)
Delete a track.