Jump to content

Motion JPEG

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Mvjs (talk | contribs) at 03:24, 12 October 2008 (Reverted 1 edit by 210.49.187.194 identified as vandalism to last revision by 196.11.146.107. using TW). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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.

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.

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.

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. However, although the bitrate of Motion JPEG is substantially better than completely uncompressed video, it is substantially worse than that of video codecs which use inter-frame motion compensation such as MPEG-1. (One exception may be in surveillance cameras which only take one frame per second, in which time there could be large amounts of motion which MPEG could not compensate for.)

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. The Playstation Portable handheld game console can play M-JPEG from the Memory Stick Pro Duo under the .avi extension with a resolution of 480x272. It can also record clips in M-JPEG via its Go!Cam camera. Nintendo's Wii game console can play M-JPEG-encoded videos off an SD card using its Photo Channel. The SanDisk Sansa and the Zen V digital audio players play short M-JPEG videos.

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

In August 2008, Nikon announced the D90 - the first D-SLR to record video. The format used is M-JPEG.

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.

IP Cameras

Many network-enabled cameras provide M-JPEG streams that network clients can connect to. Mozilla-based browsers have native support for viewing these M-JPEG streams.

Some network-enabled cameras provide their own M-JPEG interfaces as part of the normal feature set. For cameras that don't provide this feature natively, a server can be used to transcode the camera pictures into an M-JPEG stream and then provide that stream to other network clients.[citation needed]

M-JPEG over HTTP

HTTP streaming separates each image into individual HTTP replies on a specified marker. 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 sent 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.

Client software

Mozilla based browsers, such as Netscape and Firefox, have native support for viewing M-JPEG streams. Other browsers, such as Internet Explorer and Opera can display M-JPEG streams with the help of external plugins[citation needed]. Cambozola is an applet that can show M-JPEG streams in Java-enabled browsers.

Digital videos

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

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.
  • JPEG has a relatively high bit rate for the delivered quality, requiring more storage space than more modern formats (such as JPEG 2000) for a given image quality.
  • Since the development of the original JPEG standard in the early 1990s, technology improvements have made intraframe compression possible. 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 editing, ease of implementation by developers using existing JPEG algorithms or libraries, and broad compatibility.

External links