MJPEG
Encyclopedia
In multimedia
Multimedia
Multimedia is media and content that uses a combination of different content forms. The term can be used as a noun or as an adjective describing a medium as having multiple content forms. The term is used in contrast to media which use only rudimentary computer display such as text-only, or...

, Motion JPEG (M-JPEG) is an informal name for a class of video formats where each video frame or interlaced field of a digital video
Digital video
Digital video is a type of digital recording system that works by using a digital rather than an analog video signal.The terms camera, video camera, and camcorder are used interchangeably in this article.- History :...

 sequence is separately compressed
Image compression
The objective of image compression is to reduce irrelevance and redundancy of the image data in order to be able to store or transmit data in an efficient form.- Lossy and lossless compression :...

 as a JPEG
JPEG
In computing, JPEG . The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image quality. JPEG typically achieves 10:1 compression with little perceptible loss in image quality....

 image
Image
An image is an artifact, for example a two-dimensional picture, that has a similar appearance to some subject—usually a physical object or a person.-Characteristics:...

. Originally developed for multimedia PC applications, where more advanced formats have displaced it, M-JPEG is now used by many portable devices with video-capture capability, such as digital camera
Digital camera
A digital camera is a camera that takes video or still photographs, or both, digitally by recording images via an electronic image sensor. It is the main device used in the field of digital photography...

s.

Encoding

Motion JPEG uses a lossy form of intraframe compression based on the discrete cosine transform
Discrete cosine transform
A discrete cosine transform expresses a sequence of finitely many data points in terms of a sum of cosine functions oscillating at different frequencies. DCTs are important to numerous applications in science and engineering, from lossy compression of audio and images A discrete cosine transform...

 (DCT). This mathematical operation converts each frame/field of the video source from the time domain into the frequency domain (aka transform domain.) A perceptual model based loosely on the human psychovisual system discards high-frequency information, i.e. sharp transitions in intensity, and color hue. In the transform domain, the process of reducing information is called quantization. In laymen's terms, quantization is a method for optimally reducing a large number scale (with different occurrences of each number) into a smaller one, and the transform-domain is a convenient representation of the image because the high-frequency coefficients, which contribute less to the over picture than other coefficients, are characteristically small-values with high compressibility. The quantized coefficients are then sequenced and losslessly packed into the output bitstream. Nearly all software implementations of M-JPEG permit user control over the compression-ratio (as well as other optional parameters), allowing the user to trade off picture-quality for smaller file size. In embedded applications (such as miniDV, which uses a similar DCT-compression scheme), the parameters are pre-selected and fixed for the application.

M-JPEG is an intraframe-only compression scheme (compared with the more computationally intensive technique of interframe prediction
Motion compensation
Motion compensation is an algorithmic technique employed in the encoding of video data for video compression, for example in the generation of MPEG-2 files. Motion compensation describes a picture in terms of the transformation of a reference picture to the current picture. The reference picture...

). Whereas modern interframe video formats, such as MPEG1, MPEG2 and H.264/MPEG-4 AVC
H.264/MPEG-4 AVC
H.264/MPEG-4 Part 10 or AVC is a standard for video compression, and is currently one of the most commonly used formats for the recording, compression, and distribution of high definition video...

, achieve real-world compression-ratios of 1:50 or better, M-JPEG's lack of interframe prediction limits its efficiency to 1:20 or lower, depending on the tolerance to spatial artifacting in the compressed output. Because frames are compressed independently of one another, M-JPEG imposes lower processing and memory requirements on hardware devices.

As a purely intraframe compression scheme, the image-quality of M-JPEG is directly a function of each video frame's static (spatial) complexity. Frames with large smooth-transitions or monotone surfaces compress well, and are more likely to hold their original detail with few visible compression artifacts. Frames exhibiting complex textures, fine curves and lines (such as writing on a newspaper) are prone to exhibit DCT-artifacts such as ringing
Ringing artifacts
In signal processing, particularly digital image processing, ringing artifacts are artifacts that appear as spurious signals near sharp transitions in a signal. Visually, they appear as bands or "ghosts" near edges; audibly, they appear as "echos" near transients, particularly sounds from...

, smudging, and macroblocking. M-JPEG compressed-video is also insensitive to motion-complexity, i.e. variation over time. It is neither hindered by highly random motion (such as the surface-water turbulence in a large waterfall), nor helped by the absence of motion (such as static landscape shot by tripod), which are two opposite extremes commonly used to test interframe video-formats.

For QuickTime
QuickTime
QuickTime is an extensible proprietary multimedia framework developed by Apple Inc., capable of handling various formats of digital video, picture, sound, panoramic images, and interactivity. The classic version of QuickTime is available for Windows XP and later, as well as Mac OS X Leopard and...

 formats, Apple has 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.

Applications

Although the bitrate
Bitrate
In telecommunications and computing, bit rate is the number of bits that are conveyed or processed per unit of time....

 of Motion JPEG is lower than uncompressed video, it is much higher than that of video formats which use inter-frame motion compensation
Motion compensation
Motion compensation is an algorithmic technique employed in the encoding of video data for video compression, for example in the generation of MPEG-2 files. Motion compensation describes a picture in terms of the transformation of a reference picture to the current picture. The reference picture...

 such as MPEG-1
MPEG-1
MPEG-1 is a standard for lossy compression of video and audio. It is designed to compress VHS-quality raw digital video and CD audio down to 1.5 Mbit/s without excessive quality loss, making video CDs, digital cable/satellite TV and digital audio broadcasting possible.Today, MPEG-1 has become...

. The large library of legacy software, low computational requirement, ease of editing, and widely available JPEG
JPEG
In computing, JPEG . The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image quality. JPEG typically achieves 10:1 compression with little perceptible loss in image quality....

 libraries, ensures M-JPEG content will be playable well into the future, even if the applications/equipment which created the content no longer exist.

Video capture and editing

M-JPEG is frequently used in non-linear video editing systems
Non-linear editing system
In video, a non-linear editing system is a video editing or audio editing digital audio workstation system which can perform random access non-destructive editing on the source material...

. Modern desktop CPUs are powerful enough to work with high-definition video, across the wide variation in graphics and operating-systems in use. Because it is a mature format, needs no special hardware on modern PCs, and natively offers random-access to any frame, M-JPEG support is widespread in video-capture and editing equipment.

Game consoles

The PlayStation
PlayStation
The is a 32-bit fifth-generation video game console first released by Sony Computer Entertainment in Japan on December 3, .The PlayStation was the first of the PlayStation series of consoles and handheld game devices. The PlayStation 2 was the console's successor in 2000...

 game console integrated M-JPEG decompression hardware in order to play in-game FMV
Full motion video
Full motion video based games are video games that rely upon pre-recorded TV-quality movie or animation rather than sprites, vectors, or 3D models to display action in the game. In the early 1990s a diverse set of games utilized this format...

 sequences. The PlayStation Portable
PlayStation Portable
The is a handheld game console manufactured and marketed by Sony Corporation Development of the console was announced during E3 2003, and it was unveiled on , 2004, at a Sony press conference before E3 2004...

 handheld game console can play M-JPEG from the Memory Stick Pro Duo under the .avi extension with a resolution of 480×272. It can also record clips in M-JPEG via its Go!Cam
Go!Cam
The PSP Camera is a digital camera peripheral by Sony Computer Entertainment for the PlayStation Portable handheld video game system. In Japan, the PSP-300 was released as the Chotto Shot on November 2, 2006. In Singapore, the PSP Camera released in the same year. For PAL territories, it is named...

 camera. Nintendo
Nintendo
is a multinational corporation located in Kyoto, Japan. Founded on September 23, 1889 by Fusajiro Yamauchi, it produced handmade hanafuda cards. By 1963, the company had tried several small niche businesses, such as a cab company and a love hotel....

's Wii
Wii
The Wii is a home video game console released by Nintendo on November 19, 2006. As a seventh-generation console, the Wii primarily competes with Microsoft's Xbox 360 and Sony's PlayStation 3. Nintendo states that its console targets a broader demographic than that of the two others...

 game console can play M-JPEG-encoded videos on SD card using its Photo Channel. The SanDisk Sansa
SanDisk Sansa
The SanDisk Sansa is a line of 2 to 16 gigabyte flash memory-based digital audio players and portable media players produced by SanDisk.- Sansa Fuze+:...

 e200 and the Zen V
ZEN V
The ZEN V and the ZEN V Plus are portable media players manufactured by Creative Technology. The user interface on this player, the same as the one on Creative's ZEN Vision:M was patented by Creative on January 9, 2005 Creative has sued Apple over the use of this user interface, which Apple later...

 digital audio players play short M-JPEG videos.

Digital cameras

Prior to the recent rise in MPEG-4
MPEG-4
MPEG-4 is a method of defining compression of audio and visual digital data. It was introduced in late 1998 and designated a standard for a group of audio and video coding formats and related technology agreed upon by the ISO/IEC Moving Picture Experts Group under the formal standard ISO/IEC...

 encoding in consumer devices, a progressive scan form of M-JPEG also saw widespread use in 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 inferior compared to a similar sized MPEG, particularly as sound (when included) was often uncompressed PCM at a low sample rate or low-compression, low processor-demand ADPCM.

To compensate and keep file sizes and 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. Resolutions of 160×120 or 320×240 are common sizes, typically at 10, 12 or 15 frames/second, with picture quality equivalent to a JPEG setting of “50” with mono ADPCM sound sampled at ~8 kHz.

This results 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 320×240 resolution), but with minimal processing overheads. This video is typically stored in the popular Windows AVI or Apple QuickTime MOV container files, generally viewable natively (or after installation of a simple codec
Codec
A codec is a device or computer program capable of encoding or decoding a digital data stream or signal. The word codec is a portmanteau of "compressor-decompressor" or, more commonly, "coder-decoder"...

) in most versions of the applicable operating system.

The AMV video format
AMV video format
AMV is a proprietary video file format, produced for MP4 players, as well as S1 MP3 players with video playback. There are now two different MTV formats: the older one for the Actions chip, and a newer one for ALi’s M5661 chip. This format for ALi one was ALIAVI.- Format :The container is a...

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

In addition to portable players (which are mainly "consumers" of the video), many video-enabled digital cameras use M-JPEG for video-capture. For instance:
  • in August 2008, Nikon announced the D90
    Nikon D90
    The Nikon D90 is a 12.3 megapixel digital single-lens reflex camera model announced by Nikon on August 27, 2008. It is a prosumer model that replaces the Nikon D80, fitting between the company's entry-level and professional DSLR models. Nikon gives the D90's Estimated Selling Price in the U.S...

    , the first D-SLR to record video. The format used is M-JPEG. The D90 uses three different motion JPEG formats: 320×216 pixels, 640×424 pixels and 1280×720 pixels.

  • in June 2009, Pentax announced that the then-upcoming K-7
    Pentax K-7
    The Pentax K-7 is a 14.6-megapixel digital single-lens reflex camera, announced on 20 May 2009. This is the first new flagship model released by Pentax since its merger with Hoya Corporation on 31 March 2008.- Features :...

     camera will use M-JPEG in resolutions 640×416, 1280×720, and 1536×1024. The data rate for the M-JPEG files created can be up to 74 Mbit/s.

HDTV Media Players

Apple announced on September 1, 2010 that their newest version of the Apple TV would support Motion JPEG (M-JPEG) up to 35 Mbit/s, 1280 by 720 pixels, 30 frames per second, audio in ulaw, PCM stereo audio in .avi file format.

Certain media players such as the Netgear NeoTV 550 do not support the playback of M-JPEG.

IP Cameras

Many network-enabled cameras provide M-JPEG streams that network clients can connect to. Mozilla
Mozilla
Mozilla is a term used in a number of ways in relation to the Mozilla.org project and the Mozilla Foundation, their defunct commercial predecessor Netscape Communications Corporation, and their related application software....

 and Webkit
WebKit
WebKit is a layout engine designed to allow web browsers to render web pages. WebKit powers Google Chrome and Apple Safari and by October 2011 held over 33% of the browser market share between them. It is also used as the basis for the experimental browser included with the Amazon Kindle ebook...

-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.

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
QuickTime
QuickTime is an extensible proprietary multimedia framework developed by Apple Inc., capable of handling various formats of digital video, picture, sound, panoramic images, and interactivity. The classic version of QuickTime is available for Windows XP and later, as well as Mac OS X Leopard and...

 or VLC
VLC media player
VLC media player is a free and open source media player and multimedia framework written by the VideoLAN project.VLC is a portable multimedia player, encoder, and streamer supporting many audio and video codecs and file formats as well as DVDs, VCDs, and various streaming protocols. It is able to...

.

The server software mentioned above streams 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 test-server "cambozola" and webcam server "MJPG-Streamer".

Client software

Browsers such as Safari
Safari (web browser)
Safari is a web browser developed by Apple Inc. and included with the Mac OS X and iOS operating systems. First released as a public beta on January 7, 2003 on the company's Mac OS X operating system, it became Apple's default browser beginning with Mac OS X v10.3 "Panther". Safari is also the...

 and Google Chrome
Google Chrome
Google Chrome is a web browser developed by Google that uses the WebKit layout engine. It was first released as a beta version for Microsoft Windows on September 2, 2008, and the public stable release was on December 11, 2008. The name is derived from the graphical user interface frame, or...

 stream M-JPEG natively. In Firefox
Mozilla Firefox
Mozilla Firefox is a free and open source web browser descended from the Mozilla Application Suite and managed by Mozilla Corporation. , Firefox is the second most widely used browser, with approximately 25% of worldwide usage share of web browsers...

, Bug 625012 severely limits its ability to stream M-JPEG. Other browsers, such as Internet Explorer
Internet Explorer
Windows Internet Explorer is a series of graphical web browsers developed by Microsoft and included as part of the Microsoft Windows line of operating systems, starting in 1995. It was first released as part of the add-on package Plus! for Windows 95 that year...

 can display M-JPEG streams with the help of external plugins. Cambozola is an applet that can show M-JPEG streams in Java-enabled browsers.

Digital videos

Digital Video (DV
DV
DV is a format for the digital recording and playing back of digital video. The DV codec was launched in 1995 with joint efforts of leading producers of video camcorders....

) adopts a similar method by compressing video frames individually.

Criticisms

  • Unlike the video formats specified in international standard
    International standard
    International standards are standards developed by international standards organizations. International standards are available for consideration and use, worldwide...

    s such as MPEG-2
    MPEG-2
    MPEG-2 is a standard for "the generic coding of moving pictures and associated audio information". It describes a combination of lossy video compression and lossy audio data compression methods which permit storage and transmission of movies using currently available storage media and transmission...

     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. However, each particular file format usually has some standard how M-JPEG is encoded. For example, Microsoft documents their standard format to store M-JPEG in AVI files , Apple documents how M-JPEG is stored in Quicktime files, RFC 2435 describes how M-JPEG is implemented in an RTP stream, and an M-JPEG CodecID is planned for the Matroska file format.
  • JPEG is inefficient, using more bits to deliver equal quality, compared to more modern formats (such as JPEG 2000
    JPEG 2000
    JPEG 2000 is an image compression standard and coding system. It was created by the Joint Photographic Experts Group committee in 2000 with the intention of superseding their original discrete cosine transform-based JPEG standard with a newly designed, wavelet-based method...

     and H.264/MPEG-4 AVC
    H.264/MPEG-4 AVC
    H.264/MPEG-4 Part 10 or AVC is a standard for video compression, and is currently one of the most commonly used formats for the recording, compression, and distribution of high definition video...

    ). Since the development of the original JPEG standard in the early 1990s, technology improvements have made interframe compression possible. Technology improvements can be found in the designs of H.263v2 Annex I and MPEG-4 Part 2
    MPEG-4 Part 2
    MPEG-4 Part 2, MPEG-4 Visual is a video compression technology developed by MPEG. It belongs to the MPEG-4 ISO/IEC standards. It is a discrete cosine transform compression standard, similar to previous standards such as MPEG-1 and MPEG-2...

    , which use frequency-domain prediction of transform coefficient values, and in H.264/MPEG-4 AVC
    H.264/MPEG-4 AVC
    H.264/MPEG-4 Part 10 or AVC is a standard for video compression, and is currently one of the most commonly used formats for the recording, compression, and distribution of high definition video...

    , 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. These new developments make M-JPEG appear outdated and inefficient.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK