Personal View site logo
GH2 - MJPEG resolution findings and Myth Busting
  • Tackling MJPEG for 2fps timelapses, I drew some conclusions that are less than obvious, and that I feel that should be shared with the rest of the community.

    For this I filmed a resolution chart on my computer screen from a distance, using Quantum 50-100 settings which use quality settings that are already over the line for 2fps be it AVCHD or MJPEG. I loaded the MOV files into AVIDemux and extracted 100% lossless snapshots to compare the various modes. Shot on M Movie Mode, aperture and shutter speed were both fixed.

    Note: I'm only showing the relevant 100% screen captures but all the files generated in this test (and I tested both HD and VGA modes) weight in at 38.5MB and can be d/l here: http://www.mediafire.com/?u2h8ycc2c6vmj0a

    Unless marked as AVCHD all other files are MJPEG.

    Myth 1 - MJPEG 1080p is MJPEG 720p up-scaled.

    Result: Plausible.

    It's too close to call, really! Even though there is evidence of a very very small resolution advantage to 1080p, it is hardly noticeable and it could be a consequence of the input-output workflow of 720 being done in a smaller resolution.

    Evidence: (look at the second image, I can't delete the first which is similar)

  • 54 Replies sorted by
  • I've been googling alot and have not found any insight. Is it possible to record 4:3 mjpeg, lets say 1440x1080 and have incamera playback?

  • Thanks duartix for the reply.

    It's strange that the magic resolution is 2048x864, which is not 16:9. I guess if you want best resolution, you shoot at 2048x864 and then need to squeeze the image a bit in post? This yields a final aspect ratio of 4:3 with corrected image. Interesting that shooting 4:3 (roughly speaking) gives best final video image, since 4:3 is aspect ratio of Micro 4/3 sensor- I have no idea if that's a coincidence.

    I feel like what might be happening is camera starts by taking entire image off sensor, then tries to accommodate a 16:9 aspect ratio, resulting in a stretched image (who knows exactly, since the Panasonic hardware and firmware was never meant to start with changed aspect ratio.) We then squeeze it in post, restoring correct aspect ratio which ends up at 4:3. And maybe the 2048 x 864 is the best resolution as it works best for pixel-binning for MJPEG?

    Hmmm... 864 x 4= 3456 which is exact vertical resolution of GH2 sensor. So maybe MJPEG binning/processing is best when vertical video resolution is a factor of the original sensor resolution? (the horizontal resolution of 2048 is not a factor of GH2 sensor horizontal resolution of 4068.) I'm talking out of my ass here and just guessing...

    I wonder if 1536x864 might give good results too, but at correct aspect ratio? (meaning anything above that ends up interpolated, etc.) If you squeeze 2048x864 to correct aspect ratio, a resulting frame grab might look identical to frame grab shot at 1536x864.

    Complicating matters further, I have a G3 not GH2, which have different resolution sensor. Maybe the "magic resolution" for other sensors is different. The G3 sensor has vertical resolution of 3448, this would yield a 4:3 resolution of 1532x862.

  • Sorry @madmaxmedia .

    Can't really tell.

  • @duartix : Thanks for sharing all these findings (2 years ago!) I had a question similar to WhiteRabbit regarding best resolution for use with anamorphic adapter (in this case a 2X).

    1. Do you know if the 'magic' 2048 x 864 still applies if I change the 480p setting to this resolution? (so I can end up with 2.66:1 video after the 2x anamorphic, although at this setting the aspect ratio is slightly off.)

    2. If so, do you think I could use 2048 x 768 instead and still preserve the 'magic'? (that would be correct aspect ratio to correct the 2x anamorphic.)

    Of course I need to test myself, but any feedback would be appreciated. Likely I will do quick testing of these 3 resolutions myself (again modifying 480p mode)- 1920 x 720, 2048 x 864, 2048 x 768. I'll report back, for anyone using MJPEG mode with anamorphic adapters.

  • @duartix Thanks, very much, for your reply! I'd definitely like to give your setting a go but unfortunately I'm stuck in GF2-land, for now.

  • 2 fps was the fastest I could get it to work on my Transcend Class 10 32gb and my Sandisk Class 10 32gb UHS-I 45mb/sec.

    It was for investigative purposes to gain information about chroma sub-sampling. I am sure it is tied to the specified resolution as a variable in the processing pipeline somewhere.

    I can't remember the settings exactly it was a long time ago, but probably 4096x2304 for res setting. And I'm waiting on a new charger for my GH2 (orig battery only, and flat, left charger behind somewhere else :/) so I can't re-explore it right yet, I've got the DC-coupler kit, but can't update firmware on that I think.

  • @coors: None that I know of. I suppose it's a FAT32 limit that can't be cornered around. AVCHD does it by spanning across multiple files, something MJPEG wasn't designed to do...

  • I've been following this thread with interest for awhile and I have some questions. I know that Driftwood is using 2048x1152 for his mjpg settings and even though I turned off the 1080p in mjpg to force 720p, I've decided to try his 1080p formula ratio to hopefully maximize 720p resolution. I divided 1920 into 2048, then multiplied that number times 1280 and 720 to get 1365.33x768. I rounded to 1365x768 and without frame grabs, yet, my initial/gut observation is that yes there seems to be an increase in resolution. Should I be rounding to 1366x768 instead? Also, @duartix, this is off topic, but is there a way to overcome the 4gb limit that I've ran into using 2fps in mjpg?

  • So: you can.

    Which card did you use? The best?

  • This sounds quite interesting! Would you mind sharing the setting?

  • Back when I did this, I got 4K in MJPEG @ 2fps iirc to work on my card.

    Luminnance Resolution did not improve (AVCHD still a fair bit better), but U and V resolution did significantly.

  • Higher FPS will not work. Optimum resolution question is answered by Driftwood 3 posts above. Guess you can change values to your need as long as you ruffly stay at the same amount of pixels and don't exeed 2048.

  • But has anyone tried higher resolutions? For example 3840x2160? You could maybe try 2488 * 1400, a friend suggested that it would be the ideal resolution for this system ..

    I do not know, maybe there's the risk of asking stupid questions, but maybe keeping compression values ​​to their original levels, you can push up the resolution .. or not? Certainly, the moiré in mjpeg is evident.

    I also wanted to ask, has anyone tried to extend the fps from 30 to 60 in mjpeg mode?

    thanks

  • @WhiteRabbit: I suggest you change both these settings to the resolutions you wish to test:

    720p30 width=1920

    720p30 height=1080

    480p30 width=1280

    480p30 height=720

    This way you change modes on the camera and test and compare 2 different resolutions at a time without repatching. ;)

    Happy hunting.

  • @driftwood : thank you for your reply. I had posted a question in the Low Rider thread regarding MJPEG and the resulting pixel aspect ratio of the recordings. I changed the Low Rider default MJPEG 1920x1080 (which records vertical stretched footage, I assume 2x for anamorphic users?) to @duartix suggested 2048x864 parameters, which, when using a non-anamorphic lens produced footage that appeared closer to normal 1:1 ratio (closer) when viewed with QT player. I might be wrong, however the stretch appear less, or I am to tired to interprete this at the moment.

    Does PTool have locked off pixel aspect ratio, or can this be modified from your patch build or is there another I way I can control this and/or enter my own specific values?

    It is late here, I will investigate further tomorrow, and try a different Intra patch with your 2K MJPEG and see what aspect ratio the footage provides, then actually check it out in an editing app, not just QT player.

  • @WhiteRabbit Its all about balancing quality with res size. The bigger the rez the lower values for E1 to E4 etc... you'll have to make it to work. The 2k sized mjpeg patches in most of the latest Driftwood settings (which are the same) maximise the bandwidth available and provide the best quality mjpeg settings Ive seen.

  • @whiterabbit: I can't provide evidence, but from what I've gathered, 2048x864 is the top of the line. Many people have reported trying superior resolutions but the resulting image is of very poor quality not even compatible with FHD upscaling. From memory I'd say sometimes it's as soft or even softer than 720p.

  • @duratix I saw Alice sitting on the bank of the river. I approached and offered her a blue or red pill, and explained the consequences thereof. Alice chose, then followed me down the rabbit hole.

    My question, which remains unanswered, maximum X and Y values, pertains to some future tests I may experiment with adjusting a patch. I use an anamorphic front lens, and it is not a typical ratio, being 1.75x or there abouts, whereas many others are traditional 2x, 1.33x and even some 1.5x. When capturing to 16:9 with a 2x anamorphic, say at 1080p, you can not extract 2.39:1, resulting in something around 3.55:1 when you transform the height down, making the footage extremely wide screen. If you can capture to 4:3 sensor, a 2x anamorphic results in 2.66:1 and you lose some of the sides bringing it back to 2.39:1, and a 2K source (2048x1152) is less than 1920 wide after this process to result in 2.39:1, resulting in some upscaling.

    I agree, your formula is a good direction to head, however, does this apply to anamorphic users? My question remains, the maximum X and/or Y values before the GH2 starts upscaling? @duratix, thank you for your interest and reply. I will test your settings soon.

  • @WhiteRabbit:

    One pill makes you larger

    And one pill makes you small

    And the ones that mother gives you

    Don't do anything at all

    Go with me: it's the magic pill or nothing: 2048x864. http://www.personal-view.com/talks/discussion/comment/38242#Comment_38242

  • I see some of the patches have MJPEG at 2K, 2048x1152. What is the maximum X and Y values (2048x1152) can be raised, and/or is there a point you go beyond and upscaling occurs? Thanks

  • Well, it's better then your LARGE DATA HDD dying on you... It's been a painful weekend. :(

  • Haven't replied in a while due to suddenly having no internet at home (no idea what's happening with it, in housemate's name).

  • Going by just the pixelation, I'd say it's 1/8th the resolution and don't forget that on top of that, it needs to be quantized (which could be much harder to simulate)!

  • I'll upload a PSD with all the layers of the diff images from this test, think that might be less work for me :P

    Anyway, here's a quick gander

    AVCHD U component:

    image

    MJPEG 1080p U component:

    image

    Ideal 1080p U component:

    image

    This half/2 U component is still legible for much of it, MJPEG is not legible, but is still significantly better than AVCHD which is just a smear.

    Now while you may say of course MJPEG will do better in YUV, since it's stored in YUV (iirc), and AVCHD Y'CbrCr, that doesn't matter, as the Y vs Y' component are still basically full resolution greyscale images, and the remaining two components colour differentiation, if -both- U and V are significantly better on MJPEG, if I converted AVCHD and MJPEG to Y'CbCr components, the same difference should still be seen.

    Perhaps 4:2:0 YUV (if that's how MJPEG is being stored) has an advantage over 4:2:0 Y'CbCr, I seriously doubt it, but in any case, even though MJPEG is winning here, even it doesn't look like 4:2:0 at all, but much less (at least for the 2 part).

    Ideal 1080p U component reduced to 1/4 resolution (half linear resolution, ie: 4:2:x):

    image

  • If my interpretation of JPEGSnoop's output is correct and going by this: http://en.wikipedia.org/wiki/Chroma_subsampling then this particular case of MJPEG could be 4:1:1.

    Is that possible? The same wiki notes MJPEG as using 4:2:0.