media tools helper for importing, exporting and analysing.
More...
|
GF_Err | gf_media_get_file_hash (const char *file, u8 hash[20]) |
|
GF_ESD * | gf_media_map_esd (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleDescriptionIndex) |
|
GF_ESD * | gf_media_map_item_esd (GF_ISOFile *mp4, u32 item_id) |
|
GF_Err | gf_media_get_rfc_6381_codec_name (GF_ISOFile *isom_file, u32 trackNumber, u32 sample_desc_index, char *szCodec, Bool force_inband_xps, Bool force_sbr) |
|
GF_Err | gf_media_change_par (GF_ISOFile *isom_file, u32 trackNumber, s32 ar_num, s32 ar_den, Bool force_par, Bool rewrite_par) |
|
GF_Err | gf_media_change_color (GF_ISOFile *isom_file, u32 trackNumber, s32 fullrange, s32 video_format, s32 color_primaries, s32 transfer, s32 color_matrix) |
|
GF_Err | gf_media_remove_non_rap (GF_ISOFile *isom_file, u32 trackNumber, Bool non_ref_only) |
|
void | gf_media_update_bitrate (GF_ISOFile *isom_file, u32 trackNumber) |
|
GF_Err | gf_media_av1_layer_size_get (GF_ISOFile *isom_file, u32 trackNumber, u32 sample_number, u8 op_index, u32 layer_size[3]) |
|
GF_Err | gf_media_isom_apply_qt_key (GF_ISOFile *isom_file, const char *name, const char *value) |
|
This section documents media tools functions .
◆ gf_media_get_file_hash()
GF_Err gf_media_get_file_hash |
( |
const char * |
file, |
|
|
u8 |
hash[20] |
|
) |
| |
computes file hash. If file is ISOBMFF based, computes hash according to OMA (P)DCF (without MutableDRMInformation box). Otherwise this is equivalent to gf_sha1_file
- Parameters
-
file | the source file to hash |
hash | the 20 bytes buffer in which sha128 is performed for this file |
- Returns
- error if any.
◆ gf_media_map_esd()
GF_ESD* gf_media_map_esd |
( |
GF_ISOFile * |
isom_file, |
|
|
u32 |
trackNumber, |
|
|
u32 |
sampleDescriptionIndex |
|
) |
| |
Creates (if needed) a GF_ESD for the given track - THIS IS RESERVED for local playback only, since the OTI/codecid used when emulated is not standard...
- Parameters
-
isom_file | source file |
trackNumber | track for which the esd is to be emulated |
sampleDescriptionIndex | indicates the default sample description to map. 0 is equivalent to 1, first sample description |
- Returns
- rebuilt ESD. It is the caller responsibility to delete it.
◆ gf_media_map_item_esd()
GF_ESD* gf_media_map_item_esd |
( |
GF_ISOFile * |
mp4, |
|
|
u32 |
item_id |
|
) |
| |
Creates (if needed) a GF_ESD for the given image item - THIS IS RESERVED for local playback only, since the OTI/codecid used when emulated is not standard...
- Parameters
-
mp4 | source file |
item_id | item for which the esd is to be emulated |
- Returns
- rebuilt ESD. It is the caller responsibility to delete it.
◆ gf_media_get_rfc_6381_codec_name()
GF_Err gf_media_get_rfc_6381_codec_name |
( |
GF_ISOFile * |
isom_file, |
|
|
u32 |
trackNumber, |
|
|
u32 |
sample_desc_index, |
|
|
char * |
szCodec, |
|
|
Bool |
force_inband_xps, |
|
|
Bool |
force_sbr |
|
) |
| |
Get RFC 6381 description for a given track.
- Parameters
-
isom_file | source ISOBMF file |
trackNumber | track to check |
sample_desc_index | sample description index to check |
szCodec | a pointer to an already allocated string of size RFC6381_CODEC_NAME_SIZE_MAX bytes. |
force_inband_xps | force inband signaling of parameter sets. |
force_sbr | forces using explicit signaling for SBR. |
- Returns
- error if any.
◆ gf_media_change_par()
GF_Err gf_media_change_par |
( |
GF_ISOFile * |
isom_file, |
|
|
u32 |
trackNumber, |
|
|
s32 |
ar_num, |
|
|
s32 |
ar_den, |
|
|
Bool |
force_par, |
|
|
Bool |
rewrite_par |
|
) |
| |
Changes pixel aspect ratio for visual tracks if supported. Negative values remove any PAR info
- Parameters
-
isom_file | target ISOBMF file |
trackNumber | target track |
ar_num | aspect ratio numerator. A value of 0 removes PAR info, a value of -1 gets info from video bitstream for BOTH num and den |
ar_den | aspect ratio denominator. A value of 0 removes PAR info, a value of -1 gets info from video bitstream for BOTH num and den |
force_par | aspect ratio is always written even when 1:1, otherwise aspect ratio info is removed if 1:1 |
rewrite_par | aspect ratio is modified in bitstream. Ignored if ar_num or ar_den are not strictly positive |
- Returns
- error if any
◆ gf_media_change_color()
GF_Err gf_media_change_color |
( |
GF_ISOFile * |
isom_file, |
|
|
u32 |
trackNumber, |
|
|
s32 |
fullrange, |
|
|
s32 |
video_format, |
|
|
s32 |
color_primaries, |
|
|
s32 |
transfer, |
|
|
s32 |
color_matrix |
|
) |
| |
Changes color property of the media (bitstream rewrite) - only AVC/H264 supported for now. See CICP for value types Negative values keep source settings for the corresponding flags. If source stream has no VUI info, create one and set corresponding flags to specified values. In this case, any other flags are set to preferred values (typically, flag=0 or value=undef).
- Parameters
-
isom_file | target ISOBMF file |
trackNumber | target track |
fullrange | fullrange flag |
video_format | video format type |
color_primaries | color primaries |
transfer | transfer characteristics |
color_matrix | olor matrix |
- Returns
- error if any
◆ gf_media_remove_non_rap()
GF_Err gf_media_remove_non_rap |
( |
GF_ISOFile * |
isom_file, |
|
|
u32 |
trackNumber, |
|
|
Bool |
non_ref_only |
|
) |
| |
Removes all non rap samples (sync and other RAP sample group info) from the track.
- Parameters
-
isom_file | target ISOBMF file |
trackNumber | target track |
non_ref_only | if GF_TRUE, removes only non-reference pictures |
- Returns
- error if any
◆ gf_media_update_bitrate()
void gf_media_update_bitrate |
( |
GF_ISOFile * |
isom_file, |
|
|
u32 |
trackNumber |
|
) |
| |
updates bitrate info on given track.
- Parameters
-
isom_file | target ISOBMF file |
trackNumber | target track |
◆ gf_media_av1_layer_size_get()
GF_Err gf_media_av1_layer_size_get |
( |
GF_ISOFile * |
isom_file, |
|
|
u32 |
trackNumber, |
|
|
u32 |
sample_number, |
|
|
u8 |
op_index, |
|
|
u32 |
layer_size[3] |
|
) |
| |
gets AV1 scalable layer byte offsets of a sample for a1lx box
- Parameters
-
isom_file | the target ISO file |
trackNumber | the target track |
sample_number | the target sample to query |
op_index | AV1 operating point index to retrieve sizes for |
layer_size | returned 3 layer sizes (4th is implied, see a1lx spec) |
- Returns
- error if any
◆ gf_media_isom_apply_qt_key()
GF_Err gf_media_isom_apply_qt_key |
( |
GF_ISOFile * |
isom_file, |
|
|
const char * |
name, |
|
|
const char * |
value |
|
) |
| |
sets keys from name and value, as defined in MP4Box -h tags
- Parameters
-
isom_file | the target ISO file |
name | the tag name |
value | the tag value |
- Returns
- error if any