Introdution
***********
This is an Amiga version of Christph Moars MPEG-
multiplexer "MPLEX". This tool enables you to mix a
MPEG video and audiostream into one single MPEG-System stream.
In other words:
Now you can create MPEG videos with sound!



Example
*******
To demonstrate the usage of mplex we need a video and a matching
audiostream. Here we simply split an existing system stream
into its single parts and the join them together again using
mplex. We will use splitmpeg (Aminet) to split the promotion
video for Maxon Cinema 4D from the CD of German AmigaPlus 8/98.

9.Leer1:MpgTest> splitmpeg cd0:cinema4d.mpg

SYSTEM HEADER
-------------
Maximum Multiplexed data rate =176400 bytes per second
Max number of audio streams = 1
Bitrate is variable
Multiplexed stream meets constrained parameters
There is a constant rational relationship between the
audio sampling rate and the system clock frequency in the system
target decoder
There is a constant rational relationship between the
video picture rate and the system clock frequency in the system
target decoder
Max number of video streams = 0
Reserved_byte = ff
Stream Information
    for stream 1c0 :         Buffer bound = 32768 bytes


Processing Complete
  Processed 17087 Packs , 2 system headers and 17089 Packets
9.Leer1:MpgTest>

When this command has finished we got three new files:
Leer1:MpgTest/stm190.mpg    (Paddingstream)
Leer1:MpgTest/stm192.mpg    (Audiostream)
Leer1:MpgTest/stm224.mpg    (Videostream)
Only the audio and video file is of intrest for us.



Multiplexing of the both streams
********************************
Now we can use mplex to (re)mix these two streams to a new
single systemstream.

mplex-1.1 stm224.mpg stm192.mpg system.mpg

Attention!
Do not forget to specify the outputfile! There will be no
warning from mplex. Mplex will assume that you want to create
a systemfile without audio or video, so it will use the second
parameter as the output filename. This file will then be overwritten!

First mplex scans the video and audiostream and displays a lot of
information about your streams.
Then you have to input some parameters.

The following values have been used for testing:

sector size (CD-ROM 2324 bytes)          :   2324
packs to packets ratio                   :      1
STD video buffer in kB (CSPS: max 46 kB) :     40
STD audio buffer in kB (CSPS: max  4 kB) :      4
target data rate (e.g. 175050)           : 175050
startup sectors_delay                    :      8
startup sectors_delay                    :      0
video stream startup offset (ms)         :      0

The answer to the question "very verbose mode?" should be "n",
otherwise a huge amount of messages will be displayed.



Speed, differnt versions
************************
The program has been compiled using SAS/C for 68000 and ppc as well
as using gcc (Geek-Gadgets, ADE) for 68000.
The SAS/C version has stack checking enabled, so it should work with
every configuration without any problems.
The gcc version runs a little bit faster but needs the ixemul.library.

For the example above I got the following results (68060/50/604e/200)
sas68k 6 Min  8 Sek
gcc68k 4 Min 55 Sek
sasppc 2 Min 46 Sek



notice, changes to the original
*********************************
I have only compiled the program for the Amiga, I can not help you
with the correct parameters! Please read the documentations in the
original archive!
With gcc no changes to the original files were necessary.
There are some smaller changes for the SAS compiler. The changes are
in the file main.c and they are well commented.

And now start your own project!
Alexander Fritsch







PS.
If you are a programmer and still locking for a good idea what to
do:
In the Aminet there seems to be no program for creating MPEG videos
(or audio files) directly from VLabMotion/Movieshop. So you could make
an AREXX script or something like that...

