Software Development Kit

MxPEG Frame/Stream Format

Single JPEG Frame

This is a schmetical JPEG compliant frame. Between the mandatory SOI and EOI markers there's the textual M1IMG comment. Then there's the MOBOTIX Frame Header (MXF). The usual quantization and Huffman table definitions follow (DQT & DHT), succeeded by the scan streams (SOS). In clip files or live streams audio data may follow, introduced by the APP13 marker.

SOI Start of Image & APP0
0000:0040                               ff d8 ff e0 00 10           ..
0000:0050 4a 46 49 46 00 01 01 00 00 01 00 01 00 00       JFIF..........  
M1IMG JPEG comment
0000:0050                                           ff fe               
0000:0060 04 a3 23 3a 4d 31 49 4d 47 0d 0a 53 45 43 54 49 .#:M1IMG..SECTI
0000:0070 4f 4e 20 46 49 4e 47 45 52 50 52 49 4e 54 0d 0a ON FINGERPRINT..
0000:0080 56 45 52 3d 31 2e 30 0d 0a 50 52 44 3d 4d 4f 42 VER=1.0..PRD=MOB
0000:0090 4f 54 49 58 0d 0a 46 52 4d 3d 31 30 39 38 38 34 OTIX..FRM=109884
0000:00a0 36 32 0d 0a 44 41 54 3d 32 30 30 35 2d 30 31 2d 62..DAT=2005-01-
[...]
0000:04c0 4c 45 54 3d 31 39 3a 33 30 3a 34 39 0d 0a 50 45 LET=19:30:49..PE
0000:04d0 56 3d 56 4d 2c 31 33 37 34 38 31 2e 31 0d 0a 50 V=VM,137481.1..P
0000:04e0 45 56 3d 52 44 2c 31 30 33 36 34 38 2e 32 0d 0a EV=RD,103648.2..
0000:04f0 45 4e 44 53 45 43 54 49 4f 4e 20 45 56 45 4e 54 ENDSECTION EVENT
0000:0500 0d 0a 00                                        ...             
MXF MOBOTIX Frame Header
0000:0500          ff fe 00 43 4d 58 46 00 51 82 00 01 84    .CMXF.Q....
0000:0510 90 e7 f4 c9 ec 03 00 ae ab a7 00 da 64 66 00 0a ....df..
0000:0520 19 02 00 59 8f d9 41 00 00 00 00 00 00 00 00 00 ...Y.A.........
0000:0530 00 00 00 00 00 00 00 be 30 01 00 c4 f8 00 00 57 .......0....W
0000:0540 40 01 00 00 00 00 00 00                         @.......        
DQT & DHT
Quantization and Huffman Tables
0000:0540                         ff db 00 43 00 09 06 07         .C....
0000:0550 08 07 06 09 08 08 08 0b 0a 09 0b 0e 18 0f 0e 0d ................
0000:0560 0d 0e 1d 15 16 11 18 23 1e 24 24 22 1e 21 21 26 .......#.$$".!!&
0000:0570 2b 37 2f 26 29 34 29 21 21 30 41 30 34 39 3b 3e +7/&)4)!!0A049;>
0000:0580 3e 3e 25 2e 44 48 43 3c 48 37 3c 3e 3b ff db 00 >>%.DHC<>;.
0000:0590 43 01 0a 0b 0b 0e 0c 0e 1c 0f 0f 1c 3b 27 21 27 C...........;'!'
[...]
0000:0760 a3 a4 a5 a6 a7 a8 a9 aa b2 b3 b4 b5 b6 b7 b8 b9 
0000:0770 ba c2 c3 c4 c5 c6 c7 c8 c9 ca d2 d3 d4 d5 d6 d7 
0000:0780 d8 d9 da e2 e3 e4 e5 e6 e7 e8 e9 ea f2 f3 f4 f5 
0000:0790 f6 f7 f8 f9 fa                                             
SOS JPEG scans
0000:0790                ff da 00 0c 03 01 00 02 11 03 11      .........
0000:07a0 00 3f 00 d1 d7 fc 5d a6 4f ab f8 d2 08 7f b2 e3 .?.]O..
0000:07b0 41 a4 cd 1c 7a 94 72 8d f7 0d e5 47 b2 30 d9 c1 A.z.r..G0
0000:07c0 6d cf 20 38 e4 ed 41 fc 1c f3 5e 25 ba 8a e3 c3 m 8A.^%.
0000:07d0 3e 13 84 5e 59 34 f6 d1 5c 2c f6 f0 dc 45 bd 0b >..^Y4\,E.
0000:07e0 b2 34 7b 91 4e 72 55 49 27 1d 7a f2 79 c7 f1 11 4{.NrUI'.zy.
0000:07f0 f0 ed a5 b4 a3 4f 5f 39 d8 c5 f6 79 22 9d 32 78 O_9y".2x
0000:0800 cb f9 8a 65 2d eb ff 00 2c d3 04 62 af ea 30 e9 .e-.,.b0
0000:0810 90 69 f7 37 d0 46 23 17 b2 40 ba 6c 12 2c a2 40 .i7F#.@l.,@
0000:0820 30 a6 52 41 e0 8c 12 77 02 57 a7 34 8e a8 f2 ab 0RA..w.W4.
0000:0830 3d 77 3a ef 1b eb da 1b e9 3a bd a5 95 d2 c8 d7 =w:..:.
[...]
0001:4520 fd 29 24 b9 05 78 94 7e 26 ab 7f 6b ea 1f f4 12 )$.x.~&.k..
0001:4530 bb ff 00 c0 87 ff 00 1a 41 ac 6a 5d b5 0b a3 f5 ....Aj].
0001:4540 94 9f e7 59 e9 d8 d2 de 65 86 9e 2c 7d e5 ff 00 ..Ye..,}.
0001:4550 be a9 82 70 3a 30 e3 9e b5 01 d6 75 2f f9 fc 90 .p:0..u/.
0001:4560 ff 00 bc 15 bf 98 a8 db 58 bf ef 32 1f ad bc 47 ...X2.G
0001:4570 f9 ad 3b 26 49                                  ;&I           
EOI End of Image
0001:4570                ff d9                                          
APP13 Audio Data
(optional)
0001:4570                      ff ed 19 0e 00 35 0c 00 fd        ...5..
0001:4580 56 ee f4 c9 ec 03 00 77 44 44 d1 51 d0 c5 d8 54 V..wDDQT
0001:4590 44 d0 db d2 d6 52 5b 46 54 d7 d5 d8 d9 c0 de d0 DR[FT
0001:45a0 c7 54 d4 53 72 44 cd 5e d2 d1 db df 52 5c 4d d8 TSrD^R\M
0001:45b0 d0 51 d7 43 50 d0 c7 d1 54 c3 c5 57 d4 58 41 d8 QCPTWXA
0001:45c0 d1 4e 5b d2 71 42 53 53 cc de c8 c9 c3 dd 55 d5 N[qBSSU
[...]
0001:5e40 ce 43 d1 df d0 56 50 c3 45 55 d4 53 c0 d5 5e d3 CVPEUS^
0001:5e50 d3 57 57 5a 77 d0 d3 d1 d7 46 5c 56 55 54 de dd WWZwF\VUT
0001:5e60 f7 54 52 d3 dd c3 51 d7 4b 47 f5 d0 dd d6 45 51 TRQKGEQ
0001:5e70 47 55 50 52 d9 d3 56 5a d9 57 5b 5c 51 ca f0 d2 GUPRVZW[\Q
0001:5e80 51 44 74 50 55 41 5c                            QDtPUA\         

MxPEG Frame

Such a frame is no full JPEG. I contains a minimal JPEG header and marker set. The M1IMG comment is currently not included. There are plans to include M1IMG when and only when there's a change in its data. Hence the MXF MOBOTIX Frame Header is the first comment, followed by the MXM comment. MXM contains the bitmask showing which of all MCUs are included in the current frame. The tables are inserted every 10 seconds in the live stream by default. This parameter may be overridden by specifying different values for the jpheader... values when retrieving the stream. Of clip files, only the first frame contains the tables. The sparse image's JPEG scans follow. Again, optional audio data may be appended to the JPEG, indicated by the APP13 marker.

SOI Start of Image & APP0
0001:5eb0                                     ff d8 ff e0             
0001:5ec0 00 10 4a 46 49 46 00 01 01 00 00 01 00 01 00 00 ..JFIF..........
MXF MOBOTIX Frame Header
0001:5ed0 ff fe 00 43 4d 58 46 00 51 82 00 01 12 cd fa f4 .CMXF.Q....
0001:5ee0 c9 ec 03 00 bc ab a7 00 df 64 66 00 0a 19 02 00 ...df.....
0001:5ef0 59 8f d9 41 00 00 00 00 00 00 00 00 00 00 00 00 Y.A............
0001:5f00 00 00 00 00 f6 c9 01 00 56 03 01 00 2d fd 01 00 ......V...-..
0001:5f10 00 00 00 00 00                                  .....           
MXM Bitmask of changed MCUs
0001:5f10                ff fe 00 a4 4d 58 4d 00 28 00 1e      .MXM.(..
0001:5f20 00 00 00 00 00 00 c0 00 00 00 00 00 00 00 00 00 ...............
0001:5f30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 80 ................
0001:5f40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0001:5f50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0001:5f60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0001:5f70 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ...
0001:5f80 ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 00 .....
0001:5f90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0001:5fa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0001:5fb0 00 00 00 00 00 00 00 00 00 00 00                ...........       
DQT & DHT
Quantization and Huffman Tables (optional)
 
SOS JPEG scans
MCUs according to MXM
0001:5fb0                                  ff da 00 0c 03            ...
0001:5fc0 01 00 02 11 03 11 00 3f 00 af e2 6d 70 ea 9a 46 .......?.mp.F
0001:5fd0 a7 36 ad aa 5b 7d b6 59 ed c5 95 b6 9b a8 ca 52 6[}Y..R
0001:5fe0 75 cf cd be 0f 31 82 a8 50 1b 94 43 91 cf 27 15 u;.1.P..C.'.
0001:5ff0 cb 5c 5b 25 bd b5 9c bf 6c b6 92 4b a5 76 f2 23 \[%.l.Kv#
0001:6000 93 74 91 05 60 32 eb 8f 97 39 e3 d6 af ea bf d9 .t..`2..9֯
[...]
0001:8f60 8a e2 4a e7 6b 76 44 17 84 c9 9c 1c 56 6a ee 52 .JkvD....VjR
0001:8f70 73 91 81 53 b5 d2 e4 9c 73 9a af 24 85 81 07 b9 s..S.s.$...
0001:8f80 c7 35 b2 56 33 67                               5V3g          
EOI End of Image
0001:8f80                   ff d9                                       
APP13 Audio Data
(optional)
0001:8f80                         ff ed 03 2e a0 86 01 00         .. ...
0001:8f90 fb 8b fa f4 c9 ec 03 00 dc 58 d3 d4 46 c5 d2 d0 ...XF
0001:8fa0 45 4b dd c7 d3 77 5b d4 5a 54 d3 da ce f4 cf de EKw[ZT
0001:8fb0 5a 53 54 51 51 c4 dd d3 cb d4 d2 5f 5b de 59 df ZSTQQ_[Y
[...]
0001:9290 c3 de d8 db 45 46 41 50 f5 de cc c4 d4 de 51 56 EFAPQV
0001:92a0 d8 53 c8 dd 58 44 4b 52 47 5d dd 55 d1 51 48 4d SXDKRG]UQHM
0001:92b0 5e 54 d3 c3 57 75 dd ce                         ^TWu        

MxPEG Live Stream ()

Between the frames of an MxPEG stream, the usual HTTP/MIME overhead text is inserted. Again, the first frame is a complete JPEG frame, including tables. MxPEG frames follow, separated by boundary, content type, and an optional content length.

http: Response Header
HTTP/1.0 200 OK<0D><0A>
Content-type: multipart/x-mixed-replace; boundary="MOBOTIX_Fast_Serverpush"<0D><0A>
<0D><0A>
http: Boundary & Content-type
--MOBOTIX_Fast_Serverpush<0D><0A>
Content-type: image/jpeg<0D><0A>
Content-length: 55650<0D><0A>
<0D><0A>
Full JPEG
SOI Start of Image & APP0
M1IMG JPEG Comment
MXF MOBOTIX Frame Header
DQT & DHT (Tables)
SOS JPEG Scans
EOI End of Image
Optional: APP13 Audio Data
http: Boundary & Content-type
--MOBOTIX_Fast_Serverpush<0D><0A>
Content-type: image/jpeg<0D><0A>
<0D><0A>
MxPEG Frame
SOI Start of Image & APP0
MXF MOBOTIX Frame Header
MXM Bitmask
Optional / every 10 s:
DQT & DHT (Tables)
SOS Scans
MCUs according to MXM
EOI End of Image
Optional: APP13 Audio Data
http: Boundary & Content-type
--MOBOTIX_Fast_Serverpush<0D><0A>
Content-type: image/jpeg<0D><0A>
<0D><0A>
MxPEG Frame SOI & APP0,
MXF,
MXM,
(DQT & DHT,)
SOS,
EOI,
(APP13)
Boundary,
MxPEG Frame,
Boundary,
MxPEG Frame
usw ...
http: Closing Boundary
--MOBOTIX_Fast_Serverpush--<0D><0A>

MxPEG Clip File

As above, without HTTP Overhead. Full JPEG frames and MxPEG frames embedded chronologically. The first frame of a clip file (Mnnnnn.jpg) is always a full JPEG. This may be the event image or the first pre-alarm image. After that, MxPEG frames follow for max. 10 s at the selected frame rate.

Full JPEG
SOI Start of Image & APP0
M1IMG JPEG Comment
MXF MOBOTIX Frame Header
DQT & DHT (Tables)
SOS Scans
MCUs according to MXM
EOI End of Image
Optional: APP13 Audio Data
MxPEG Frame
SOI Start of Image & APP0
MXF MOBOTIX Frame Header
MXM Bitmask
SOS Scans
MCUs/Kacheln laut MXM
EOI End of Image
Optional: APP13 Audio Daten
MxPEG Frame SOI & APP0,
MXF,
MXM,
SOS,
EOI,
(APP13)
Up to 10 seconds of further MxPEG frames.


Key

HTTP Data
fixed JPEG/MxPEG Components
JPEG Comments
Quantization & Huffman Tables
Audio Data

Copyright (c) 2005-2007, MOBOTIX AG. All rights reserved.