libgpac
Documentation of the core library of GPAC
DASH Segmenter

MPEG-DASH creation. More...

+ Collaboration diagram for DASH Segmenter:

Data Structures

struct  GF_DashSegmenterInput
 

Typedefs

typedef struct __gf_dash_segmenter GF_DASHSegmenter
 

Enumerations

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 }
 

Functions

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)
 

Detailed Description

This section documents media functions for MPEG-DASH creation.


Data Structure Documentation

◆ GF_DashSegmenterInput

struct GF_DashSegmenterInput

DASH segmenter information per source

+ Collaboration diagram for GF_DashSegmenterInput:
Data Fields
char * file_name

source file to be used

char * representationID

ID of the representation, may be NULL (assigned by dasher)

char * periodID

ID of the period, may be NULL (assigned by dasher)

u32 asID

ID of the adaptation set, may be 0 (assigned by dasher)

GF_Fraction64 media_duration

forced media duration.

u32 nb_baseURL

number of base URLs in the baseURL structure

char ** baseURL

list of baseURL to be used for this representation

char * xlink

xlink of the period if desired, NULL otherwise

u32 nb_roles

number of items in roles

char ** roles

role of the representation according to MPEG-DASH

u32 nb_rep_descs

number of items in rep_descs

char ** rep_descs

descriptors to be inserted in the representation

u32 nb_p_descs

number of items in p_descs

char ** p_descs

descriptors to be inserted in the period

u32 nb_as_descs

number of items in nb_as_descs

char ** as_descs

descriptors to be inserted in the adaptation set. Representation with non matching as_descs will be in different adaptation sets

u32 nb_as_c_descs

number of items in nb_as_c_descs

char ** as_c_descs

descriptors to be inserted in the adaptation set. Ignored when matching Representation to adaptation sets

u32 bandwidth

forces bandwidth in bits per seconds of the source media. If 0, computed from file

GF_Fraction period_duration

forced period duration (used when using empty periods or xlink periods without content)

GF_Fraction dash_duration

forced dash target duration for this rep

u32 startNumber

sets default start number for this representation. if not set, assigned automatically

char * seg_template

overrides template for this input

char * hls_pl

sets name of HLS playlist

Bool sscale

if true and only one media stream in target segment, the moov will use the media stream timescale

u32 track_id

only imports this track from the source

char * source_opts

non legacy options passed to dasher for source

char * filter_chain

filter chain to instantiate between this source and the dasher

u32 period_order

period order, internal only

Typedef Documentation

◆ GF_DASHSegmenter

typedef struct __gf_dash_segmenter GF_DASHSegmenter

DASH segmenter

Enumeration Type Documentation

◆ GF_DashProfile

DASH profile constants

Matches profile enum of dasher module: auto|live|onDemand|main|full|hbbtv1.5.live|dashavc264.live|dashavc264.onDemand

Enumerator
GF_DASH_PROFILE_AUTO 

auto profile, internal use only

GF_DASH_PROFILE_LIVE 

Live dash profile for: live for ISOFF, SIMPLE for M2TS

GF_DASH_PROFILE_ONDEMAND 

onDemand profile

GF_DASH_PROFILE_MAIN 

main profile

GF_DASH_PROFILE_FULL 

Full dash (no profile)

GF_DASH_PROFILE_HBBTV_1_5_ISOBMF_LIVE 

industry profile HbbTV 1.5 ISOBMFF Live

GF_DASH_PROFILE_AVC264_LIVE 

industry profile DASH-IF ISOBMFF Live

GF_DASH_PROFILE_AVC264_ONDEMAND 

industry profile DASH-IF ISOBMFF onDemand

GF_DASH_PROFILE_DASHIF_LL 

industry profile DASH-IF ISOBMFF low latency

◆ GF_DashSwitchingMode

DASH bitstream switching selector

Enumerator
GF_DASH_BSMODE_DEFAULT 

inband parameter sets for live profile and none for onDemand

GF_DASH_BSMODE_NONE 

always out of band parameter sets

GF_DASH_BSMODE_INBAND 

always inband parameter sets

GF_DASH_BSMODE_INBAND_PPS 

out of band parameter sets except PPS and APS, used for VVC

GF_DASH_BSMODE_BOTH 

both inband and out of band parameter sets

GF_DASH_BSMODE_MERGED 

attempts to merge parameter sets in a single sample entry

GF_DASH_BSMODE_MULTIPLE_ENTRIES 

parameter sets are in different sample entries

GF_DASH_BSMODE_SINGLE 

forces GF_DASH_BSMODE_INBAND even if only one file is used

◆ GF_DashDynamicMode

DASH media presentation type

Enumerator
GF_DASH_STATIC 

DASH Presentation is static

GF_DASH_DYNAMIC 

DASH Presentation is dynamic

GF_DASH_DYNAMIC_LAST 

DASH Presentation is dynamic and this is the last segmenting operation in the period. This can only be used when DASH segmenter context is used, will close the period

GF_DASH_DYNAMIC_DEBUG 

same as GF_DASH_DYNAMIC but prevents all segment cleanup

◆ GF_DASH_ContentLocationMode

DASH selector for content protection descriptor location

Enumerator
GF_DASH_CPMODE_ADAPTATION_SET 

content protection descriptor is at the adaptation set level

GF_DASH_CPMODE_REPRESENTATION 

content protection descriptor is at the representation level

GF_DASH_CPMODE_BOTH 

content protection descriptor is at the adaptation set and representation level

◆ GF_DASHPSSHMode

DASH PSSH storage mode

Enumerator
GF_DASH_PSSH_MOOV 

PSSH box in moov only.

GF_DASH_PSSH_MOOF 

PSSH box in moof only.

GF_DASH_PSSH_MOOV_MPD 

PSSH box in moov and MPD.

GF_DASH_PSSH_MOOF_MPD 

PSSH box in moof and MPD.

GF_DASH_PSSH_MPD 

PSSH box in MPD only.

GF_DASH_PSSH_NONE 

Drop PSSH info from mpd and init seg.

◆ GF_DASH_SplitMode

DASH selector for segment split mode

Enumerator
GF_DASH_SPLIT_OUT 

segment start time is greater than or equal to theoretical segment start (segment_duration*segment_number)

GF_DASH_SPLIT_CLOSEST 

segment start time is as close as possible to theoretical segment start (segment_duration*segment_number), but may be greater

GF_DASH_SPLIT_IN 

segment start time is less than or equal to theoretical segment start (segment_duration*segment_number) so that the theoretical start time is always present in the segment

Function Documentation

◆ gf_dasher_new()

GF_DASHSegmenter* gf_dasher_new ( const char *  mpdName,
GF_DashProfile  profile,
const char *  tmp_dir,
u32  timescale,
const char *  dasher_context_file 
)

Create a new DASH segmenter

Parameters
mpdNametarget MPD file name, cannot be changed
profiletarget DASH profile, cannot be changed
tmp_dirtemp dir for file generation, if NULL uses libgpac default
timescaletimescale used to specif most of the dash timings. If 0, 1000 is used
dasher_context_fileconfig file used to store the context of the DASH segmenter. This allows destroying the segmenter and restarting it later on with the right DASH segquence numbers, MPD and and timing info
Returns
the DASH segmenter object

◆ gf_dasher_del()

void gf_dasher_del ( GF_DASHSegmenter dasher)

Deletes a DASH segmenter

Parameters
dasherthe DASH segmenter object

◆ gf_dasher_clean_inputs()

void gf_dasher_clean_inputs ( GF_DASHSegmenter dasher)

Removes the DASH inputs. Re-add new ones with gf_dasher_add_input()

Parameters
dasherthe DASH segmenter object

◆ gf_dasher_set_info()

GF_Err gf_dasher_set_info ( GF_DASHSegmenter dasher,
const char *  title,
const char *  copyright,
const char *  moreInfoURL,
const char *  sourceInfo,
const char *  lang 
)

Sets MPD info

Parameters
dasherthe DASH segmenter object
titleMPD title
copyrightMPD copyright
moreInfoURLMPD "more info" URL
sourceInfoMPD source info
langMPD language for title
Returns
error code if any

◆ gf_dasher_set_location()

GF_Err gf_dasher_set_location ( GF_DASHSegmenter dasher,
const char *  location 
)

Sets MPD Location. This is useful to distrubute a dynamic MPD by mail or any non-HTTP mean

Parameters
dasherthe DASH segmenter object
locationthe URL where this MPD can be found
Returns
error code if any

◆ gf_dasher_add_base_url()

GF_Err gf_dasher_add_base_url ( GF_DASHSegmenter dasher,
const char *  base_url 
)

Adds a base URL to the MPD

Parameters
dasherthe DASH segmenter object
base_urlbase url to add
Returns
error code if any

◆ gf_dasher_enable_url_template()

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 
)

Enable URL template - - may be overridden by the current profile

Parameters
dasherthe DASH segmenter object
enableenable usage of URL template
default_templatetemplate for the segment name
default_extensionextension for the segment name
default_init_extensionextension for the initialization segment name
Returns
error code if any

◆ gf_dasher_enable_segment_timeline()

GF_Err gf_dasher_enable_segment_timeline ( GF_DASHSegmenter dasher,
Bool  enable 
)

Enable Segment Timeline template - may be overridden by the current profile

Parameters
dasherthe DASH segmenter object
enableenable or disable
Returns
error code if any

◆ gf_dasher_enable_single_segment()

GF_Err gf_dasher_enable_single_segment ( GF_DASHSegmenter dasher,
Bool  enable 
)

Enables single segment - may be overridden by the current profile

Parameters
dasherthe DASH segmenter object
enableenable or disable
Returns
error code if any

◆ gf_dasher_enable_single_file()

GF_Err gf_dasher_enable_single_file ( GF_DASHSegmenter dasher,
Bool  enable 
)

Enable single file (with multiple segments) - may be overridden by the current profile

Parameters
dasherthe DASH segmenter object
enableenable or disable
Returns
error code if any

◆ gf_dasher_set_switch_mode()

GF_Err gf_dasher_set_switch_mode ( GF_DASHSegmenter dasher,
GF_DashSwitchingMode  bitstream_switching 
)

Sets bitstream switching mode - may be overridden by the current profile

Parameters
dasherthe DASH segmenter object
bitstream_switchingmode to use for bitstream switching
Returns
error code if any

◆ gf_dasher_set_durations()

GF_Err gf_dasher_set_durations ( GF_DASHSegmenter dasher,
Double  default_segment_duration,
Double  default_fragment_duration,
Double  sub_duration 
)

Sets segment and fragment durations.

Parameters
dasherthe DASH segmenter object
default_segment_durationthe duration of a dash segment
default_fragment_durationthe duration of a dash fragment - if 0, same as default_segment_duration
sub_durationthe duration in seconds of media to DASH. If 0, the whole sources will be processed.
Returns
error code if any

◆ gf_dasher_enable_rap_splitting()

GF_Err gf_dasher_enable_rap_splitting ( GF_DASHSegmenter dasher,
Bool  segments_start_with_rap,
Bool  fragments_start_with_rap 
)

Enables splitting at RAP boundaries

Parameters
dasherthe DASH segmenter object
segments_start_with_rapsegments will be split at RAP boundaries
fragments_start_with_rapfragments will be split at RAP boundaries
Returns
error code if any

◆ gf_dasher_set_segment_marker()

GF_Err gf_dasher_set_segment_marker ( GF_DASHSegmenter dasher,
u32  segment_marker_4cc 
)

Enables segment marker

Parameters
dasherthe DASH segmenter object
segment_marker_4cc4CC code of the segment marker box
Returns
error code if any

◆ gf_dasher_enable_sidx()

GF_Err gf_dasher_enable_sidx ( GF_DASHSegmenter dasher,
Bool  enable_sidx,
u32  subsegs_per_sidx,
Bool  daisy_chain_sidx,
Bool  use_ssix 
)

Enables segment indexes

Parameters
dasherthe DASH segmenter object
enable_sidxenable or disable
subsegs_per_sidxnumber of subsegments per segment
daisy_chain_sidxenable daisy chaining of sidx
use_ssixenables ssix generation, level 1 for I-frames, the rest of the segment not mapped
Returns
error code if any

◆ gf_dasher_set_dynamic_mode()

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 
)

Sets mode for the dash segmenter.

Parameters
dasherthe DASH segmenter object
dash_modethe mode to use. Currently switching from static mode to dynamic mode is not well supported and may produce non-compliant MPDs
mpd_update_timetime between MPD refresh, in seconds. Used for dynamic mode, may be 0 if mpd_live_duration is set
time_shift_depththe depth of the time shift buffer in seconds, -1 for infinite time shift.
mpd_live_durationtotal duration of the DASH session in dynamic mode, in seconds. May be set to 0 if mpd_update_time is set
Returns
error code if any

◆ gf_dasher_set_min_buffer()

GF_Err gf_dasher_set_min_buffer ( GF_DASHSegmenter dasher,
Double  min_buffer 
)

Sets the minimal buffer desired.

Parameters
dasherthe DASH segmenter object
min_buffermin buffer time in seconds for the DASH session. Currently the minimal buffer is NOT computed from the source material and must be set to an appropriate value.
Returns
error code if any

◆ gf_dasher_set_ast_offset()

GF_Err gf_dasher_set_ast_offset ( GF_DASHSegmenter dasher,
s32  ast_offset 
)

Sets the availability start time offset.

Parameters
dasherthe DASH segmenter object
ast_offsetast offset in milliseconds. If >0, the DASH session availabilityStartTime will be earlier than UTC by the amount of seconds specified. If <0, the media representation will have an availabilityTimeOffset of the amount of seconds specified, instructing the client that segments may be accessed earlier.
Returns
error code if any

◆ gf_dasher_enable_memory_fragmenting()

GF_Err gf_dasher_enable_memory_fragmenting ( GF_DASHSegmenter dasher,
Bool  enable 
)

Enables memory fragmenting: fragments will be written to disk only once completed

Parameters
dasherthe DASH segmenter object
enableEnables or disables. Default is disabled.
Returns
error code if any

◆ gf_dasher_set_initial_isobmf()

GF_Err gf_dasher_set_initial_isobmf ( GF_DASHSegmenter dasher,
u32  initial_moof_sn,
u64  initial_tfdt 
)

Sets initial values for ISOBMFF sequence number and TFDT in movie fragments.

Parameters
dasherthe DASH segmenter object
initial_moof_snsequence number of the first moof to be generated. Default value is 1.
initial_tfdtinitial tfdt of the first traf to be generated, in DASH segmenter timescale units. Default value is 0.
Returns
error code if any

◆ gf_dasher_configure_isobmf_default()

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 
)

Configure how default values for ISOBMFF are stored

Parameters
dasherthe DASH segmenter object
no_fragments_defaultsif set, fragments default values are repeated in each traf and not set in trex. Default value is GF_FALSE
pssh_modesets the storage mode of PSSH in moov/moof/mpd.
samplegroups_in_trafif set, all sample group definitions are stored in each traf and not set in init segment. Default value is GF_FALSE
single_traf_per_moofif set, each moof will contain a single traf, even if source media is multiplexed. Default value is GF_FALSE
tfdt_per_trafif set, each traf will contain a tfdt. Only applicable when single_traf_per_moof is GF_TRUE. Default value is GF_FALSE
mvex_after_traksif set, the mvex box will be written after all track boxes
sdtp_in_trafmode for sdtp storage in traf (smooth compatibility): 0: not allowed, 1: only stdp, no trun flags, 2: both (trun for sync, stdp for the rest)
Returns
error code if any

◆ gf_dasher_enable_utc_ref()

GF_Err gf_dasher_enable_utc_ref ( GF_DASHSegmenter dasher,
Bool  insert_utc 
)

Enables insertion of UTC reference in the beginning of segments

Parameters
dasherthe DASH segmenter object
insert_utcif set, UTC will be inserted. Default value is disabled.
Returns
error code if any

◆ gf_dasher_enable_real_time()

GF_Err gf_dasher_enable_real_time ( GF_DASHSegmenter dasher,
Bool  real_time 
)

Enables real-time generation of media segments.

Parameters
dasherthe DASH segmenter object
real_timeif set, segments are generated in real time. Only supported for single representation (potentially multiplexed) DASH session. Default is disabled.
Returns
error code if any

◆ gf_dasher_set_content_protection_location_mode()

GF_Err gf_dasher_set_content_protection_location_mode ( GF_DASHSegmenter dasher,
GF_DASH_ContentLocationMode  mode 
)

Sets where the ContentProtection element is inserted in an adaptation set.

Parameters
dasherthe DASH segmenter object
modeContentProtection element location mode.
Returns
error code if any

◆ gf_dasher_set_profile_extension()

GF_Err gf_dasher_set_profile_extension ( GF_DASHSegmenter dasher,
const char *  dash_profile_extension 
)

Sets profile extension as used by DASH-IF and DVB.

Parameters
dasherthe DASH segmenter object
dash_profile_extensionspecifies a string of profile extensions, as used by DASH-IF and DVB.
Returns
error code if any

◆ gf_dasher_enable_cached_inputs()

GF_Err gf_dasher_enable_cached_inputs ( GF_DASHSegmenter dasher,
Bool  no_cache 
)

Enable/Disable cached inputs .

Parameters
dasherthe DASH segmenter object
no_cacheif true, input file will be reopen each time the dasher process function is called .
Returns
error code if any

◆ gf_dasher_enable_loop_inputs()

GF_Err gf_dasher_enable_loop_inputs ( GF_DASHSegmenter dasher,
Bool  do_loop 
)

Enable/Disable loop inputs .

Parameters
dasherthe DASH segmenter object
do_loopif true, input files will be looped at the end of the file in a live simulation. Otherwise a new period will be created.
Returns
error code if any

◆ gf_dasher_set_split_mode()

GF_Err gf_dasher_set_split_mode ( GF_DASHSegmenter dasher,
GF_DASH_SplitMode  split_mode 
)

Enable/Disable split on bound mode.

Parameters
dasherthe DASH segmenter object
split_modethe desired segmentation mode
Returns
error code if any

◆ gf_dasher_set_last_segment_merge()

GF_Err gf_dasher_set_last_segment_merge ( GF_DASHSegmenter dasher,
Bool  merge_last_seg 
)

Enable/Disable last segment merging (disabled by default).

Parameters
dasherthe DASH segmenter object
merge_last_segif true, last segment is merged into previous if duration less than half target dur
Returns
error code if any

◆ gf_dasher_set_hls_clock()

GF_Err gf_dasher_set_hls_clock ( GF_DASHSegmenter dasher,
Bool  insert_clock 
)

Sets m3u8 file name - if not set, no m3u8 output

Parameters
dasherthe DASH segmenter object
insert_clockif true UTC clock is inserted in variant playlists in live
Returns
error code if any

◆ gf_dasher_set_cues()

GF_Err gf_dasher_set_cues ( GF_DASHSegmenter dasher,
const char *  cues_file,
Bool  strict_cues 
)

Sets cue file for the session.

Parameters
dasherthe DASH segmenter object
cues_filename of the cue file. This is an XML document with root 'DASHCues' element, one or multiple 'Stream' elements with attribute ID (trackID) and timescale (trackTimescale), and a set of 'cues' elements per Stream with attributes sampleNumber, dts or cts.
strict_cuesif true will fail if one cue doesn't match a timestamp in the stream or if the split sample is not RAP
Returns
error code if any

◆ gf_dasher_add_input()

GF_Err gf_dasher_add_input ( GF_DASHSegmenter dasher,
const GF_DashSegmenterInput input 
)

Adds a media input to the DASHer

Parameters
dasherthe DASH segmenter object
inputmedia source to add
Returns
error code if any

◆ gf_dasher_process()

GF_Err gf_dasher_process ( GF_DASHSegmenter dasher)

Process the media source and generate segments

Parameters
dasherthe DASH segmenter object
Returns
error code if any

◆ gf_dasher_next_update_time()

u32 gf_dasher_next_update_time ( GF_DASHSegmenter dasher,
u64 ms_ins_session 
)

Returns time to wait until end of currently generated segments

Parameters
dasherthe DASH segmenter object
ms_ins_sessionif set, retrives the number of ms since the start of the dash session
Returns
time to wait in milliseconds

◆ gf_dasher_set_start_date()

void gf_dasher_set_start_date ( GF_DASHSegmenter dasher,
const char *  dash_utc_start_date 
)

Sets dasher start date, rather than use current time. Used for debugging purposes, such as simulating long lasting sessions.

Parameters
dasherthe DASH segmenter object
dash_utc_start_datestart date as as xs:date, eg YYYY-MM-DDTHH:MM:SSZ. If 0, current time is used

◆ gf_dasher_print_session_info()

GF_Err gf_dasher_print_session_info ( GF_DASHSegmenter dasher,
u32  fs_print_flags 
)

Sets print flags for filter session

Parameters
dasherthe DASH segmenter object
fs_print_flagsflags for statistics (1) and graph (2) printing
Returns
error if any

◆ gf_dasher_keep_source_utc()

GF_Err gf_dasher_keep_source_utc ( GF_DASHSegmenter dasher,
Bool  keep_utc 
)

Keeps UTC creation and modification dates from sources, if any (default is no)

Parameters
dasherthe DASH segmenter object
keep_utcif GF_TRUE, keeps UTC times
Returns
error if any

◆ gf_media_fragment_file()

GF_Err gf_media_fragment_file ( GF_ISOFile isom_file,
const char *  output_file,
Double  max_duration_sec,
Bool  use_mfra 
)

save file as fragmented movie

Parameters
isom_filethe target file to be fragmented
output_filename of the output file
max_duration_secmax fragment duration in seconds
use_mfrainsert track fragment movie fragments
Returns
error if any