libgpac
Documentation of the core library of GPAC
|
Data Structures | |
struct | __track_video_info |
struct | __track_audio_info |
struct | __track_import_info |
struct | __program_import_info |
struct | GF_MediaImporter |
Macros | |
#define | GF_IMPORT_DEFAULT_FPS |
#define | GF_IMPORT_MAX_TRACKS 100 |
Enumerations | |
enum | { GF_IMPORT_USE_DATAREF = 1 , GF_IMPORT_NO_FRAME_DROP = 1<<1 , GF_IMPORT_FORCE_PACKED = 1<<2 , GF_IMPORT_SBR_IMPLICIT = 1<<3 , GF_IMPORT_SBR_EXPLICIT = 1<<4 , GF_IMPORT_FORCE_MPEG4 = 1<<5 , GF_IMPORT_SKIP_TXT_BOX = 1<<6 , GF_IMPORT_USE_COMPACT_SIZE = 1<<8 , GF_IMPORT_NO_TEXT_FLUSH = 1<<9 , GF_IMPORT_SVC_EXPLICIT = 1<<10 , GF_IMPORT_SVC_NONE = 1<<11 , GF_IMPORT_PS_IMPLICIT = 1<<12 , GF_IMPORT_PS_EXPLICIT = 1<<13 , GF_IMPORT_OVSBR = 1<<14 , GF_IMPORT_SET_SUBSAMPLES = 1<<15 , GF_IMPORT_FORCE_SYNC = 1<<16 , GF_IMPORT_KEEP_TRAILING = 1<<17 , GF_IMPORT_NO_EDIT_LIST = 1<<19 , GF_IMPORT_PROBE_ONLY = 1<<20 , GF_IMPORT_3GPP_AGGREGATION = 1<<21 , GF_IMPORT_OVERRIDE_FPS = 1<<22 , GF_IMPORT_NO_DURATION = 1<<23 , GF_IMPORT_MPE_DEMUX = 1<<24 , GF_IMPORT_NO_VPS_EXTENSIONS = 1<<25 , GF_IMPORT_NO_SEI = 1<<26 , GF_IMPORT_KEEP_REFS = 1<<27 , GF_IMPORT_KEEP_AV1_TEMPORAL_OBU = 1<<28 , GF_IMPORT_SAMPLE_DEPS = 1<<29 } |
Functions | |
GF_Err | gf_media_import (GF_MediaImporter *importer) |
GF_Err | gf_media_import_chapters (GF_ISOFile *isom_file, char *chap_file, GF_Fraction import_fps, Bool for_qt) |
GF_Err | gf_media_make_isma (GF_ISOFile *isom_file, Bool keepESIDs, Bool keepImage, Bool no_ocr) |
GF_Err | gf_media_make_3gpp (GF_ISOFile *isom_file) |
GF_Err | gf_media_make_psp (GF_ISOFile *isom_file) |
GF_Err | gf_media_check_qt_prores (GF_ISOFile *qt_file) |
This section documents media tools helper functions for importing, exporting and analysing.
struct __track_video_info |
Track info for video media
Data Fields | ||
---|---|---|
u32 | width |
video width in coded samples |
u32 | height |
video height in coded samples |
u32 | par |
pixel aspect ratio expressed as 32 bits, high 16 bits being the numerator and low ones being the denominator |
Bool | temporal_enhancement |
temporal enhancement flag |
Double | FPS |
Video frame rate |
struct __track_audio_info |
struct __track_import_info |
Track info for any media
Data Fields | ||
---|---|---|
u32 | track_num |
ID of the track (PID, TrackID, etc ...) |
u32 | stream_type |
stream type (one of GF_STREAM_XXXX) |
u32 | codecid |
codec ID ( one of GF_CODECID_XXX*) |
u32 | media_subtype |
GF_ISOM_MEDIA_* : vide, auxv, pict |
Bool | is_chapter | |
struct __track_video_info | video_info |
video format info |
struct __track_audio_info | audio_info |
audio format info |
char | szCodecProfile[20] |
codec profile according to 6381 |
u32 | lang |
language of the media, 0/'und ' if not known |
u32 | mpeg4_es_id |
MPEG-4 ES-ID, only used for MPEG4 on MPEG-2 TS |
u16 | prog_num |
Program number for MPEG2 TS |
struct __program_import_info |
Program info for the source file/stream
Data Fields | ||
---|---|---|
u32 | number |
program number, as used in MPEG-2 TS |
char | name[40] |
program name |
struct GF_MediaImporter |
Track importer object
Data Fields | ||
---|---|---|
GF_ISOFile * | dest |
destination ISOBMFF file where the media is to be imported |
u32 | trackID |
media to import: MP4/ISO media: trackID AVI files: 0: first video and first audio, 1: video track 2->any: audio track(s) MPEG-PS files with N video streams: 0: first video and first audio 1->N: video track N+1->any: audio track TrackNums can be obtain with probing |
char * | in_name |
media source - selects importer type based on extension |
GF_Fraction | duration |
import duration if any |
u32 | flags |
importer flags |
u32 | swf_flags |
importer swf flags |
Float | swf_flatten_angle |
importer swf flatten angle when converting curves |
GF_Fraction | video_fps |
Forced video FPS (CMP, AVI, OGG, H264) - also used by SUB import. Ignored if 0 |
GF_ESD * | esd |
optional ESD to be updated by the importer (used for BT/XMT import) |
char * | streamFormat |
optional format indication for media source (used in IM1 reference software) |
u32 | frames_per_sample |
frame per sample cumulation (3GP media only) - MAX 15, ignored when data ref is used |
u32 | final_trackID |
track ID of imported media in destination file |
char * | force_ext |
optional format indication for media source (used in IM1) |
GF_ISOFile * | orig |
for MP4 import only, the source MP4 to be used |
u32 | fontSize |
default font size for text import |
char * | fontName |
default font name for text import |
u32 | text_track_width |
width of the imported text track |
u32 | text_track_height |
height of the imported text track |
u32 | text_width |
width of the imported text display area (as indicated in text sample description) |
u32 | text_height |
height of the imported text display area (as indicated in text sample description) |
s32 | text_x |
horizontal offset of the imported text display area (as indicated in text sample description) |
s32 | text_y |
vertical offset of the imported text display area (as indicated in text sample description) |
Double | initial_time_offset |
Initial offset of the first AU to import. Only used for still images and AFX streams |
u32 | nb_tracks |
number of tracks after probing - may be set to 0, in which case no track selection can be performed. It may also be inaccurate if probing doesn't detect all available tracks (cf ogg import) |
struct __track_import_info | tk_info[GF_IMPORT_MAX_TRACKS] |
track info after probing (GF_IMPORT_PROBE_ONLY set). |
u64 | probe_duration |
duration of the probe for MPEG_2 TS cases. |
u32 | nb_progs |
for MPEG-TS and similar: number of program info |
struct __program_import_info | pg_info[GF_IMPORT_MAX_TRACKS] |
for MPEG-TS and similar: program info |
GF_Err | last_error |
last error encountered during import, internal to the importer |
const char * | filter_src_opts |
any filter options to pass to source |
const char * | filter_dst_opts |
any filter options to pass to sink |
const char * | filter_chain |
filter chain to insert before destination, formatted as "f1[:args]@f2[:args]" options to pass to sink |
Bool | is_chain_old_syntax | |
GF_AudioSampleEntryImportMode | asemode |
force mode for the created ISOBMFF sample entry |
Bool | is_alpha |
indicate to tag the imported media as an alpha channel stream |
Bool | keep_audelim |
keep AU delimiter in file if allowed by specification |
u32 | xps_inband |
import as NAL-based video using inband parameter sets |
u32 | print_stats_graph |
flag for session stats and graph dumping |
u32 | prog_id |
target program ID of source MPEG-2 stream to import |
s32 | moov_timescale |
target timescale to set |
u32 | target_trackID |
value for created track 0: let importer decide 0xFFFFFFFF: try to keep source ID other value: trackk ID value |
u64 | source_magic | |
GF_FilterSession * | run_in_session |
the session in which to add the importer (for -new-fs option only). If null, the importer runs its own session right away |
char * | update_mux_args |
muxer arguments when running multiple importers in one session |
char * | update_mux_sid |
muxer source ID argument when running multiple importers in one session |
u32 | track_index |
index of source importer when running multiple importers in one session |
Double | start_time |
target start time in source |
#define GF_IMPORT_DEFAULT_FPS |
Default import FPS for video when no VUI/timing information is found
#define GF_IMPORT_MAX_TRACKS 100 |
max supported numbers of tracks in importer
anonymous enum |
Track importer flags
GF_Err gf_media_import | ( | GF_MediaImporter * | importer | ) |
Imports a media file
importer | the importer object |
GF_Err gf_media_import_chapters | ( | GF_ISOFile * | isom_file, |
char * | chap_file, | ||
GF_Fraction | import_fps, | ||
Bool | for_qt | ||
) |
Adds chapter info contained in file
isom_file | target ISOBMF file |
chap_file | target chapter file |
import_fps | specifies the chapter frame rate (optional, ignored if 0 - defaults to 25). Most formats don't use this feature |
for_qt | use QT signaling for chapter tracks |
Make the file ISMA compliant: creates ISMA BIFS / OD tracks if needed, and update audio/video IDs the file should not contain more than one audio and one video track
isom_file | the target ISOBMF file |
keepESIDs | if true, ES IDs are not changed. |
keepImage | if true, keeps image tracks |
no_ocr | if true, doesn't write clock references in MPEG-4 system info |
GF_Err gf_media_make_3gpp | ( | GF_ISOFile * | isom_file | ) |
Make the file 3GP compliant && sets profile
isom_file | the target ISOBMF file |
GF_Err gf_media_make_psp | ( | GF_ISOFile * | isom_file | ) |
make the file playable on a PSP
isom_file | the target ISOBMF file |
GF_Err gf_media_check_qt_prores | ( | GF_ISOFile * | qt_file | ) |
adjust file params for QT prores
qt_file | the target QT file |