Writing MPEG-4 File

Writing MPEG-4 File

Am creating MPEG-4 file using IPP/UMC MPEG4VideoEncoder. Although the resultant file is acceptable to the IPP/UMC MPEG4VideoDecoder, it doesn't look anything like what the MPEG-4 specification requires, and ordinary MPEG-4 players will not accept it.

The MPEG-4 specification requires "boxes" with 32 bit big Endian box sizes followed by 32 bit ASCII box types, e.g., FTYP or MOOV or MDAT or FREE. The MPEG-4 created by IPP/UMC appears as follows:

00000000: 00 00 01 B0 01 00 00 01 B5 89 13 00 00 01 02 00 * *
00000010: 00 01 22 00 44 88 BA 98 60 FA 62 D0 87 82 88 7F * " D ` b *
00000020: 00 00 01 B2 20 49 6E 74 65 6C 28 52 29 20 4D 50 * Intel MP*
00000030: 45 47 2D 34 20 65 6E 63 6F 64 65 72 20 62 61 73 *EG-4 encoder bas*
00000040: 65 64 20 6F 6E 20 49 6E 74 65 6C 28 52 29 20 49 *ed on Intel I*
00000050: 50 50 20 36 2E 30 20 62 75 69 6C 64 20 31 36 37 *PP 6.0 build 167*
00000060: 2E 32 36 5B 36 2E 30 2E 31 36 37 2E 36 33 32 5D *.26[6.0.167.632]*
00000070: 00 00 01 B6 10 00 18 13 E1 51 30 3C 07 F2 60 F0 * Q0< ` *
00000080: 10 39 FF 0B 41 E0 FF B7 00 CD 11 7D B8 0C 18 05 * 9 A } *
00000090: A3 10 60 3A 0C C0 87 F6 37 DF 06 05 60 96 5C 83 * `: 7 ` \ *
000000A0: 42 C0 90 5E 5C AC 18 15 00 28 18 A0 F0 7F F3 81 *B ^\ ( *
000000B0: B0 78 DF FD C2 D1 30 43 00 D1 2C 73 4A BC 5D E5 * x 0C ,sJ ] *
000000C0: 3A A3 14 88 98 A7 F8 5A B1 20 0B 20 0E 84 11 EE *: Z *
000000D0: 83 C3 40 1E A9 CF 1E B4 DE 5A A7 C3 8F 83 1B CC * @ Z *
000000E0: 52 5A 2C 12 83 60 30 20 03 C0 7F 0A 3A 65 56 8F *RZ, `0 :eV *
000000F0: C4 80 78 18 15 42 1A 70 F9 38 7C DD C4 BE 9A 39 * x B p 8| 9*

What should be done to create an MPEG-4 specification compliant file?

Thanks.

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hello,

IPP video encoder sample produces raw compressed video stream which fully comply withsupported encoder specification (including ISO/IEC 14496-2).The raw compressed video streamis not wrapped into any form of container format, like AVI, MPEG2 TS/PS or MPEG4 ISO (which you are actually referring to).

Unfortunately raw compressed video stream not widely supported in popular video players.

Regards,
Vladimir

Quoting - vdudnik

Hello,

IPP video encoder sample produces raw compressed video stream which fully comply withsupported encoder specification (including ISO/IEC 14496-2).The raw compressed video streamis not wrapped into any form of container format, like AVI, MPEG2 TS/PS or MPEG4 ISO (which you are actually referring to).

Unfortunately raw compressed video stream not widely supported in popular video players.

Regards,
Vladimir

Can you describe the "raw compressed video stream" in the sense of how it relates to MP4 boxes? Would it be reasonable to attempt to wrap the "raw compressed video stream" with appropriate MP4 boxes? Or is the "raw compressed video stream" sufficiently different from anything that would be found in an MP4 box that such an attempt would be unreasonable?

Should also note that the MPEG-2 data that I used as the input to the MPEG-4 encoder was 44Mb, whereas the MP4 [or "raw compressed video stream"] output of MPEG4VideoEncoder was 104Mb! That's a serious expansion in the wrong direction.

Thanks.

The complete MPEG4 standard consist from several parts which describe audio, video compression (and bitstream formats) and system part which describes file format. I would refer you to ISO/IEC 14496-2 specification which fully describe MPEG4 raw compressed bitstream format. Of course it can be wrapped into any suitable container format including MPEG4 ISO file format.
Regarding compression ratio, it is known that MPEG4 provides higher compression ration comparing with MPEG2. Of course it may vary in wide range depending on compression parameters you use.
Vladimir

Frank,

you can mux the raw MPEG-4 bitstream to AVI or MP4 with using ffmpeg for example

Nikolay

Leave a Comment

Please sign in to add a comment. Not a member? Join today