	README for (FlexMux to MP4)/(MP4 to FlexMux) converter

				Akira Inoue(akira@av.crl.sony.co.jp)
				Sony Corporation
				1999/12/17 
1. Introduction

These converters enable conversion between FlexMux-like format(*.fl4)
used in the current MPEG-4 Audio VM reference software and MPEG-4
Vesion 2 Intermedia Format - MP4(*.mp4).

2. How to make 

These conveters are implemented within a framework of the current
MPEG-4 Audio VM reference software using existing modules like
 common_m4a.o
 bitstream.o
 cmdline.o
 flexmux.o

mp4cnv_19991217.tgz includes:
 makefile
 src_mp4/fl4_to_mp4.c
 src_mp4/mp4_to_fl4.c
 src_mp4/README

,which must follow sam_vm991124.tar.gz and sony_991129.tgz.

(1) build MP4 reference software library.
    ftp://sc29wg11@ftp.fzi.de/systems/mp4/mp4-19991214.tgz

(2) restore sam_vm991124.tar.gz, sony_991129.tgz and
mp4cnv_19991217.tgz.
 
(3) make a symbolic link to a directory mp4lib of MP4 reference
    software library.

(4) build MP4 converter(fl4_to_mp4/mp4_to_fl4) with "ISOMP4=1".

The following is an install example of linux case:

% tar xvfz mp4-19991214.tgz
% cd mp4-19991214/mp4lib/linux/libisomp4
% make
% cd ../../../..
% tar xvfz sam_vm991124.tar.gz
% cd vm_fhg_990818up1
% tar xvfz sony_991129.tgz
% tar xvfz mp4cnv_19991217.tgz
% ln -s ../mp4-19991214/mp4lib .
% make ISOMP4=1 fl4_to_mp4 mp4_to_fl4
(copy "libtsp.a","include/libtsp.h" and "include/libtsp/AFpar.h" from
the official VM)

note:
- do NOT use "-ansi -pedantic" option for g++. MP4 reference software
library uses "long long" type, which ANSI C++ does not support.


3. Usage

3.1 FlexMux to MP4(fl4_to_mp4)

"fl4_to_mp4" converts FlexMux-like format used in MPEG-4 Audio VM
reference software to MP4 file format.

- Several Elememtary Streams in FlexMux format are stored in the several
  media tracks, which may have a dependency on the other media tracks.

- In this implementation there is a single frame data(access unit) 
  per "chunk", to which some metadata may be added.

- The parameter sampleDuration, the number of PCM samples which may
  differs depending on audioObjectType, can be specified by "-du <x>" option.
  (Because I could not find this parameter for most audioObjetType ...)

- The parameter decoderBufferSize in some FlexMux bitstreams seems to
  be vague. This parameter also can be specified by "-bsize <x>" option.

- The parameter audio_profileAndLevel can be specified by "-pl <x>"
  option.

- For bitstream in which ESNumber starts from 0, ESNumber(trackID) is
  forced to start from 1(MP4 library does not permit trackID of 0).


usage: fl4_to_mp4 -switches <bit stream file(s) (- = stdin)>
switches: -h           print help
          -o <x>       output file name (- = stdout)
          -du <x>      sample duration per frame[sample/frame]
          -bsize <x>   decoder buffer size[byte]
          -pl <x>      audio profile and level
                        0x01: main profile L1
                        0x02: main profile L2
                        0x03: main profile L3
                        0x04: main profile L4
                        0x05: scalable profile L1
                        0x06: scalable profile L2
                        0x07: scalable profile L3
                        0x08: scalable profile L4
                        0x09: speech profile L1
                        0x0a: speech profile L2 (dflt: 1)
          -d <x>       debug level (dflt: 0)

3.2 MP4 to FlexMux(mp4_to_fl4)

"mp4_to_fl4" converts MP4 file format to FlexMux-like format used in
MPEG-4 Audio VM reference software.

- AU index is restored according to "stream map table" implicitly known
  in the current MPEG-4 Audio reference software.

usage: mp4_to_fl4 -switches <bit stream file(s) (- = stdin)>
switches: -h       print help
          -o <x>   output file name (- = stdout)
          -d <x>   debug level (dflt: 0)


4. To do (???)

- Though grouping of audio frame data in each chunk may be effective to
  reduce file size, It is not clear to distingush frame boundary for
  grouped access units(for specially variable length access unit).
  How do we put several audio frame data(access units) in each chunk ?

- The parameter audio_profileAndLevel in MP4 file format can not be
  retrieved without directly parsing initialObjectDescriptor.
  In "mp4_to_fl4", this parameter is not restored currently.

- An access unit of size 0 seems not to added correctly.
  In reading MP4 file format may contain an access unit of size 0, 
  size of samples can not be obtained correcyly.


5. Tested platforms

- Linux 2.0.35, g++(egcs) 2.91.57
- Solaris 2.5.1, g++ 2.7.2.3
- Solaris 2.5.1, gcc 2.7.2.3


6. History

- initial version (1999/12/17)
