100% Quality Factor MJpeg Settings (very low compression - class 10 required!)

modulr

Active member
I have been really aggressively testing the mpeg settings.

Observations...

T = 1, resulting jpeg is roughly 1/4 complete.
T = 2, resulting jpeg is roughly 1/2 complete
T = 3, restulting jpeg is roughly 3/4 complete

As previously noted, using any tables 0-3 result in a quicktime which is black on playback. So obviously, T = 4 is the lowest setting that provides a completed and valid jpeg + mov. Might T have something to do with how the image is scanned? Anyway, I used this as my base point, as low T values always seem to perform well.

My initial goal was to figure out what quality settings could provide continuous playback on a Sandisk 8GB Extreme Class 10.

Q1=188, T1=4
Q2=188, T2=4
Q3=188, T3=4
Q4=188, T4=4

This resuted in recording of the star chart and real world examples with no errors at 75+mbps for complex scenes. There was still a fair degree of compression though, so I began to think about the logic of the system.

Q=188, T=4 for all stages 1-4 suggests the codec is always operating against the same threshold when dealing with it's variable bit rate. It suggests that for complex scenes, this is the max is can handle (on my card), however it leaves less complex scenes wanted more bits thrown at it. Odds are, the codec is constantly trying to get the most bits in there until there is a overflow and it must test the next lower Q level.

So what if we up the thresholds on Q1-Q3, and let Q4 be our last line of defense?

I came up with these settings...

Q1=400, T1 = 4
Q2=300, T2 = 4
Q3=250, T3 = 4
Q4=188, T3 = 4


The idea was to keep the thresholds very high (and throw more at simpler scenes), but if necessary back them down to the maximum my card could handle when a scene gets too complex. It seems like the codec is always trying to keep the threshold as high as possible.

Sorry for the lack of wonderful shots with flowers in bloom. It was gloomy outside morning, however I've tested these setting with complex natural scenes as well. Thus far, it's been working flawless.

Nostalgic Film Mode: Contrast -2, Sharpness -2, Saturation 0, Noise Reduction 0



----------
P1050626.JPG

Precision=8 bits
Destination ID=0 (Luminance)
DQT, Row #0: 1 1 1 1 1 1 1 1
DQT, Row #1: 1 1 1 1 1 1 1 1
DQT, Row #2: 1 1 1 1 1 1 1 1
DQT, Row #3: 1 1 1 1 1 1 1 1
DQT, Row #4: 1 1 1 1 1 1 1 1
DQT, Row #5: 1 1 1 1 1 1 1 1
DQT, Row #6: 1 1 1 1 1 1 1 1
DQT, Row #7: 1 1 1 1 1 1 1 1
Approx quality factor = 100.00 (scaling=2.99 variance=6.13)
----
Precision=8 bits
Destination ID=1 (Chrominance)
DQT, Row #0: 1 1 1 1 1 1 1 1
DQT, Row #1: 1 1 1 1 1 1 1 1
DQT, Row #2: 1 1 1 1 1 1 1 1
DQT, Row #3: 1 1 1 1 1 1 1 1
DQT, Row #4: 1 1 1 1 1 1 1 1
DQT, Row #5: 1 1 1 1 1 1 1 1
DQT, Row #6: 1 1 1 1 1 1 1 1
DQT, Row #7: 1 1 1 1 1 1 1 1
Approx quality factor = 100.00 (scaling=1.54 variance=1.58)

Compression stats:
Compression Ratio: 5.13:1
Bits per pixel: 4.68:1





----------
P1050628.JPG

Precision=8 bits
Destination ID=0 (Luminance)
DQT, Row #0: 1 1 1 1 1 1 1 1
DQT, Row #1: 1 1 1 1 1 1 1 1
DQT, Row #2: 1 1 1 1 1 1 2 2
DQT, Row #3: 1 1 1 1 1 2 2 2
DQT, Row #4: 1 1 1 1 2 2 1 3
DQT, Row #5: 1 1 1 2 2 2 2 2
DQT, Row #6: 1 2 2 2 2 3 2 2
DQT, Row #7: 2 2 2 2 3 3 2 2
Approx quality factor = 98.22 (scaling=3.57 variance=4.57)
----
Precision=8 bits
Destination ID=1 (Chrominance)
DQT, Row #0: 1 1 1 1 2 2 2 2
DQT, Row #1: 1 1 1 1 2 2 2 2
DQT, Row #2: 1 1 2 2 2 2 2 2
DQT, Row #3: 1 2 2 2 2 2 2 2
DQT, Row #4: 2 2 2 2 2 2 2 2
DQT, Row #5: 2 2 2 2 2 2 2 2
DQT, Row #6: 2 2 2 2 2 2 2 2
DQT, Row #7: 2 2 2 2 2 2 2 2
Approx quality factor = 98.80 (scaling=2.39 variance=0.91)

Compression stats:
Compression Ratio: 5.74:1
Bits per pixel: 4.18:1




----------
P1050632.JPG

Precision=8 bits
Destination ID=0 (Luminance)
DQT, Row #0: 1 1 1 1 1 1 1 1
DQT, Row #1: 1 1 1 1 1 1 1 1
DQT, Row #2: 1 1 1 1 1 1 1 1
DQT, Row #3: 1 1 1 1 1 1 1 1
DQT, Row #4: 1 1 1 1 1 1 1 1
DQT, Row #5: 1 1 1 1 1 1 1 1
DQT, Row #6: 1 1 1 1 1 1 1 1
DQT, Row #7: 1 1 1 1 1 1 1 1
Approx quality factor = 100.00 (scaling=2.99 variance=6.13)
----
Precision=8 bits
Destination ID=1 (Chrominance)
DQT, Row #0: 1 1 1 1 1 1 1 1
DQT, Row #1: 1 1 1 1 1 1 1 1
DQT, Row #2: 1 1 1 1 1 1 1 1
DQT, Row #3: 1 1 1 1 1 1 1 1
DQT, Row #4: 1 1 1 1 1 1 1 1
DQT, Row #5: 1 1 1 1 1 1 1 1
DQT, Row #6: 1 1 1 1 1 1 1 1
DQT, Row #7: 1 1 1 1 1 1 1 1
Approx quality factor = 100.00 (scaling=1.54 variance=1.58)

Compression stats:
Compression Ratio: 5.93:1
Bits per pixel: 4.05:1




----------
P1050586.JPG

Precision=8 bits
Destination ID=0 (Luminance)
DQT, Row #0: 1 1 1 1 1 1 1 1
DQT, Row #1: 1 1 1 1 1 1 1 1
DQT, Row #2: 1 1 1 1 1 1 1 1
DQT, Row #3: 1 1 1 1 1 1 1 1
DQT, Row #4: 1 1 1 1 1 1 1 1
DQT, Row #5: 1 1 1 1 1 1 1 1
DQT, Row #6: 1 1 1 1 1 1 1 1
DQT, Row #7: 1 1 1 1 1 1 1 1
Approx quality factor = 100.00 (scaling=2.99 variance=6.13)
----
Precision=8 bits
Destination ID=1 (Chrominance)
DQT, Row #0: 1 1 1 1 1 1 1 1
DQT, Row #1: 1 1 1 1 1 1 1 1
DQT, Row #2: 1 1 1 1 1 1 1 1
DQT, Row #3: 1 1 1 1 1 1 1 1
DQT, Row #4: 1 1 1 1 1 1 1 1
DQT, Row #5: 1 1 1 1 1 1 1 1
DQT, Row #6: 1 1 1 1 1 1 1 1
DQT, Row #7: 1 1 1 1 1 1 1 1
Approx quality factor = 100.00 (scaling=1.54 variance=1.58)

Compression stats:
Compression Ratio: 5.24:1
Bits per pixel: 4.58:1




----------
P1050597.JPG

Precision=8 bits
Destination ID=0 (Luminance)
DQT, Row #0: 1 1 1 1 1 1 1 1
DQT, Row #1: 1 1 1 1 1 1 1 1
DQT, Row #2: 1 1 1 1 1 1 1 1
DQT, Row #3: 1 1 1 1 1 1 1 1
DQT, Row #4: 1 1 1 1 1 1 1 1
DQT, Row #5: 1 1 1 1 1 1 1 1
DQT, Row #6: 1 1 1 1 1 1 1 1
DQT, Row #7: 1 1 1 1 1 1 1 1
Approx quality factor = 100.00 (scaling=2.99 variance=6.13)
----
Precision=8 bits
Destination ID=1 (Chrominance)
DQT, Row #0: 1 1 1 1 1 1 1 1
DQT, Row #1: 1 1 1 1 1 1 1 1
DQT, Row #2: 1 1 1 1 1 1 1 1
DQT, Row #3: 1 1 1 1 1 1 1 1
DQT, Row #4: 1 1 1 1 1 1 1 1
DQT, Row #5: 1 1 1 1 1 1 1 1
DQT, Row #6: 1 1 1 1 1 1 1 1
DQT, Row #7: 1 1 1 1 1 1 1 1
Approx quality factor = 100.00 (scaling=1.54 variance=1.58)

Compression stats:
Compression Ratio: 8.01:1
Bits per pixel: 3.00:1
 
Last edited:
Incredible stuff man. Thanks for testing. Thanks for posting.

Quick question: Is this 1080 or 720?
 
Thanks all!

BTW, these settings are basic 720p and only require setting the MJPEG quality and table values. I have not explored 420->422 nor running 1440x1080. I'll experiment with those to see how far things can get pushed.
 
Great shots. Those are some pretty sick results. When you say it is stable. Does that mean you haven't encountered any recording issues or that you can play these files back in camera? If it is stable with in camera playback then you might have a winner on your hands.
 
In-camera playback didn't work for me with these settings. Looks very good though, nice work! (No errors on my Sandisk Extreme 8GB)
 
http://www.youtube.com/watch?v=mbOg5FzSqP0


GREAT settings! mpdulr ,very stable ..i also checked 422 color and getting clips from 66-90 mb with no issue..

i also, want to say thanks again to vitaliy ,can thank you enough..

what i love about the gh13 now after the hack is the details in the wide shots, and now the close up shots even get more detail..
 
Indeed!

With these settings I've actually gotten results that exceed 100mbps on the GH1, 118mbps being the highest so far. I'm pretty floored. It brings into question what is actually the reason for the write errors.. maybe it's related to not knowing the lowest threshold in which the card can successfully write. Just speculating at this point.

Anyway, here are some more images from this afternoon...




-------------------
P1050641.JPG

---
Precision=8 bits
Destination ID=0 (Luminance)
DQT, Row #0: 1 1 1 1 1 1 1 1
DQT, Row #1: 1 1 1 1 1 1 1 1
DQT, Row #2: 1 1 1 1 1 1 2 2
DQT, Row #3: 1 1 1 1 1 2 3 3
DQT, Row #4: 1 1 1 1 2 2 1 3
DQT, Row #5: 1 1 1 2 2 3 2 3
DQT, Row #6: 1 2 2 2 3 3 3 2
DQT, Row #7: 2 2 2 2 3 3 3 3
Approx quality factor = 98.15 (scaling=3.70 variance=4.36)
----
Precision=8 bits
Destination ID=1 (Chrominance)
DQT, Row #0: 1 1 1 1 3 3 3 3
DQT, Row #1: 1 1 1 1 3 3 3 3
DQT, Row #2: 1 1 2 3 3 3 3 3
DQT, Row #3: 1 3 3 3 3 3 3 3
DQT, Row #4: 2 3 3 3 3 3 3 3
DQT, Row #5: 3 3 3 3 3 3 3 3
DQT, Row #6: 3 3 3 3 3 3 3 3
DQT, Row #7: 3 3 3 3 3 3 3 3
Approx quality factor = 98.40 (scaling=3.21 variance=0.52)

Compression stats:
Compression Ratio: 4.03:1
Bits per pixel: 5.96:1





-------------------
P1050642.JPG


Ok, so the above isn't the best shot... but it's loaded with enough complexity to really tax the codec. The details hold up!

----
Precision=8 bits
Destination ID=0 (Luminance)
DQT, Row #0: 1 1 1 1 2 1 3 3
DQT, Row #1: 1 1 1 1 1 3 3 3
DQT, Row #2: 1 1 1 1 1 3 4 4
DQT, Row #3: 1 1 1 2 3 4 6 6
DQT, Row #4: 1 1 2 3 4 4 3 6
DQT, Row #5: 3 2 3 4 4 6 4 6
DQT, Row #6: 1 4 5 4 6 6 6 5
DQT, Row #7: 4 4 5 5 6 6 6 6
Approx quality factor = 97.07 (scaling=5.86 variance=3.18)
----
Precision=8 bits
Destination ID=1 (Chrominance)
DQT, Row #0: 1 1 1 1 6 6 6 6
DQT, Row #1: 1 1 3 3 6 6 6 6
DQT, Row #2: 1 3 4 6 6 6 6 6
DQT, Row #3: 1 6 6 6 6 6 6 6
DQT, Row #4: 4 6 6 6 6 6 6 6
DQT, Row #5: 6 6 6 6 6 6 6 6
DQT, Row #6: 6 6 6 6 6 6 6 6
DQT, Row #7: 6 6 6 6 6 6 6 6
Approx quality factor = 96.99 (scaling=6.02 variance=1.83)

Compression stats:
Compression Ratio: 3.65:1
Bits per pixel: 6.58:1





-------------------
P1050652.JPG

----
Precision=8 bits
Destination ID=0 (Luminance)
DQT, Row #0: 1 1 1 1 1 1 1 1
DQT, Row #1: 1 1 1 1 1 1 1 1
DQT, Row #2: 1 1 1 1 1 1 1 1
DQT, Row #3: 1 1 1 1 1 1 1 1
DQT, Row #4: 1 1 1 1 1 1 1 1
DQT, Row #5: 1 1 1 1 1 1 1 1
DQT, Row #6: 1 1 1 1 1 1 1 1
DQT, Row #7: 1 1 1 1 1 1 1 1
Approx quality factor = 100.00 (scaling=2.99 variance=6.13)
----
Precision=8 bits
Destination ID=1 (Chrominance)
DQT, Row #0: 1 1 1 1 1 1 1 1
DQT, Row #1: 1 1 1 1 1 1 1 1
DQT, Row #2: 1 1 1 1 1 1 1 1
DQT, Row #3: 1 1 1 1 1 1 1 1
DQT, Row #4: 1 1 1 1 1 1 1 1
DQT, Row #5: 1 1 1 1 1 1 1 1
DQT, Row #6: 1 1 1 1 1 1 1 1
DQT, Row #7: 1 1 1 1 1 1 1 1
Approx quality factor = 100.00 (scaling=1.54 variance=1.58)

Compression stats:
Compression Ratio: 5.13:1
Bits per pixel: 4.68:1


As I mentioned, I have yet to try the 422 stuff with these settings. I remember trying it early on and I thought the image lost quality, but I'll give it a go.

There actually might be further room for improvement for complex scenes to gain that last 3% of quality by tweaking Q1-3 a little more. It's only taken 146 firmware reflashes to get this far! haha... so back to the numbers lab!
 
Very good results. Excellent! This is the correct way to examine settings because Mbps alone don't give the whole picture.

Since I'm not interested in 4:2:0 MJPEG I'm not able to go as high as you with Quality settings. I found

4:2:2 + 1.95 X Q / T4 SETTING
Q: 249, 214, 195, 179
T: 4, 4, 4, 4

the highest I could go and very stable with my 16 GB Sandisk Extreme Class 10 card.

Low detailed scene: 100 / 73.71 mbps / Movie OK
High detailed scene: 85.95 (dc:3*) / 86.72 mbps / Movie OK
4:2:2 chroma subsampling on
Clip recording time display: 4m 17s
Playback in camera: No

I also found out that keeping the relationship of the original quality values gives the stablest settings.


*The dc component is the most important value in the top left corner of the quantisation table.
 
Last edited:
What are you guys using to analyze the Quantization tables?

These settings are fantastic! Highest quality I have seen yet.
 
Martin , are you sure these are the highest values you can go with 422 checked , i have the same card as you and im using modulr settings with 422 checked..but whats weird is how you getting high rate clips (75-85mb)(almost the same as me) with such small values?
 
I just tried Martins setting and its pretty good...nice stable 70+ mbs with 4.2.2...I actually prefer the look from this setting.
 
Martin , are you sure these are the highest values you can go with 422 checked , i have the same card as you and im using modulr settings with 422 checked..but whats weird is how you getting high rate clips (75-85mb)(almost the same as me) with such small values?

I can't go higher than 1.95Q / T4.
Most probably it's the lens and my test sheet. I use the Panasonic 20 mm 1.7 Pancake at f5 and this lens is sharper than the kit lens. I think the kit lens will allow higher Q values. I also use an extremly detailed test scene to be on the safe side in real world situations.
 
Last edited:
no.i have exactly what modulr posted with T 4 on all ..with 422 enabled, thats kind of weird...how im going that much higher on Q settings and yet your are much lower and not even 422 checked and you have the same amount of bit rate..
 
Back
Top