libgpac
Documentation of the core library of GPAC
media_tools.h File Reference

media tools helper for importing, exporting and analysing More...

#include <gpac/isomedia.h>
#include <gpac/avparse.h>
#include <gpac/config_file.h>
#include <gpac/filters.h>
+ Include dependency graph for media_tools.h:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  __track_video_info
 
struct  __track_audio_info
 
struct  __track_import_info
 
struct  __program_import_info
 
struct  GF_MediaImporter
 
struct  GF_DashSegmenterInput
 
struct  GF_MediaExporter
 

Macros

#define GF_IMPORT_DEFAULT_FPS
 
#define GF_IMPORT_MAX_TRACKS   100
 

Typedefs

typedef struct __gf_dash_segmenter GF_DASHSegmenter
 
typedef struct __tag_isom_hinter GF_RTPHinter
 
typedef struct __saf_muxer GF_SAFMuxer
 

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
}
 
enum  GF_LHVCExtractoreMode { GF_LHVC_EXTRACTORS_ON , GF_LHVC_EXTRACTORS_OFF , GF_LHVC_EXTRACTORS_OFF_FORCE_INBAND }
 
enum  GF_DashProfile {
  GF_DASH_PROFILE_AUTO = 0 , GF_DASH_PROFILE_LIVE , GF_DASH_PROFILE_ONDEMAND , GF_DASH_PROFILE_MAIN ,
  GF_DASH_PROFILE_FULL , GF_DASH_PROFILE_HBBTV_1_5_ISOBMF_LIVE , GF_DASH_PROFILE_AVC264_LIVE , GF_DASH_PROFILE_AVC264_ONDEMAND ,
  GF_DASH_PROFILE_DASHIF_LL
}
 
enum  GF_DashSwitchingMode {
  GF_DASH_BSMODE_DEFAULT , GF_DASH_BSMODE_NONE , GF_DASH_BSMODE_INBAND , GF_DASH_BSMODE_INBAND_PPS ,
  GF_DASH_BSMODE_BOTH , GF_DASH_BSMODE_MERGED , GF_DASH_BSMODE_MULTIPLE_ENTRIES , GF_DASH_BSMODE_SINGLE
}
 
enum  GF_DashDynamicMode { GF_DASH_STATIC = 0 , GF_DASH_DYNAMIC , GF_DASH_DYNAMIC_LAST , GF_DASH_DYNAMIC_DEBUG }
 
enum  GF_DASH_ContentLocationMode { GF_DASH_CPMODE_ADAPTATION_SET =0 , GF_DASH_CPMODE_REPRESENTATION , GF_DASH_CPMODE_BOTH }
 
enum  GF_DASHPSSHMode {
  GF_DASH_PSSH_MOOV = 0 , GF_DASH_PSSH_MOOF , GF_DASH_PSSH_MOOV_MPD , GF_DASH_PSSH_MOOF_MPD ,
  GF_DASH_PSSH_MPD , GF_DASH_PSSH_NONE
}
 
enum  GF_DASH_SplitMode { GF_DASH_SPLIT_OUT =0 , GF_DASH_SPLIT_CLOSEST , GF_DASH_SPLIT_IN }
 
enum  {
  GF_EXPORT_NATIVE = 1 , GF_EXPORT_RAW_SAMPLES = (1<<1) , GF_EXPORT_NHNT = (1<<2) , GF_EXPORT_REMUX = (1<<3) ,
  GF_EXPORT_MP4 = (1<<4) , GF_EXPORT_UNUSED = (1<<4) , GF_EXPORT_NHML = (1<<6) , GF_EXPORT_SAF = (1<<7) ,
  GF_EXPORT_WEBVTT_META = (1<<8) , GF_EXPORT_WEBVTT_META_EMBEDDED = (1<<9) , GF_EXPORT_MERGE = (1<<10) , GF_EXPORT_NO_FILE_EXT = (1 << 11) ,
  GF_EXPORT_USE_QCP = (1<<12) , GF_EXPORT_NHML_FULL = (1<<13) , GF_EXPORT_SVC_LAYER = (1<<14) , GF_EXPORT_WEBVTT_NOMERGE = (1<<15) ,
  GF_EXPORT_SIX = (1<<16) , GF_EXPORT_PROBE_ONLY = (1<<30) , GF_EXPORT_DO_ABORT = 0x80000000
}
 
enum  GF_SDP_IODProfile { GF_SDP_IOD_NONE = 0 , GF_SDP_IOD_REGULAR , GF_SDP_IOD_ISMA , GF_SDP_IOD_ISMA_STRICT }
 

Functions

GF_Err gf_media_get_file_hash (const char *file, u8 hash[20])
 
GF_ESDgf_media_map_esd (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleDescriptionIndex)
 
GF_ESDgf_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)
 
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)
 
GF_Err gf_media_change_pl (GF_ISOFile *isom_file, u32 trackNumber, u32 profile, u32 compat, u32 level)
 
GF_Err gf_media_nal_rewrite_samples (GF_ISOFile *isom_file, u32 trackNumber, u32 new_size_in_bits)
 
GF_Err gf_media_split_svc (GF_ISOFile *isom_file, u32 trackNumber, Bool splitAll)
 
GF_Err gf_media_merge_svc (GF_ISOFile *isom_file, u32 trackNumber, Bool mergeAll)
 
GF_Err gf_media_split_lhvc (GF_ISOFile *isom_file, u32 trackNumber, Bool for_temporal_sublayers, Bool splitAll, GF_LHVCExtractoreMode extractor_mode)
 
GF_Err gf_media_split_hevc_tiles (GF_ISOFile *isom_file, u32 signal_only)
 
GF_Err gf_media_filter_hevc (GF_ISOFile *isom_file, u32 trackNumber, u8 max_temporal_id_plus_one, u8 max_layer_id_plus_one)
 
GF_DASHSegmentergf_dasher_new (const char *mpdName, GF_DashProfile profile, const char *tmp_dir, u32 timescale, const char *dasher_context_file)
 
void gf_dasher_del (GF_DASHSegmenter *dasher)
 
void gf_dasher_clean_inputs (GF_DASHSegmenter *dasher)
 
GF_Err gf_dasher_set_info (GF_DASHSegmenter *dasher, const char *title, const char *copyright, const char *moreInfoURL, const char *sourceInfo, const char *lang)
 
GF_Err gf_dasher_set_location (GF_DASHSegmenter *dasher, const char *location)
 
GF_Err gf_dasher_add_base_url (GF_DASHSegmenter *dasher, const char *base_url)
 
GF_Err gf_dasher_enable_url_template (GF_DASHSegmenter *dasher, Bool enable, const char *default_template, const char *default_extension, const char *default_init_extension)
 
GF_Err gf_dasher_enable_segment_timeline (GF_DASHSegmenter *dasher, Bool enable)
 
GF_Err gf_dasher_enable_single_segment (GF_DASHSegmenter *dasher, Bool enable)
 
GF_Err gf_dasher_enable_single_file (GF_DASHSegmenter *dasher, Bool enable)
 
GF_Err gf_dasher_set_switch_mode (GF_DASHSegmenter *dasher, GF_DashSwitchingMode bitstream_switching)
 
GF_Err gf_dasher_set_durations (GF_DASHSegmenter *dasher, Double default_segment_duration, Double default_fragment_duration, Double sub_duration)
 
GF_Err gf_dasher_enable_rap_splitting (GF_DASHSegmenter *dasher, Bool segments_start_with_rap, Bool fragments_start_with_rap)
 
GF_Err gf_dasher_set_segment_marker (GF_DASHSegmenter *dasher, u32 segment_marker_4cc)
 
GF_Err gf_dasher_enable_sidx (GF_DASHSegmenter *dasher, Bool enable_sidx, u32 subsegs_per_sidx, Bool daisy_chain_sidx, Bool use_ssix)
 
GF_Err gf_dasher_set_dynamic_mode (GF_DASHSegmenter *dasher, GF_DashDynamicMode dash_mode, Double mpd_update_time, s32 time_shift_depth, Double mpd_live_duration)
 
GF_Err gf_dasher_set_min_buffer (GF_DASHSegmenter *dasher, Double min_buffer)
 
GF_Err gf_dasher_set_ast_offset (GF_DASHSegmenter *dasher, s32 ast_offset)
 
GF_Err gf_dasher_enable_memory_fragmenting (GF_DASHSegmenter *dasher, Bool enable)
 
GF_Err gf_dasher_set_initial_isobmf (GF_DASHSegmenter *dasher, u32 initial_moof_sn, u64 initial_tfdt)
 
GF_Err gf_dasher_configure_isobmf_default (GF_DASHSegmenter *dasher, Bool no_fragments_defaults, GF_DASHPSSHMode pssh_mode, Bool samplegroups_in_traf, Bool single_traf_per_moof, Bool tfdt_per_traf, Bool mvex_after_traks, u32 sdtp_in_traf)
 
GF_Err gf_dasher_enable_utc_ref (GF_DASHSegmenter *dasher, Bool insert_utc)
 
GF_Err gf_dasher_enable_real_time (GF_DASHSegmenter *dasher, Bool real_time)
 
GF_Err gf_dasher_set_content_protection_location_mode (GF_DASHSegmenter *dasher, GF_DASH_ContentLocationMode mode)
 
GF_Err gf_dasher_set_profile_extension (GF_DASHSegmenter *dasher, const char *dash_profile_extension)
 
GF_Err gf_dasher_enable_cached_inputs (GF_DASHSegmenter *dasher, Bool no_cache)
 
GF_Err gf_dasher_enable_loop_inputs (GF_DASHSegmenter *dasher, Bool do_loop)
 
GF_Err gf_dasher_set_split_mode (GF_DASHSegmenter *dasher, GF_DASH_SplitMode split_mode)
 
GF_Err gf_dasher_set_last_segment_merge (GF_DASHSegmenter *dasher, Bool merge_last_seg)
 
GF_Err gf_dasher_set_hls_clock (GF_DASHSegmenter *dasher, Bool insert_clock)
 
GF_Err gf_dasher_set_cues (GF_DASHSegmenter *dasher, const char *cues_file, Bool strict_cues)
 
GF_Err gf_dasher_add_input (GF_DASHSegmenter *dasher, const GF_DashSegmenterInput *input)
 
GF_Err gf_dasher_process (GF_DASHSegmenter *dasher)
 
u32 gf_dasher_next_update_time (GF_DASHSegmenter *dasher, u64 *ms_ins_session)
 
void gf_dasher_set_start_date (GF_DASHSegmenter *dasher, const char *dash_utc_start_date)
 
GF_Err gf_dasher_print_session_info (GF_DASHSegmenter *dasher, u32 fs_print_flags)
 
GF_Err gf_dasher_keep_source_utc (GF_DASHSegmenter *dasher, Bool keep_utc)
 
GF_Err gf_media_fragment_file (GF_ISOFile *isom_file, const char *output_file, Double max_duration_sec, Bool use_mfra)
 
GF_Err gf_media_export (GF_MediaExporter *dump)
 
GF_Err gf_webvtt_dump_iso_track (GF_MediaExporter *dumper, u32 trackNumber, Bool merge, Bool box_dump)
 
GF_RTPHintergf_hinter_track_new (GF_ISOFile *isom_file, u32 trackNumber, u32 Path_MTU, u32 max_ptime, u32 default_rtp_rate, u32 hint_flags, u8 PayloadID, Bool copy_media, u32 InterleaveGroupID, u8 InterleaveGroupPriority, GF_Err *e)
 
void gf_hinter_track_del (GF_RTPHinter *tkHinter)
 
GF_Err gf_hinter_track_process (GF_RTPHinter *tkHinter)
 
u32 gf_hinter_track_get_bandwidth (GF_RTPHinter *tkHinter)
 
GF_Err gf_hinter_track_force_no_offsets (GF_RTPHinter *tkHinter)
 
u32 gf_hinter_track_get_flags (GF_RTPHinter *tkHinter)
 
void gf_hinter_track_get_payload_name (GF_RTPHinter *tkHinter, char *payloadName)
 
GF_Err gf_hinter_track_finalize (GF_RTPHinter *tkHinter, Bool AddSystemInfo)
 
GF_Err gf_hinter_finalize (GF_ISOFile *isom_file, GF_SDP_IODProfile IOD_Profile, u32 bandwidth)
 
Bool gf_hinter_can_embbed_data (u8 *data, u32 data_size, u32 streamType)
 
GF_SAFMuxergf_saf_mux_new ()
 
void gf_saf_mux_del (GF_SAFMuxer *mux)
 
GF_Err gf_saf_mux_stream_add (GF_SAFMuxer *mux, u32 stream_id, u32 ts_res, u32 buffersize_db, u8 stream_type, u8 object_type, char *mime_type, char *dsi, u32 dsi_len, char *remote_url)
 
GF_Err gf_saf_mux_add_au (GF_SAFMuxer *mux, u32 stream_id, u32 CTS, char *data, u32 data_len, Bool is_rap)
 
GF_Err gf_saf_mux_for_time (GF_SAFMuxer *mux, u32 time_ms, Bool force_end_of_session, u8 **out_data, u32 *out_size)
 
void gf_media_get_video_timing (Double fps, u32 *timescale, u32 *ts_inc)
 
u32 gf_dolby_vision_level (u32 width, u32 height, u64 fps_num, u64 fps_den, u32 codecid)
 

Detailed Description

>