GPAC
Open Source Multimedia Framework. For more information, check out http://gpac.wp.mines-telecom.fr
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups
mp4box/main.c File Reference
#include <gpac/download.h>
#include <gpac/network.h>
#include <gpac/scene_manager.h>
#include <gpac/media_tools.h>
#include <gpac/ietf.h>
#include <gpac/ismacryp.h>
#include <gpac/constants.h>
#include <gpac/internal/mpd.h>
#include <time.h>
+ Include dependency graph for mp4box/main.c:

Data Structures

struct  itunes_tag
 
struct  SDPLine
 
struct  MetaAction
 
struct  TSELAction
 
struct  TrackAction
 

Macros

#define BUFFSIZE   8192
 
#define BASE_PAYT   96
 
#define CHECK_NEXT_ARG   if (i+1==(u32)argc) { fprintf(stderr, "Missing arg - please check usage\n"); MP4BOX_EXIT_WITH_CODE(1); }
 
#define MP4BOX_EXIT_WITH_CODE(__ret_code)
 

Enumerations

enum  {
  GF_ISOM_CONV_TYPE_ISMA = 1, GF_ISOM_CONV_TYPE_ISMA_EX, GF_ISOM_CONV_TYPE_3GPP, GF_ISOM_CONV_TYPE_IPOD,
  GF_ISOM_CONV_TYPE_PSP
}
 

Functions

void convert_file_info (char *inName, u32 trackID)
 
GF_Err import_file (GF_ISOFile *dest, char *inName, u32 import_flags, Double force_fps, u32 frames_per_sample)
 
GF_Err split_isomedia_file (GF_ISOFile *mp4, Double split_dur, u32 split_size_kb, char *inName, Double interleaving_time, Double chunk_start, Bool adjust_split_end, char *outName, const char *tmpdir)
 
GF_Err cat_isomedia_file (GF_ISOFile *mp4, char *fileName, u32 import_flags, Double force_fps, u32 frames_per_sample, char *tmp_dir, Bool force_cat, Bool align_timelines, Bool allow_add_in_command)
 
GF_Err EncodeFile (char *in, GF_ISOFile *mp4, GF_SMEncodeOptions *opts, FILE *logs)
 
GF_Err EncodeFileChunk (char *chunkFile, char *bifs, char *inputContext, char *outputContext, const char *tmpdir)
 
GF_ISOFile * package_file (char *file_name, char *fcc, const char *tmpdir, Bool make_wgt)
 
GF_Err dump_cover_art (GF_ISOFile *file, char *inName)
 
GF_Err dump_chapters (GF_ISOFile *file, char *inName, Bool dump_ogg)
 
u32 id3_get_genre_tag (const char *name)
 
GF_Err dump_file_text (char *file, char *inName, u32 dump_mode, Bool do_log)
 
void dump_scene_stats (char *file, char *inName, u32 stat_level)
 
void PrintNode (const char *name, u32 graph_type)
 
void PrintBuiltInNodes (u32 graph_type)
 
void dump_isom_xml (GF_ISOFile *file, char *inName)
 
void dump_file_rtp (GF_ISOFile *file, char *inName)
 
void DumpSDP (GF_ISOFile *file, char *inName)
 
void dump_file_timestamps (GF_ISOFile *file, char *inName)
 
void dump_file_nal (GF_ISOFile *file, u32 trackID, char *inName)
 
void dump_file_ismacryp (GF_ISOFile *file, char *inName)
 
void dump_timed_text_track (GF_ISOFile *file, u32 trackID, char *inName, Bool is_convert, u32 dump_type)
 
void DumpTrackInfo (GF_ISOFile *file, u32 trackID, Bool full_dump)
 
void DumpMovieInfo (GF_ISOFile *file)
 
void PrintLanguages ()
 
const char * GetLanguageCode (char *lang)
 
void dump_mpeg2_ts (char *mpeg2ts_file, char *pes_out_name, Bool prog_num)
 
void PrintStreamerUsage ()
 
int stream_file_rtp (int argc, char **argv)
 
int live_session (int argc, char **argv)
 
void PrintLiveUsage ()
 
u32 grab_live_m2ts (const char *grab_m2ts, const char *outName)
 
int mp4boxTerminal (int argc, char **argv)
 
void PrintVersion ()
 
void PrintGeneralUsage ()
 
void PrintDASHUsage ()
 
void PrintFormats ()
 
void PrintImportUsage ()
 
void PrintEncodeUsage ()
 
void PrintEncryptUsage ()
 
void PrintHintUsage ()
 
void PrintExtractUsage ()
 
void PrintDumpUsage ()
 
void PrintMetaUsage ()
 
void PrintSWFUsage ()
 
void PrintUsage ()
 
void scene_coding_log (void *cbk, u32 log_level, u32 log_tool, const char *fmt, va_list vlist)
 
void SetupClockReferences (GF_ISOFile *file)
 
GF_Err HintFile (GF_ISOFile *file, u32 MTUSize, u32 max_ptime, u32 rtp_rate, u32 base_flags, Bool copy_data, Bool interleave, Bool regular_iod, Bool single_group)
 
static void check_media_profile (GF_ISOFile *file, u32 track)
 
void remove_systems_tracks (GF_ISOFile *file)
 
u32 get_file_type_by_ext (char *inName)
 
static Bool can_convert_to_isma (GF_ISOFile *file)
 
static void progress_quiet (const void *cbck, const char *title, u64 done, u64 total)
 
static Bool parse_meta_args (MetaAction *meta, u32 act_type, char *opts)
 
static Bool parse_tsel_args (TSELAction **__tsel_list, char *opts, u32 *nb_tsel_act)
 
GF_DashSegmenterInputset_dash_input (GF_DashSegmenterInput *dash_inputs, char *name, u32 *nb_dash_inputs)
 
static GF_Err parse_track_action_params (char *string, TrackAction *action)
 
static u32 create_new_track_action (char *string, TrackAction **actions, u32 *nb_track_act, u32 dump_type)
 
static void on_gpac_log (void *cbk, u32 ll, u32 lm, const char *fmt, va_list list)
 
int mp4boxMain (int argc, char **argv)
 
int main (int argc, char **argv)
 

Variables

u32 quiet = 0
 
Bool dvbhdemux =0
 
Bool keep_sys_tracks = 0
 
u32 swf_flags = 0
 
Float swf_flatten_angle = 0
 
s32 laser_resolution = 0
 
static const itunes_tag itags []
 
u32 nb_itunes_tags = sizeof(itags) / sizeof(itunes_tag)
 

Data Structure Documentation

struct itunes_tag
+ Collaboration diagram for itunes_tag:
Data Fields
u32 code
const char * name
const char * comment
struct SDPLine
+ Collaboration diagram for SDPLine:
Data Fields
u32 trackID
char * line
struct MetaAction
+ Collaboration diagram for MetaAction:
Data Fields
u32 act_type
Bool root_meta
Bool use_dref
u32 trackID
u32 meta_4cc
char szPath[1023]
char szName[1024]
char mime_type[1024]
char enc_type[1024]
u32 item_id
struct TSELAction
+ Collaboration diagram for TSELAction:
Data Fields
u32 act_type
u32 trackID
u32 refTrackID
u32 criteria[30]
u32 nb_criteria
Bool is_switchGroup
u32 switchGroupID
struct TrackAction
+ Collaboration diagram for TrackAction:
Data Fields
u32 act_type
u32 trackID
char lang[4]
s32 delay_ms
const char * kms
const char * hdl_name
s32 par_num
s32 par_den
u32 dump_type
u32 sample_num
char * out_name

Macro Definition Documentation

#define BUFFSIZE   8192
#define BASE_PAYT   96
#define CHECK_NEXT_ARG   if (i+1==(u32)argc) { fprintf(stderr, "Missing arg - please check usage\n"); MP4BOX_EXIT_WITH_CODE(1); }
#define MP4BOX_EXIT_WITH_CODE (   __ret_code)
Value:
if (mpd_base_urls) gf_free(mpd_base_urls); \
if (sdp_lines) gf_free(sdp_lines); \
if (metas) gf_free(metas); \
if (tracks) { \
for (i=0; i<nb_track_act; i++) { \
if (tracks[i].out_name) \
gf_free(tracks[i].out_name); \
} \
gf_free(tracks); \
}\
if (tsel_acts) gf_free(tsel_acts); \
if (brand_add) gf_free(brand_add); \
if (brand_rem) gf_free(brand_rem); \
if (dash_inputs) gf_free(dash_inputs); \
return __ret_code; \
void gf_free(void *ptr)
Definition: alloc.c:164
void gf_sys_close()
System closing.
Definition: os_divers.c:1270

Enumeration Type Documentation

anonymous enum
Enumerator
GF_ISOM_CONV_TYPE_ISMA 
GF_ISOM_CONV_TYPE_ISMA_EX 
GF_ISOM_CONV_TYPE_3GPP 
GF_ISOM_CONV_TYPE_IPOD 
GF_ISOM_CONV_TYPE_PSP 

Function Documentation

void convert_file_info ( char *  inName,
u32  trackID 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err import_file ( GF_ISOFile *  dest,
char *  inName,
u32  import_flags,
Double  force_fps,
u32  frames_per_sample 
)
GF_Err split_isomedia_file ( GF_ISOFile *  mp4,
Double  split_dur,
u32  split_size_kb,
char *  inName,
Double  interleaving_time,
Double  chunk_start,
Bool  adjust_split_end,
char *  outName,
const char *  tmpdir 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err cat_isomedia_file ( GF_ISOFile *  mp4,
char *  fileName,
u32  import_flags,
Double  force_fps,
u32  frames_per_sample,
char *  tmp_dir,
Bool  force_cat,
Bool  align_timelines,
Bool  allow_add_in_command 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err EncodeFile ( char *  in,
GF_ISOFile *  mp4,
GF_SMEncodeOptions opts,
FILE *  logs 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err EncodeFileChunk ( char *  chunkFile,
char *  bifs,
char *  inputContext,
char *  outputContext,
const char *  tmpdir 
)
Parameters
chunkFileBT chunk to be encoded
bifsoutput file name for the BIFS data
inputContextinitial BT upon which the chunk is based (shall not be NULL)
outputContext,:file name to dump the context after applying the new chunk to the input context can be NULL, without .bt
tmpdircan be NULL

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_ISOFile* package_file ( char *  file_name,
char *  fcc,
const char *  tmpdir,
Bool  make_wgt 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err dump_cover_art ( GF_ISOFile *  file,
char *  inName 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err dump_chapters ( GF_ISOFile *  file,
char *  inName,
Bool  dump_ogg 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 id3_get_genre_tag ( const char *  name)

+ Here is the caller graph for this function:

GF_Err dump_file_text ( char *  file,
char *  inName,
u32  dump_mode,
Bool  do_log 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dump_scene_stats ( char *  file,
char *  inName,
u32  stat_level 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void PrintNode ( const char *  name,
u32  graph_type 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void PrintBuiltInNodes ( u32  graph_type)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dump_isom_xml ( GF_ISOFile *  file,
char *  inName 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dump_file_rtp ( GF_ISOFile *  file,
char *  inName 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void DumpSDP ( GF_ISOFile *  file,
char *  inName 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dump_file_timestamps ( GF_ISOFile *  file,
char *  inName 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dump_file_nal ( GF_ISOFile *  file,
u32  trackID,
char *  inName 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dump_file_ismacryp ( GF_ISOFile *  file,
char *  inName 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dump_timed_text_track ( GF_ISOFile *  file,
u32  trackID,
char *  inName,
Bool  is_convert,
u32  dump_type 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void DumpTrackInfo ( GF_ISOFile *  file,
u32  trackID,
Bool  full_dump 
)

+ Here is the caller graph for this function:

void DumpMovieInfo ( GF_ISOFile *  file)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void PrintLanguages ( )

+ Here is the caller graph for this function:

const char* GetLanguageCode ( char *  lang)

+ Here is the caller graph for this function:

void dump_mpeg2_ts ( char *  mpeg2ts_file,
char *  pes_out_name,
Bool  prog_num 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void PrintStreamerUsage ( )

+ Here is the caller graph for this function:

int stream_file_rtp ( int  argc,
char **  argv 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int live_session ( int  argc,
char **  argv 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void PrintLiveUsage ( )

+ Here is the caller graph for this function:

u32 grab_live_m2ts ( const char *  grab_m2ts,
const char *  outName 
)

defined(GPAC_DISABLE_STREAMING) && !defined(GPAC_DISABLE_SENG)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mp4boxTerminal ( int  argc,
char **  argv 
)
void PrintVersion ( )

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void PrintGeneralUsage ( )

+ Here is the caller graph for this function:

void PrintDASHUsage ( )

+ Here is the caller graph for this function:

void PrintFormats ( )

+ Here is the caller graph for this function:

void PrintImportUsage ( )

+ Here is the caller graph for this function:

void PrintEncodeUsage ( )

+ Here is the caller graph for this function:

void PrintEncryptUsage ( )

+ Here is the caller graph for this function:

void PrintHintUsage ( )

+ Here is the caller graph for this function:

void PrintExtractUsage ( )

+ Here is the caller graph for this function:

void PrintDumpUsage ( )

+ Here is the caller graph for this function:

void PrintMetaUsage ( )

+ Here is the caller graph for this function:

void PrintSWFUsage ( )

+ Here is the caller graph for this function:

void PrintUsage ( )

+ Here is the caller graph for this function:

void scene_coding_log ( void *  cbk,
u32  log_level,
u32  log_tool,
const char *  fmt,
va_list  vlist 
)

+ Here is the caller graph for this function:

void SetupClockReferences ( GF_ISOFile *  file)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err HintFile ( GF_ISOFile *  file,
u32  MTUSize,
u32  max_ptime,
u32  rtp_rate,
u32  base_flags,
Bool  copy_data,
Bool  interleave,
Bool  regular_iod,
Bool  single_group 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void check_media_profile ( GF_ISOFile *  file,
u32  track 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void remove_systems_tracks ( GF_ISOFile *  file)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 get_file_type_by_ext ( char *  inName)

defined(GPAC_DISABLE_ISOM_WRITE) && !defined(GPAC_DISABLE_AV_PARSERS)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static Bool can_convert_to_isma ( GF_ISOFile *  file)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void progress_quiet ( const void *  cbck,
const char *  title,
u64  done,
u64  total 
)
static

+ Here is the caller graph for this function:

static Bool parse_meta_args ( MetaAction meta,
u32  act_type,
char *  opts 
)
static

+ Here is the caller graph for this function:

static Bool parse_tsel_args ( TSELAction **  __tsel_list,
char *  opts,
u32 nb_tsel_act 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_DashSegmenterInput* set_dash_input ( GF_DashSegmenterInput dash_inputs,
char *  name,
u32 nb_dash_inputs 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_Err parse_track_action_params ( char *  string,
TrackAction action 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 create_new_track_action ( char *  string,
TrackAction **  actions,
u32 nb_track_act,
u32  dump_type 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void on_gpac_log ( void *  cbk,
u32  ll,
u32  lm,
const char *  fmt,
va_list  list 
)
static

+ Here is the caller graph for this function:

int mp4boxMain ( int  argc,
char **  argv 
)

defined(GPAC_DISABLE_MEDIA_EXPORT) && !defined(GPAC_DISABLE_MEDIA_IMPORT

defined(GPAC_DISABLE_ISOM_HINTING) && !defined(GPAC_DISABLE_SENG)

+ Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

+ Here is the call graph for this function:

Variable Documentation

u32 quiet = 0
Bool dvbhdemux =0
Bool keep_sys_tracks = 0
u32 swf_flags = 0
Float swf_flatten_angle = 0
s32 laser_resolution = 0
const itunes_tag itags[]
static
Initial value:
= {
{GF_ISOM_ITUNE_ALBUM_ARTIST, "album_artist", "usage: album_artist=album artist"},
{GF_ISOM_ITUNE_ALBUM, "album", "usage: album=name" },
{GF_ISOM_ITUNE_TRACKNUMBER, "tracknum", "usage: track=x/N"},
{GF_ISOM_ITUNE_TRACK, "track", "usage: track=name"},
{GF_ISOM_ITUNE_ARTIST, "artist", "usage: artist=name"},
{GF_ISOM_ITUNE_COMMENT, "comment", "usage: comment=any comment"},
{GF_ISOM_ITUNE_COMPILATION, "compilation", "usage: compilation=yes,no"},
{GF_ISOM_ITUNE_COMPOSER, "composer", "usage: composer=name"},
{GF_ISOM_ITUNE_CREATED, "created", "usage: created=time"},
{GF_ISOM_ITUNE_DISK, "disk", "usage: disk=x/N"},
{GF_ISOM_ITUNE_TOOL, "tool", "usage: tool=name"},
{GF_ISOM_ITUNE_GENRE, "genre", "usage: genre=name"},
{GF_ISOM_ITUNE_NAME, "name", "usage: name=name"},
{GF_ISOM_ITUNE_TEMPO, "tempo", "usage: tempo=integer"},
{GF_ISOM_ITUNE_WRITER, "writer", "usage: writer=name"},
{GF_ISOM_ITUNE_GROUP, "group", "usage: group=name"},
{GF_ISOM_ITUNE_COVER_ART, "cover", "usage: cover=file.jpg,file.png"},
{GF_ISOM_ITUNE_ENCODER, "encoder", "usage: encoder=name"},
{GF_ISOM_ITUNE_GAPLESS, "gapless", "usage: gapless=yes,no"},
}
Definition: isomedia.h:2131
Definition: isomedia.h:2119
Definition: isomedia.h:2133
Definition: isomedia.h:2122
Definition: isomedia.h:2137
Definition: isomedia.h:2125
Definition: isomedia.h:2121
Definition: isomedia.h:2123
Definition: isomedia.h:2136
Definition: isomedia.h:2135
Definition: isomedia.h:2134
Definition: isomedia.h:2127
Definition: isomedia.h:2129
Definition: isomedia.h:2132
Definition: isomedia.h:2126
Definition: isomedia.h:2138
Definition: isomedia.h:2124
Definition: isomedia.h:2120
Definition: isomedia.h:2128
u32 nb_itunes_tags = sizeof(itags) / sizeof(itunes_tag)