Fixed-rate 30Mbps MJPEG with in-camera playback

Lpowell

Veteran
While many have achieved 70Mbps MJPEG bitrates for well-lit, high-detail scenes, I noticed that low-light videos with these settings would drop below 20Mbps, and produce murky images with noticeable Fixed Pattern Noise. This was because the effective qualtity factor for high-detail scenes would exceed 90%, while for low-light scenes, it could dip below 60%. This seemed backward to me, since with the GH1, it's the dimly lit videos that really need a boost in quality, while bright scenes have enough luminance to provide plenty of detail for the sensor.

I also suspected that in-camera playback would fail with MJPEG videos whose bitrates exceed ~35Mbps. What seemed like a useful goal would be to cap the high-detail bitrate under 35Mbps, while raising the low-light bitrate to something like 30Mbps.

After some experimentation with PTool 3.37, I realized that I could control video bitrate solely with the E1-4 Table patches, leaving the E1-4 Quality patches at their default settings. And with the following settings, I achieved a consistant bitrate of ~30Mbps for both bright and dimly lit scenes in 422 color at 720p, 30fps:


  • MJPEG E1 Quality = 128 (default)
  • MJPEG E1 Table = 116
  • MJPEG E2 Quality = 110 (default)
  • MJPEG E2 Table = 86
  • MJPEG E3 Quality = 100 (default)
  • MJPEG E3 Table = 56
  • MJPEG E4 Quality = 92 (default)
  • MJPEG E4 Table = 56

With a bitrate below 35Mbps, I had no trouble using both Class 10 SanDisk and Class 6 Transend SD cards. The highest bitrate I've seen with these settings was a static video of PappasArts' Star Chart, which produced ~32bps. With dimly-lit scenes, I've seen JPEG quality levels over 80% at compression ratios of around 15:1. As expected, JPEG quality level for high-detail scenes drops to around 65% witth compression ratios over 20:1. These are very good numbers for a consistent bitrate of 30Mbps, producing in-camera videos that look considerably better than those taken with the default GH1 settings.
 
Last edited:
thats quite an interesting find. close to constant bitrate would be highly desirable. how do your new higher bitrate low light footage stack up to the lower bitrate with patch?
 
how do your new higher bitrate low light footage stack up to the lower bitrate with patch?
In low-light, you get two to three times as much bitrate as the default settings gave you. This appears to bring out more shadow detail, up to the point where Fixed Pattern Noise predominates.
 
While many have achieved 70Mbps MJPEG bitrates for well-lit, high-detail scenes, I noticed that low-light videos with these settings would drop below 20Mbps, and produce murky images with noticeable Fixed Pattern Noise. This was because the effective qualtity factor for high-detail scenes would exceed 90%, while for low-light scenes, it could dip below 60%. This seemed backward to me, since with the GH1, it's the dimly lit videos that really need a boost in quality, while bright scenes have enough luminance to provide plenty of detail for the sensor.

I also suspected that in-camera playback would fail with MJPEG videos whose bitrates exceed ~35Mbps. What seemed like a useful goal would be to cap the high-detail bitrate under 35Mbps, while raising the low-light bitrate to something like 30Mbps.

After some experimentation with PTool 3.37, I realized that I could control video bitrate solely with the E1-4 Table patches, leaving the E1-4 Quality patches at their default settings. And with the following settings, I achieved a consistant bitrate of ~30Mbps for both bright and dimly lit scenes in 422 color at 720p, 30fps:


  • MJPEG E1 Quality = 128 (default)
  • MJPEG E1 Table = 116
  • MJPEG E2 Quality = 110 (default)
  • MJPEG E2 Table = 86
  • MJPEG E3 Quality = 100 (default)
  • MJPEG E3 Table = 56
  • MJPEG E4 Quality = 92 (default)
  • MJPEG E4 Table = 56

With a bitrate below 35Mbps, I had no trouble using both Class 10 SanDisk and Class 6 Transend SD cards. The highest bitrate I've seen with these settings was a static video of PappasArts' Star Chart, which produced ~32bps. With dimly-lit scenes, I've seen JPEG quality levels over 80% at compression ratios of around 15:1. As expected, JPEG quality level for high-detail scenes drops to around 65% witth compression ratios over 20:1. These are very good numbers for a consistent bitrate of 30Mbps, producing in-camera videos that look considerably better than than those taken with the default GH1 settings.


Good research...

Are your settings doing a fixed rate no matter how dark- like even if the lens cap is on, it won't drop below 30mbits?

My settings will give me on average 50 to 70mbits in low light environments like below, in the 1440x1080 settings. Now if we can get it to do that with the lens cap on- and achieve a semi locked in bit rate, that would mean that even the darkest shots would be getting good compression.

lowlight.jpg


Pappas
 
Are your settings doing a fixed rate no matter how dark- like even if the lens cap is on, it won't drop below 30mbits?
The bitrate decreases gradually as the lighting of a scene becomes either too dark or too bright. With the lens cap on, I get a JPEG quality level of 85% with a compression ratio over 100:1, at a bitrate of about 7Mbps. I suspect most of this is encoded noise.

Here's the JPEG thumbnail of a low-light video whose histogram shows little illumination over 50%. It has JPEG quality 85% at a compression ratio of 24:1. The handheld video has a bitrate of 27.5Mbps and exhibits barely noticeable Fixed Pattern Noise.

P1000544.jpg
 
Last edited:
I love the idea. That said, using your settings, I can get bitrates below 20Mbs with a totally out of focus and badly out of focus image. So I'm doing some tweaking of the values to see if I can come up with something more "constant." I'll also shoot some stuff tomorrow in daylight and see what I get.

I'd also add that the limit for playback seems to be about 38Mbs. That seems independant of card type. Just about all the cards have plenty of read capability. The bottleneck with MJPEG is not the card. It is some other place in the camera.

BTW, how are you measuring the quality level?
 
In low-light, you get two to three times as much bitrate as the default settings gave you. This appears to bring out more shadow detail, up to the point where Fixed Pattern Noise predominates.

Thanks. I was referring to the IQ difference between the clips that drop below 20Mbits and the one that sits around 30Mbits? How do they fair side by side.

I also would have thought FPN would have been reduced instead of being "enhanced" (loose term)? Interesting.
 
I'd also add that the limit for playback seems to be about 38Mbs... The bottleneck with MJPEG is not the card. It is some other place in the camera.

BTW, how are you measuring the quality level?
Thanks for the tip on 38Mbps, I was using 35M as a conservative estimate, and I agree that it appears to be a limitation of the camera rather than the SD card. Perhaps it could be due to an unidentified internal buffer size issue that might also be increased with a patch?

I'm using JPEGsnoop to examine the compression tables and quality level of the JPEG thumbnail the camera records with each MJPEG video. JPEGsnoop reports separate ratings for luma and chroma quality, which are usually about the same. (I suspect chroma quality would be lower than luma when using the GH1's default 420 color mode.)

The 0-100% JPEG quality scale seems to be a rough estimate based on an evaluation of the granularity of the quantization tables used by the encoder to compress the graphic data. Since the default tables can be overriden with custom tables by any JPEG encoder, the GH1's quality results are probably not directly comparable to Photoshop's. However, it's commonly regarded that for high-resolution still images, JPEG quality levels reach a practical maximum somewhere around 90%, where diminishing returns set in and compressed file size increases without showing significant further improvement in perceptual quality. This is because almost all of the image detail that is squeezed out at high quality settings consists of extremely fine variations in individual pixel color values that blend together seamlessly under normal magnification.

With low-light video, minimizing graininess and posterization is often more importation than preserving the quality of individual pixels. The GH1's image quality in dimly lit areas suffers from electronic noise at high ISO gain and Fixed Pattern Noise far more than it does from JPEG compression artifacts. A fair degree of JPEG compression can often smooth out many of these noisy details and produce a cleaner looking image than the original, particularly with low-contrast images.
 
I also would have thought FPN would have been reduced instead of being "enhanced"...
Sorry, I didn't mean to imply FPN was enhanced in any way. It's always present at low enough illumination and MJPEG has no way of detecting FPN correlations between frames. What I see in higher bitrate images is enhanced low-light details that are unfortunately degraded by the FPN that's superimposed upon them by the camera's flaws.
 
Here are two high-detail, low-contrast JPEG thumbnails of videos taken in shaded daylight. The brick wall has JPEG quality 45% while the concrete has only about 30%. Nevertheless, they both look highly detailed with little evidence of JPEG artifacts at normal viewing distances. Bitrate is about 27Mbps for the videos, a little lower than my target.

P1000546.jpg


P1000548.jpg
 
Here is the JPEG thumbnail of a video of high-contrast, extremely detailed foliage taken in broad daylight. JPEG quality is down at 19% at a video bitrate of 29.6Mbps. Below it is a section of the same JPEG image magnified at 400% to show compression details. Note that there is only minor smearing of details. What's most noticeable are JPEG macro-block artifacts superimposed upon jagged approximations of high-contrast leaf edges. With this degree of compression, you want the pixelization to dominate in order to obscure the horizontal and vertical edges of the macro-blocks.

P1000545.jpg


P1000545x4.jpg
 
Last edited:
Here is the JPEG thumbnail of a video of high-contrast, extremely detailed foliage taken in broad daylight. JPEG quality is down at 19% at a video bitrate of 29.6Mbps. Below it is a section of the same JPEG image magnified at 400% to show compression details. Note that there is only minor smearing of details. What's most noticeable are JPEG macro-block artifacts superimposed upon jagged approximations of high-contrast leaf edges. With this degree of compression, you want the pixelization to dominate in order to obscure the horizontal and vertical edges of the macro-blocks.

If you increase your bit rate- those macro blocks go away for the most part.

Like this-
Test blow up of 720P Hibit rate MJPEG MODE to 1920 and beyond.
http://www.dvxuser.com/V6/showpost.php?p=2009705&postcount=29


Pappas
 
If you increase your bit rate- those macro blocks go away for the most part.
Yes, and your enlarged samples show how there's no substitute for high bitrate when you need to preserve all the details in a magnified video.

What I'm satisfied to accomplish with this patch is to make the most effective use of the constrained maximum bitrate imposed by the camera's playback and file-length limitations. While it's mostly intended for low-light, low-contrast scenes, I want it to produce optimal results (within its bandwidth limits) on well-lit, highly detailed subjects as well.

What I don't want to see it do is produce smeared, muddy renditions of details too complex for it to accurately encode. In the case of the field of grass above, I don't expect it to capture the precise details - a realistic-looking approximation of the edges is all that I need.
 
Back
Top