开发者

mjpeg and h264 codecs

开发者 https://www.devze.com 2023-02-09 10:16 出处:网络
What is the difference between mjpeg开发者_运维知识库 and h264?Mjpeg is just a list of jpeg files in a single file or data stream. There is no interframe compression. Put another way, every frame is a

What is the difference between mjpeg开发者_运维知识库 and h264?


Mjpeg is just a list of jpeg files in a single file or data stream. There is no interframe compression. Put another way, every frame is a key frame.

h264 is very different from Mjpeg - start here: http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC

(Mpeg (no 'j') is different from Mjpeg, but very similar to H264)


first know that The H.264 & MPEG-4 AVC & MPEG-4 part 10 are the same. check this

now

  1. With moving cameras or images of high activity areas, MPEG4 and H.264 provide little bandwidth savings relative to MJPEG.

  2. Proper network design requires factoring in worse case scenarios so you will need to dedicate the same amount of bandwidth whether or not you use MJPEG, MPEG4 or H.264.

  3. MJPEG provides higher quality because of no intra-frame compression.

  4. Unlike MJPEG, with MPEG-4 vendors deviate from standards, increasing potential integration costs.

While H.264 generally reduces bandwidth consumption significantly, it depends on multiple factors (including complexity, streaming mode, frame rate and i frame rate). VBR vs CBR selection is especially important, having a especially large impact on use and performance. Finally, while H.264 can deliver the same visible image quality as MJPEG, depending on the settings you use (especially streaming mode), you can easily generate worse quality.


Video compression is achieved from 2 forms of prediction:

  • Intra prediction: using information from within the same frame.
  • Inter prediction: using information from a reference frame.

Inter prediction is generally a lot better, as it allows areas of the video that are similar between frames to be encoded very cheaply. This is where H.264 gains most of its compression.

A single JPEG image is just an intra frame, and MJPEG is just a sequence of JPEG images. MJPEG has no inter frames at all.

In fact even an H.264 intra frame will offer much better compression than a JPEG frame (this is partly why Google pushed WebP).

For most use cases H.264 will have much better compression than MJPEG, but the encode/decode process is a lot more complex, which is why things without much computing power e.g. webcams spit out MJPEG.

It would have to be a rather pathological case for an good H.264 encoder to perform as badly as a good MJPEG encoder, e.g. randomly generated pixel values.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号