[M4IF Technotes] simple AV recipe (Re: mp4tool enst)
Danilo Tromp
Danilo.Tromp nob.nl
Sat Apr 6 09:46:45 EST 2002
Hi,
> I basically want to encode my own video and audio files and
> use the mp4tool from enst to create
> mp4 files that have these streams included in the scenes.
I have a very easy workaround for this. Download the mpeg4ip distribution on
http://mpeg4ip.sourceforge.net/downloads/index.php (Version 0.9.2 is the one
that I used).
Here is the short recipe:
-------------------------
1. encode video to .divx with divxEnc
2. create simple .mp4 file with mp4creator
3. export the .media, .info, .nhnt from the .mp4 file with mp4tool
4. create a more advanced .mp4 file with mp4tool
> I understand from below that I will need 3 files for each
> media stream:
> >>For each raw elementary stream called stream.type, two
> files are expected:
> >>
> >>stream.info: contains the decoder specific info, a.k.a. the headers
> >>stream.nhnt: contains the description of the access units
> in contained in
> stream.type.
The long recipe:
----------------
1a. Compile the Divxenc and mp4creator projects (and their dependencies)
(1b. compile the AAC encoder, etc.)
2. Create an YUV (CCIRR YCbCr 4:2:0 / YV12) file for your video (there are
some avi2raw and rgb2yuv tools in the distribution, look at them when you
can't create YUV files by other means)
3. Encode the yuv file using the DIVXencoder. Don't forget to specify width
and height! (e.g. -w 352 -h 288 )
4. Create an MP4 file using mp4creator. Make sure that you specify the
bitrate in kbit/s (e.g. -r 500) of the video stream when you encoded the
video with another encoder then the DIVXencoder
(4b repeat this with an encoded audio file with the same target MP4 file
when you want to add audio)
5. Now do the following with mp4tool:
"mp4tool -info audio&video.mp4" to get the esID's of the audio and video in
the MP4 file
followed by
"mp4tool -export audio&video.mp4 2 video" when 2 is the esID of the video
Now you have three files:
video.media
video.info
video.nhnt
and you are free to include them in more complicated scenes
6 Try also:
"mp4tool -bt audio&video.mp4", this will result in audio&video.bt, which is
the scene description of the simple audio&video scene created by mp4creator
and
"mp4tool -mp4 audio&video.bt" to re-create the .mp4 file in mp4tool style
note: you probably need to add and "muxinfo" line in the .bt file to point
mp4tool to the video.media file
Of course you can create your own tools to make the .media, .nhnt and .info
directly, but the above recipe gets you started. The .info file is the
encoded video (.divx) until the first 000001B6 startcode. The .media file
contains the rest. On the site of ENST it is specified how to make the .nhnt
file, basicly it lists the locations of the 000001B6 startcodes.
When you are interested I can sent you the compiled win32 versions of
divxenc, mp4creator, together with some intermediate files in the above
recipe.
Danilo Tromp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/mp4-tech/attachments/20020406/2141246b/attachment.html
More information about the Mp4-tech
mailing list