Editing MAVICA-MPEG´s by Hand
| You can edit ( cut, copy, paste) MAVICA-MPEG´s using
a simple hex editor. Since it is not necessary to mess
with the MPEG coding it should be easy to generate a more
user friendly software with an conveniant "drag and
drop" surface. What is an hex editor ?
You can calculate with hexadecimal numbers like with decimal ones. The calculator coming with windows can be switched from decimal to hexadecimal and vice versa. How do I get an hex editor ? If you load a MAVICA-MPEG in your hex editor it will look like that : 00000000 0000 01BA 2100
0100 0180 0E3B 0000 01BB ....!......;.... Look at the hex string "0000 01BA 2100". It seems that any MPEG with sound starts with that ! But it even comes better. If you look for that string to pop up again you will find that : 00007FD0 FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF ................ Voila´ after exactly $8000 bytes (which is 32768 in
the decimal system) its there again. And coming back
after $10000 bytes and so on every $8000 bytes. So its
quite obvious that a MAVICA-MPEG comes in blocks of $8000
bytes each. Each block contains 9 frames (single pictures) and the sound information. So you can split up a movie into several blocks like I did it down below. Its easy as you can use a hex editor like any simple text editor to cut, copy and paste blocks.
Here you can see the original video The singe blocks contain a lot of "FF´s" in their tail which seem not to contain any information and could be deleted without harming the picture information, however they seem to be necessary to "synchronize" the sound. You can trim an MPEG by loading it into an hex editor and just delete the unwanted blocks and save the result as a new MPEG. You can also glue together different MPEG´s with copy and paste. There are two things you need to take special care for. 1. The last block of a MPEG does not contain the "tail" and is sligtly different. You have to repair that before you can glue a MPEG to the very end of an other. The end of the last block of a MPEG looks like that : 0013EAA0 0080 10CE 0000
0100 0097 FFFC 8000 0001 ................ As this structure in a "normal" block looks like that : 000769C0 0000 97FF FC80
0000 0101 4270 1002 0040 ..........Bp...@ Note that this example is "shifted" by one byte. Just replace 01B7 with 01BE and 01B9 with 0FFF and fill up the rest with "FF´s" until the next full multiple of $8000 bytes. In our example the "repaired" last block would then look like that : 0013EAA0 0080 10CE 0000
0100 0097 FFFC 8000 0001 ................ now there come a lot of "FF´s" until. : 0013FFE0 FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF ................ At the position $140000 you can add a new block or a series of blocks. 2. The second catch is, you can not take a block which
is taken out of the middle of a MPEG to start a new MPEG.
The first block of each MPEG is slightly different and
seems to contain a "starter code". I did not
figure out yet how to convert a regular block into a
"starter" block. So I use a trick to start a
MPEG with a block taken out of the middle. Anyhow this type of editing is somewhat crude and may not work all times. But here is an example of a MPEG edited with this simple method.
As long as you leave the MPEG code itself untouched editing is quick and does not degrade the quality of your MPEG´s or blows up the file size. Of course you can not turn, resize, change brightness or contrast etc. because this would mean manipulation of a single frame (picture) which makes it necassary to uncode and recode the single picture, which will degrade the quality of your MPEG and/or blow up the file size. Its the same catch as if you uncompress and decompress single pictures in the JPEG format. I don´t know how to create my own computer programs under windows to produce a more user friendly editing software. Also I should know more about the specifications of the MPEG file format. But maybe somebody else has the brain and the guts to do it. It can´t be so hard at all. Sell the patent to Sony and make a fortune..... |