Motion JPEG

From Wikipedia, the free encyclopedia

(Redirected from MJPEG)
Jump to: navigation, search

In multimedia, Motion JPEG (M-JPEG) is an informal name for multimedia formats where each video frame or interlaced field of a digital video sequence is separately compressed as a JPEG image. It is often used in mobile appliances such as digital cameras.

Contents

[edit] Encoding

Motion JPEG uses intraframe coding technology that is very similar in technology to the I-frame part of video coding standards such as MPEG-1 and MPEG-2, but does not use interframe prediction. The lack of use of interframe prediction results in a loss of compression capability, but eases video editing, since simple edits can be performed at any frame when all frames are I-frames. Video coding formats such as MPEG-2 can also be used in such an I-frame only fashion to provide similar compression capability and similar ease of editing features.

Using only intraframe coding technology also makes the degree of compression capability independent of the amount of motion in the scene, since temporal prediction is not being used. (Using temporal prediction can ordinarily substantially improve video compression capability, but makes the compression performance dependent on how well the motion compensation performs for the scene content.) Because of this, it is used in surveillance cameras which only take one frame per second, in which time there could be large amounts of change.

For Quicktime formats, Apple have defined two types of coding: MJPEG-A and MJPEG-B. MJPEG-B no longer retains valid JPEG Interchange Files within it, hence it is not possible to take a frame into a JPEG file without slightly modifying the headers.

The bitrate falls between uncompressed formats (like RGB, compression 1:1, and YCbCr, compression 1:1.5 to 1:2.5) and MPEG (1:100). Data rates in the range of 29 Mbit/s are very high quality, but also result in comparatively large file sizes.

[edit] Applications

M-JPEG is frequently used in non-linear video editing systems. Reproduction of this format at full speed requires fast JPEG decoding capability.

M-JPEG is also commonly used by IP based video cameras via HTTP streams by using the multipart/x-mixed-replace content type or via RTP.

The PlayStation game console has integrated M-JPEG decompression hardware in order to play in-game FMV sequences. Nintendo's Wii game console can play M-JPEG-encoded videos off an SD card using its Photo Channel. The SanDisk Sansa digital audio player plays short M-JPEG videos.

The AMV video format, common on cheap "MP4" players, is a modified version of M-JPEG.

[edit] Digital cameras

Prior to the recent rise in MPEG-4 encoding in consumer devices, a progressive scan form of MJPEG also saw widespread use in e.g. the “movie” modes of Digital Still Cameras, allowing video encoding and playback through the integrated JPEG compression hardware with only a software modification. Again, the resultant quality is markedly reduced compared to MPEG compression at a similar bitrate, particularly as sound (when included) was often uncompressed PCM or low-compression (and low processor-demand) ADPCM.

To compensate and keep file sizes / transfer rates under control, frame sizes and rates, along with sound sampling rates, were kept relatively low, with very high levels of compression for each individual frame; e.g. 160×120 or 320×240 common sizes, typically at 10, 12 or 15 frames/second, with picture quality equivalent to a JPEG setting of “50” (harsher compression than used commercially in typical digital stills) and 8 kHz mono ADPCM sound.

This resulted in a very basic, but still servicable video output at a similar storage cost to MPEG (~120 kB/s video rate, ~8 kB/s audio – or approx 1 Mbit/s at “high” 320×240 resolution), but with minimal processing overheads. This user generated content was typically stored in the popular Windows AVI or Apple Quicktime MOV container files, generally viewable natively (or after installation of a simple CODEC driver) in most versions of the applicable operating system.

[edit] IP Webcams

Many network enabled cameras (web-accessible cameras) provide a stream of JPEG pictures. Many clients like the Firefox webbrowser can display such a videostream directly. The most popular browser Internet Explorer can display M-JPEG streams with the help of plugins.

[edit] Server software

Several solutions allow to setup a webcam server. They copy and transcode pictures from an image source like a webcam and provide a webinterface to stream the video to clients. Popular implementations are:

  • Motion [1]
  • Zoneminder [2]
  • MJPG-streamer [3]
[edit] M-JPEG over HTTP

HTTP streaming separates each image into individual HTTP replies on a specified marker. Mozilla based browsers like Netscape and Firefox have native support for viewing these streams whereas Internet Explorer does not. RTP streaming creates packets of a sequence of JPEG images that can be received by clients such as Quicktime or VLC.

The server software mentioned above stream the sequence of JPEGs over HTTP. A special mime-type content type multipart/x-mixed-replace;boundary= informs the browser to expect several parts as answer separated by a special boundary. This boundary is defined within the MIME-type. For M-JPEG streams the JPEG data is send to the client with a correct HTTP-header. The TCP connection is not closed as long as the client wants to receive new frames and the server wants to provide new frames. Two basic implementations of such a server are the test-server of cambozola and the webcam server MJPG-Streamer.

[edit] Client software

Popular multimedia player like VLC and MPlayer can retrieve and display M-JPEG streams. Also several browser plugins like the Java-Applet Cambozola enable browsers like Internet Explorer, Mozilla, Firefox and Opera to show such streams.

[edit] Digital videos

Digital Video (DV) adopts a similar method by compressing video frame individually.

[edit] Criticisms

  • Unlike the video formats specified in international standards such as MPEG-2 and the format specified in the JPEG still-picture coding standard, there is no document that defines a single exact format that is universally recognized as a complete specification of “Motion JPEG” for use in all contexts. This raises compatibility concerns about file outputs from different manufacturers.
  • The format has a relatively high bit rate for the delivered quality, requiring more storage space than more modern formats for a given image quality.
  • Since the development of the original JPEG standard in the early 1990s, technology improvements have made intraframe compression possible. The JPEG organization itself has developed a new design called JPEG 2000, and other types of such technology improvements can be found in the designs of H.263v2 Annex I and MPEG-4 Part 2, which use frequency-domain prediction of transform coefficient values, and in H.264/MPEG-4 AVC, which uses spatial prediction and adaptive transform block size techniques and more sophisticated entropy coding than what was practical when the first JPEG design was developed. As a result, MJPEG is an outdated and inefficient codec, whose main advantages are low processor overhead, ease of implementation by developers using existing JPEG algorithms or libraries, and broad compatibility. These features are not to be undervalued, as many applications in high framerate real time image processing require a stable open-source solution that can be easily implemented with a minimal impact on the processor load. Where processor overhead and/or security concerns with proprietary code are more significant than bandwidth, MJPEG is clearly superior to MPEG-4.[weasel words]

[edit] External links

de:Motion JPEG

es:MJPEG fr:Motion-JPEG it:MJPEG hu:Motion JPEG ja:Motion JPEG ru:MJPG sv:MJPEG zh:Motion JPEG

Views
Personal tools

Toolbox