Personal View site logo
Make sure to join PV on Telegram or Facebook! Perfect to keep up with community on your smartphone.
Please, support PV!
It allows to keep PV going, with more focus towards AI, but keeping be one of the few truly independent places.
ST: MJPEG Encoder team
  • This one is easy.

    Anyone with systematic approach can participate.

    I need very stable MJPEG settings (for table) from default bitrate up to highest possible (4-5 steps):
    a) 720p mode
    b) 720p upscaled to 1080p
    c) 720p upscaled anamorphic
    d) 480p upscaled
    e) 480p upscaled anamorphic
  • 36 Replies sorted by
  • what's your GF2 settings? I could do 2048x854 25p with the quality and table settings of the T9 on a SanDisk 45mbs card. Bitrate was about 88mbps

  • After upscaling on comp it looks a little better, but pity that gf1 is not hd camera at all..

    P1110518.JPG
    848 x 480 - 522K
  • After testing gf1 mjpeg, i found that 1280x720 mjpeg is upscaled too, i think from real native 848x480, which come from older panasonic cameras. After lowering resolution in ptool to 848x480, table settings works fine with 1 or even with 0, without dropped pixels, quality settings must be around 300-400, with, for example 200, there will be dropped pixels.

  • @LPowell

    I'll try to port them to other cameras in next versions.

    @LPowell

    Can you make some excel table looking at compression of individual block, not whole frame.
    So, we could make bitrate setting that won't be dependent fo resolution selected.
  • @kikis
    I tested PTool 3.62d GH1 MJPEG patches, and frame sizes wider than 1920x1080 can be used only on patches for the GH2.
  • I think there's a good chance 2160x810 will work on the GH1, though it may need some tweaking. I'll likely have time to test it early this week.
  • @lpowell

    Ok, I understand. Is the size of 2160x810 achievable for GH1 with PTool 3.62d though?
  • No, the GH2 MJPEG encoder behaves quite differently than the GH1. The GH2 can easily handle a 100Mbps MJPEG bitrate without any reliability issues. The GH1 will need patches that work at lower bitrates.
  • @lpowell

    does this patch work with the GH1 also? in particular for the 2160x810 VGA settings, can that be achieved with the GH1 or is it limited only to the GH2?
  • Here are 100Mbps MJPEG settings optimized for native anamorphic shooting with both 1.33X adapters in HD video mode, as well as 2X adapters in VGA video mode. Used with an appropriate anamorphic lens, these MJPEG modes will produce videos that are automatically played back at the correct widescreen aspect ratio, without need for post-production stretching:

    HD mode: 1920x810 videos for 1.33X anamorphic adapters, with peak bitrates of 100Mbps.
    VGA mode: 2160x810 videos for 2X anamorphic adapters, with peak bitrates of 100Mbps.

    Note that the 2160x810 VGA mode produces an aspect ratio of 2.66:1. For a 2.37:1 aspect ratio, you'll want to crop these videos to a 1920x810 frame size.
    100Mbps GH2 MJPEG Low-Light Anamorphic Patch.zip
    469B
  • @Vitaliy_Kiselev "AF has very strong AA filter placed before high resolution sensor."

    Good point, however, I found the BBC's AF100 resolution charts unexpectedly revealing. In a camera with an effective OLPF, you'll see the outer concentric circles in the zone plate resolution charts blur into gray as they become more detailed than the camera's optical resolution. With the AF100's charts, however, instead of blurring, what I saw were sharply defined aliasing patterns, artifacts that were produced by ultra-fine details beyond 1080p. The 750-line rated resolution was actually the point where the amount of aliased details began to exceed the genuine details in the image.

    http://thebrownings.name/WHP034/pdf/WHP034-ADD66_rev_2_Panasonic_AF101.pdf

    The conclusion I drew was that the AF100 has a weaker than expected OLPF designed to pass considerable image detail in the region between 1080-1400 lines of resolution. This ultra-fine image detail generates aliasing artifacts that are reflected down into the 750-1080 line region, producing artificially enhanced high resolution image details. With the test charts, it was easy to identify the details beyond 750 lines as aliasing artifacts, simply because I knew what the chart was supposed to look like and the alias patterns were recognizably different. With a real-life image, it would not be so easy to distinguish real detail from high-resolution artifact detail.
  • Here is a sample video that shows 720p slow motion along with 1 clip of 4mp 40 FPS. The 4:3 clip is obviously the still image clip. I rendered the video to 1080p and the stills clips really don't look that much better than the 720p clips. I bet that would change if I rendered to 4K instead. I don't have an editor that can do that though.

  • > If we assume the GH2 performs similarly, this 750-line optical resolution will set a limit on the perceivable resolution of higher digitized resolutions.

    AF100 and GH2 are two different beasts in this regard
    AF has very strong AA filter placed before high resolution sensor.
    GH2 AA filter is made for full sensor resolution.
    So, factual resolution is limited by sensor mode.

    If in the future we'll understand how to use 4Mp 40fps mode it can be very interesting to look at the results.
  • @mpgxsvcd Thanks for reporting the results of your testing. Perceived resolution will always be a limited by the optical resolution of the lens filtered through the camera's optical low pass filter (OLPF) and then digitized and downsampled from the image sensor. While we don't have resolution measurements for the GH2, the BBC has tested the AF100 and concluded that its effective resolution is about 750 lines. If we assume the GH2 performs similarly, this 750-line optical resolution will set a limit on the perceivable resolution of higher digitized resolutions.

    In most cases, it's preferable to resample an image to the desired resolution after all post-processing has been done to the image in its original resolution. However, in this case, the MJPEG encoder degrades the precision of the color data in the process of converting it from RAW 12-bit RGB data into 8-bit YCC in 4:2:0 color depth. For that reason, it is preferable to program the camera to scale the image to the desired resolution before it is degraded by the MJPEG encoder. While the difference in image quality may not be readily perceivable in most cases, as long as the encoder has adequate bitrate to encode the image at high quality, it will in no case be worse.

    As you've determined, however, SD card write-speed issues impose a limit on the maximum bitrate that can be made available to the MJPEG encoder. With the GH1, I found that high vertical resolutions (up to 1080) were less stable than high horizontal resolutions (up to 1920). If this is also the case with the GH2, it may turn out that MJPEG resolutions higher than 1920x1080 are primarily useful for producing horizontally stretched aspect ratios for use with anamorphic adapters.
  • I have done some testing with the new MJPEG resolution settings(ie: greater than 1080p). Here is what I have found so far.

    1. 2048x1152 was the highest resolution I could use without any write errors with my Transcend Class 10 SD card. I compared it to a similar still taken from a 1080p AVC-HD file and the difference in resolvable resolution is obvious. It is not that the 2048x1152 looks bad. It just doesn’t look any better than the 1280x720 MJPEG file.

    2. Using very high resolutions greatly reduces the Quality setting that you can use. I was having stability issues even with the relatively modest settings below.

    400 12 300 24 200 32 100 4

    3. 1792x1344 was the highest resolution I could get to be stable for the 480p MJPEG upconvert. It actually made the 480p mode look good. However, it still did not appear to have more than about 700 lines of vertical resolution. However, I haven’t been able to accurately test the resolvable resolution with a rez chart yet so that number is just an estimate.

    In my opinion setting you should just leave the 720p resolution alone and increase the 480p resolution till it is between 700 and 800 vertical pixels. Anything more than that and you are just risking stability issues. If you stick with those resolutions then the settings below should be stable for decent class 10 cards.

    600 12 500 24 400 32 300 4

    The 1080p AVC-HD file is there now.
    2048x1152 MJPEG from 720p.png
    2048 x 1152 - 4M
    1080p AVC-HD.png
    1920 x 1080 - 3M
  • Is anyone else messing around with mpgxsvcd's setting's with 3.62?

    Q1-Q4 = 600,500,400,300
    T1-T4 = 12,24,32,4

    If not, please do try! Incredible.
  • @mpgxsvcd - These setting are producing amazing low-light results, shadow quality. I wonder if 1920/1080, while not producing higher res than 720, is producing a better grain feel at 1080.
  • @ishvar
    This is strike team topic, not MJPEG questions topic.
  • @cosimo

    So far it looks like the settings below produce the highest bit rate 1920x1080 MJPEG without any write failures.

    Q1-Q4 = 600,500,400,300
    T1-T4 = 12,24,32,4
  • so E4 table was good at 4. What about E1 table E2 table E3 tables? Should we use LPOWELL's tables with PMGXSVCD's Qualities?
  • Using E4 T = 4 worked. I was able to increase the Quality level a bit and still maintain stability. Great tip. Thanks LPowell.
  • Cool Stuff LPowell. I didn't know about using E4 = 4. Was this testing done with the GH1 or the GH2?
  • @mpgxsvcd Very interesting results with ISO-dependency. I'll see if I can break my 100Mbps GH2 1080p MJPEG patch at high ISO settings. On the GH1, I strongly suspected that all entries in Table 4 were set to 1, i.e. no quantization at all. In MJPEG terms, this is overkill and will produce suboptimal compression. In some GH1 patches, I set T4 to 4 to throw as much bitrate as possible at the murkiest areas of the image. Since the GH2 appears to have much better low-light performance than the GH1, using Table 4 on the GH2 may run the risk of overemphasizing fine detail noise.

    EDIT: Tested 100Mbps 1080p MJPEG patch @ ISO 3200, using PappasArts test chart. 12 trials, zero failures. Hits MOV file size limit at 1.85GB after recording for 2:45. Average bitrate was about 95Mbps. Here's the MJPEG settings:

    E1 Quality=400
    E1 Table=24
    E2 Quality=200
    E2 Table=36
    E3 Quality=175
    E3 Table=48
    E4 Quality=150
    E4 Table=4

    I tuned the four Table settings to produce a consistent bitrate of 90-100Mbps across a wide range of exposure levels. Note the use of Table 4 in E4 rather than E1. This patches the encoder to use Table 4 as a last resort at the lowest quality setting, rather than starting off with Table 4 at the highest quality setting.
  • Using the settings below produced the highest completely stable bit rates for 1080p that I could get(bit rate was just over 90+ mb/sec). There is no in camera playback with these settings of course.

    Q1-Q4 = 600,500,400,300
    T1-T4 = 4,12,24,32

    If anyone can get these settings to produce a write failure please let us know.
  • I haven't finished all of my testing yet. However, I have discovered a few interesting things. They are below.

    1. Upscaling improves resolution upto a point. For example if you upscale 640x480 by 2x to 1280x960 it will have greater resolvable resolution. However, upscaling 720p to 1080p does not improve resolvable resolution. It appears that the MJPEG mode has a maxim resolution that is somewhere around 720p. Upscaling past that does not improve things. However, upscaling to that can be beneficial.

    2. ISO has a significant impact on stability for MJPEG. You can record at ISO 160 all day with settings that produce 180+ mb/sec all day. Try recording in S mode in a dark room with Auto ISO on. It will push the noise really high and anything above about 110 mb/sec will fail.

    3. Using T = 4 for T1 through T4 will always produce failures with really high bit rates and high ISO shots.

    4. Q1 = 900 was the highest I could go for 1080p upscaled videos. However, this was with lower ISOs. It will fail with higher ISOs with that setting.

    Here are the settings I am using so far for high bit rate with stability. Remember these are all upscaled resolutions. The settings can go much higher for lower resolutions and lower ISOs. I wanted to get the highest resolutions out of the way before I tested the lower ones.

    1920x1080 with the 720p setting(This setting will record for all ISO 3200 and below shots. It only fails if you force the camera to go above ISO 3200. The files are usually around 110 mb/sec

    Q1-Q4 = 650,550,450,350
    T1-T4 = 4,12,24,32


    1280x960 with the 640x480 setting

    Q1-Q4 = 800,700,600,500
    T1-T4 = 4,12,24,32