"The End" - Patch for GH2 Hack
This is the final patch from Apefos. Read the developing history in post below.
Works for PAL and NTSC
It has all achievements from previous Apefos patches: WorkHorse, Boson, GSpot, DCT, Apefos Settings, The Patch, Denoise (see Top Settings section of P-V to read about these other patches with discussions).
Solves the Diagonal Rain Pulsing Pattern problem.
Matrix desing with fallback finetuned for isos 6400 and below, in custom design for each recording mode. Improved for best image quality considering the noise, details and texture minimizing artifacts, banding, moiré, aliasing, flickering. Also improved for denoise in Luma and Chroma channels for delivery a clean image, but preserving the texture. Deblocking matrix improved for removing macroblocking.
For flickering free images use isos from 160 to 2000. Some isos can be better than others, some isos can increase noise or flickering, some reports says that isos 320 and 2500 are no good even with other patches, so do your tests about isos behavior in your GH2.
Careful tweak in all settings of the ini file in PTool tester section for best stability and image quality with extensive tests since 2013 year resulted on this patch. These settings working together makes the datarate enough for great quality.
Datarates are in the maximum limit for stable work with the auto electronic features and native lenses: 24H = 96Mbps, 24L = 76Mbps, SH = 76Mbps, H = 60Mbps (the results in recorded videos are different from the datarate typed on the ini file)
Best gop configuration for the available datarate: 24p = gop 3, hbr = gop 3, 720p50 = gop 3, 720p 60 = gop 4 The frame rate perceiving is similar in all areas of the image, similar to intraframe gop1 patches due to the finetunings (read post below).
In Pal all recording modes are stable.
In NTSC the H and FH can be more stable than SH and FSH, but the SH and FSH are better quality. Tip: try using only one or two auto electronic features in SH and FSH in NTSC. Auto electronic features are: Auto Exposure, Auto Focus, OIS image stabilization, iDynamic, iResolution, Noise Reduction. Example: using OIS and idynamic and disable other features in SH NTSC is good idea. If using all features enabled at same time in 720p or 1080i, use the H and FH recording modes. 1080p24 24H and 24L both works ok.
The camera never freezes, no battery pull needed.
Works very good for neatvideo denoise using temporal noise reduction "1" and spatial luma noise reduction "30". In neatvideo, set the noise area in a more fine noise on the screen instead of on a gross noise area when denoising high isos. Chroma reduction in "100" with a +50 in first sliders also is good for high isos.
Stress tests was done in the 45MBps Sandisk card, but it can work in slower cards also (30MBps).
Added a second zip file with The End High Datarate version, for the datarate freaks. For use with manual lenses, avoid native lenses for more stability. Auto electronic features does not work in 720p, 1080i and HBR, avoid them. H and FH can be more stable than SH and FSH. In 24p the native lenses and the features can work, try both 24H and 24L. Datarates are: 24H = 104Mbps, 24L = 96Mbps, SH = 96Mbps, H = 88Mbps. Same gop as the stable version. If it cannot handle the recording it will stop recording and go back to stand by mode, the camera will not freeze, no need battery pull.
All the settings in the patch was finetuned to work good with the standard default stable datarate version and the image is ok. I do not know if it would worth changing firmware just to increase datarate. Maybe a datarate increase can change the balance of I/P/B frames size and improve just the I frames quality and makes the texture pulsing, more noticeable in slowmotion. Do your tests. Or just use the default version which is ok, improved for good slowmotion. (for more details read next posts below). In my tests I saw no significant benefits using the high datarate version for 720p60 NTSC in high iso 2000, it just improves I frames quality a little and introduces more pulsing due to generate higher difference from I and P quality, when doing slow motion this creates pulsing, the datarate increase is not enough to change the textures of the P frames in 720p. About 24p, it is already good datarate in the default version using the 24H record mode so there is no need to use the high version for 24p. Also, PAL lands are less frames in HBR and 720p so the camera can record more data per frame making the default version very good for PAL. Even the HBR mode which is a challenge for patches is looking pretty good in the default version. People likes comparisons, so the two versions are here for tests. My final option is to keep "The End" in camera and no more firmware change. I do not see significant reasons to use the high datarate version, maybe for HBR in NTSC mostly (read posts below).
Enjoy
Developing History (summarize):
In first moment of hack I just did datarate increase to improve the image without using the tester section of ptool. Problem was I was not satisfied with 720p quality, lots of macroblocks in dark areas.
I did attempts to increase datarate and lower the gop of 720p but camera was stop recording (sandisk 45MBps card). So only thing I did at that moment was to use 42Mbps in 720p and 24p.
So I did a reseach about patches and I liked the FlowMotion description a lot. So I did a try. I liked the image, but camera was stop recording some times, also I found the noise to be gross.
People suggest me Nebula, I did a try, noise more fine I liked it, but for my taste it was too much fine. I would like something in between. Also Nebula was showing high changes in frames size in streamparser while flowmotion was very constant frames size. After researches and reading on topics I learned that the main matrix and fallback matrix and also gop tables was important to keep constant size on frames and flowmotion was good on this, but at that moment the numbers in the ini file about matrix was a mess to me, I never thought I could understand it.
I did a try on some other popular patches also, but the settings was not so fine tuned when I look in the ini file.
So I start pursuing my own settings...
I decided to start improving flowmotion because it was the best tweaked patch at that moment, so I started to believe I could make it more stable.
First thing I did was to adjust datarate and top and botom limits to find more stability, also I did lots of tests with the frame limit size and frame buffer size to find better stability. So I made the camera record without stop and freeze, this was the first important achievements using flowmotion as a base. The frame limit needs to be a little higher than the frames the camera generate, to tell to the camera that it will work with something with that size, It cannot be used to make the frames lower in size. If it is lower than the frames size the camera freezes. The buffer also big to handle the data.
Then I did some tests in low light to see the image noise/texture. when I say texture it is the word I found to include artifacts, banding, moiré, lines, noise, aliasing, flickering, and so on, the result of all them.
To see better the image I started to see it in 400% zoom and frame by frame. First thing I noticed was the P and B frames was poor quality, mud and artifacts, so I lowered the 720p gop to 3 to have more I frames and less P/B frames, in a maximum datarate I could use, 96Mbps was recording ok after the frame limit, frame buffer, bottom and top adujsts.
Then I started to think that the B frames could be worse than the P frames because B frames uses bidirectional temporal compression and are smaller. I asked for some help in forum and some members teached me how to make the 720p to be only I and P frames. This improved quality, P frames are biger than B and better temporal compression. This was the WorKHorse patches era.
So I got the idea to share better the datarate between the I and P frames in 720p and between the I and B frames in hbr and 24p. I did researches and learned that the GOP Tables was the settings to do this. But it was a deep mistery, nobody knows exactly how it works.
Then I did tests. Lots and lots of tests loading many firmwares to the camera, changing each number in the gop tables to understand what they do to the image. This way I found the behavior of it, not everything, but enough to do a good share of data among the frames, more data to I or more data to P or to B. Also gop tables are very important for stability.
In my tests I found the minimum size of the I frames and P/B frames which allow good compression without introduce mud, artifacts and mosquito noise. This was important to do a calibration between datarate, gop lenght and gop tables.
I perceived that I had two options, prioritize the details in good light with biger I frames or prioritize noise quality with biger P / B frames. So I created WorkHorse for details with biger I and Boson patches improved more for noise performance with biger P frames.
In NTSC 720p it is 60 frames each second and the datarate is in the limit to get a good size on the I and P frames, so I did a careful settings on it. If I rememenber correctly this was the GSpot patches where I found this perfect point for good details and noise in same patch with a finetune in I/P/B frames in all recording modes, pal and ntsc adjusting carefully the gop tables for all.
At this moment I perceived that the 24H and 24L could have different datarates, but the 720p SH and H could not. The SH and H have a different behavior, they change the amount of data between the I and P/B frames also and in the GSpot patches I tweaked SH more for noise and H more for details in good light. I foud a difference between SH and H datarate typed in ptool which made this to work. I called it H-Switch. Also the datarate configuration is important to make camera stable, not only the amount of data, but the difference of numbers in the recording modes needs to respect some difference limit to avoid stop recording.
In terms of time, the 720p50 gop3 and 720p60 gop 4 makes each group of P frames to be on the screen almost the same amount of time, so the noise/texture is similar, so gop4 for 720p60 was a good idea to make the I frames higher in size, a good solution.
The 24p and HBR modes was also tweaked, not only the 720p, using gop 3, good share of data among frames, and datarate at maximum limit for stability.
These adjusts helped the recording modes to have a similar frame rate perceiving in all areas of the image, similar to intraframe gop1 patches. SlowMotion becomes much better due to this.
One thing common in PV topic is people testing different memory cards to try to find a fast card to avoid stop recording. the card does not do this, this is done by the patch. a fast card will not improve camera stability if the patch is wrong, it helps but a little bit. After all developing the 95MBps card makes little difference compared to the 45MBps. Yes it can help using a higher datarate but not enouch to avoid stop recording some times if datarate is too high. If the patch is ok, most cards will work.
The GH2 has nice auto electronic features. OIS, iDynamic, auto focus, auto exposure, and more. Also native lenses uses some camera processor. I would like to use them so I did a try in different datarates and differences between the record modes to allow these features and lenses to work without stop recording. And try to get the best image under this datarate limit. And to have another patch with a higher datarate to use without the features and with manual lenses. But in "the end chroma luma denoise" I found the datarate stable to be good enough.
All the developing was done always using streamparser to see the frames behavior and doing tests on the death charts and death charts movie which allow to perceive if the camera will work without freeze and without stop recording. Also tests in low light and daylight real world and tests in green grass which is also usefull to stress the camera.
Then I perceived that I would need to understand matrices, the last thing to do. In a humble way I asked for help from the masters of hack. They showed me books and white papers about H264, and I did lots of reading to understand. After lots of study I understood matrices and how they work. I also learned a lot about DCT, discrete cosine transform, in wikipedia.
In my study I perceived that the DCT frequency must be respected to get a good image without problems in texture and most patches did not respect this. So I created the DCT patches with different DC numbers and matrix design with different noise/texture.
The DC number, it is the first number of the matrix which is important to determine all the matrix behavior. I found 6 to be the sweet spot for the noise /texture quality between fine and gross. So I started to try different matrices always with 6 as first number.
Then my intuition told me that It would be good idea to use same frequency increase or near same frequency increas in all matrix numbers, and also to use numbers multples of 6 or 3, numbers with a commom denominator.
This new design made the camera very very stable, and finished a problem that previous matrices had. Before this matrix tweaking the on screen information on the LCD used to be delaied, maybe due to the camera processor being stressed doing image compression. This new matrix desing made the on screen information to be ok, without delay, so I perceived that the camera processor was no more stressed.
Also my intuition told me to use same matrix in the intraframe and interframe which saves data for the temporal compression, to get a better texture with same quantization and design in both, and less work for the camera processor. also same design in fall back.
Another 400% zoom frame by frame in lots of matrix design showed me the best configuration to compress the image without mosquito noise, without artifacts. this was the Apefos Settings topic era.
When I found the best matrix desing I started "The Patch" topic because I was believing I had found something I could keep in the camera and no more firmware changing.
But then the iso problem showed up. One matrix design was better for low iso, another for high iso, because lower quantization shows better textures, but cannot handle heavy noise without artifacts. and higher quantization can handle heavy noise, but muds textures in low iso.
The fallback idea comes to the mind. The camera uses the fallback tables when the main matrix cannot do a good compression, so it is possible to have two matrices working together. Then I did tests to find which matrix to keep as main and which matrix to keep as fallback, and also with ideas from members I developed different configurations for each recording mode considering theyr datarate and needs.
After this moment I perceived the need of tweaking the Deblocking tables, it works to turn macroblock from compression into a texture, some kind of anti-aliazing, or anti-block. I adjusted it using same theory of multiples of 6 or 3 with common denominator, after doing study about deblocking in other patches and in the original firmware. More tests to see in 400% zoom to do the deblocking without introduce mud.
For my surprize the correct settings in deblocking tables cleaned the diagonal rain pulsing pattern. A gift.
The Denoise patches also was developed from members idea of to have a patch with clean image, so I developed matrices to reduce noise, increasing quantization in first digits and using same numbers to try to flatten the image. Good results in denoise, but without the dct frequency to get good texture.
A final tweak was to learn again from flowmotion, moon and denoise, to compare the matrix desing and to create a new matrix and fallback to do everything, good for all isos, with good denoise and good texture, a small increase in quantization in first digits, keeping dct frequence increase, a high quantization in chroma last digits and so on.
Maybe I forgot some things in this history, but this is a summarize.
"The End"
@apefos Thank you for your hard work. I will test this and report back. Thanks.
I have a question about the audio. Does your hack include "thepalalias" audio settings ???
I did no changes in audio. The audio settings are the same of FlowMotion:
"Pasadena Pulse Audio Patch V2 B2, thanks to Per Lichtman."
Did a test now, with the RJ focal reducer, and the Nikon 35mm 1.4 stoped down to 2.5, in iso 320 down from 400 do avoid iso bug.
The image is looking wonderful in 24p, 30p and 60p!!!
I am very happy with the results.
I am using the stable version, not the high. Only HBR 30p makes me to want to use the high datarate version, 24p and 720p are just excellent in the stable default version. There is no way to make only HBR to be higher datarate because the settings changes 720p also, and increasing datarate for 720p will hurt the stability of the default version. Maybe in PAL the HBR in the stable version will be excellent also due to be less frames and a little more datarate compared to NTSC. But this is subtle, in flat surfaces.
Comparing the datarates in the recorded videos in the computer, the camera generates less datarate for HBR compared to 720p, 1,15x less datarate for HBR in same scene. Also HBR pixels and frame rate is more information, 1,125x more than 720p60. This results in something around 1,3x less datarate per pixel and can explain the small difference in HBR quality. So yes, the high datarate version can be useful for NTSC HBR 30p shooters. PAL HBR maybe can be ok in the stable version, due to less frames (25p) and the camera generates more data to it, I believe PAL HBR compensates this 30% difference.
I used sharpness -1, I like it most.
It seems for iDynamic enabled, with the 14-42mm lens, iso 160 is better for less noise, needs more tests.
mts files deleted: overexposed.
My last post for a while, I did my best and I will keep away again for other tasks: pay attention to the results from this patch, I like the images from it, but in the tests in the the patch topic it is showing the worst results among other patches tested, lots of recompression mud and macroblocking in dark areas, so do your tests before using in a professional work. test from @Manicd http://d-h.st/SLyb
@Apefos I'm deleting that file. It's not a fair comparison to any patch. I will start a new topic when I confirm I have good repeatable testing for each patch. And again thanks for the patches!
Just a final word: I did more shoots to confirm if the image has mud or macroblocking, in high and low iso, and in good and low light, and I could not see significant problems.
So better thing to do is to trust in your own tests instead of other peoples tests. Do your tests yourself.
I am lazy to work more for this patch. my tests shows that it is already good to me.
Recently I saw two movies on theather: American Sniper and 50 Shades of Grey. In IMDb website it says both was shot with Arri Alexa.
The End patch looks very similar to the image noise and texture from these movies using iso from 320 to 2000 when using these tip:
Keep white balance in 3100K, it shows less chroma noise. Above will introduce red/magenta noise, below will introduce blue noise.
Use these filters based on light conditions: 85B, FL-DAY, 1A, FL-DAY + 1A
use the iso bug correction: 320 down from 400, 640 down from 800, 1250 down from 1600, 2000 up from 1600 works ok also. 800 and 1600 also good. 320 down from 400 is the most beautiful.
All development of the end patch was done using 3100k white balance, this is one secret which makes difference.
This WB tip + filters + the end + GH2 + iso tip = Arri Alexa
Just a quick question on your White Balance and use of filters.
You suggest leaving the camera on a manual 3100k WB setting, which filter would be best if shooting daylight (or using daylight 5500K/5600K bulbs)?
What film mode would you recommend using with this patch? My personal gh2 looks nothing like the arri Alexa I use. I can't even grade the footage to look anything like it. Possibly a superior colorist could grade a screen grab but the dynamic range and dof seems very different along with how the cameras handle motion at the same fps and shutter speed. Any help would be appreciated I've tried almost every patch on this site and a few custom patches from friends
I've made a test with Canis Mayoris Night Matrix, The End, Moon T8 and Valkyrie 444 Type-Zero. Tripod shot, natural light interior (around 17:00), Auto White Balance, both at 160, 320, 640 & 1250 iso (I've double checked to avoid iso noise bug). Cinema mode (24p). Sandisk 64GB 95MB/S card. GH2 camera with a manual lens MD rokkor-X 28mm 2.8. Always at 2.8 aperture and 1/50 shutter.
160 & 320 shots are underexposed, 640 is the good one, while 1250 is slightly overexposed.
In this particular test, I was looking for noise texture & color. Despite the differences in size, all files looks good. Minor differences in color, I guess it depends on matrixes used by the patch. Canis, Moon and Valkyrie are a little more greenish while The End is a little more blueish (checked with the scopes).
When you look closely, zooming at 400% you'll see differences in noise texture. In particular, while playing the video footage, The Patch shows more macroblocking and mud than the others, especially on underexposed/overexposed footage (160 & 1250), and noise texture looks bigger. Again, you have to zoom and play it to perceive it, at 100% it's hard to notice. Judging just by the pics is not enough.
In this particular shot and lighting, and to my own eyes, Valkyrie looks better.
I attach pictures straight from the footage. ffmpeg was used as the decoder (quicktime looks a LOT worst, with much more red noise). If anyone wants the video footage I can upload 10s of each clip somewhere (mediafire or similar, avoiding recompression).
@icp Thanks.
Your Valkyrie screenshots are interesting. I was under the impression nothing could compare to the moon series. Although is hard to tell if the front "wood" of the record player is noise or detail in the moon and if valkyrie is better or worse in that regard. Was this room isolated from outside light sources that could change?
Also I have to agree, when I redid my testing of moont8 vs End with a manual lenses, the mud and marcoblocks became visible, even without much zooming. Which is sad because I really like The End's low noise, the image looks great straight out of the camera but when comparing you can see the lose of detail in shadows or flat areas. I wonder if the patches before the denoise matrix was added are any good. I will have to compare some footage I have of apefos's other patches. Will post any notes I find in a day or so.
This may allow two options: with denoise or without denoise, pick your poison:
Epilog patches, stable datarate or high datarate: without denoise
The End patches, stable datarate or high datarate: with denoise
Advice 1: compare them in manual white balance 3100K, same light, same iso, this WB shows less noise
Advice 2: for The End patches, Cinema or Standard Film Modes in contrast 0 crushes more the dark areas and shows less mud and macroblocking when compared to Smooth and Nostalgic Film Modes in contrast -2 Maybe the Epilog patches can do Smooth and Nostalgic better... more noise, but less mud/macroblocking
Observation: Epilog can show more image pulsing in high iso, but below iso 2000 it is safe.
It is important to keep the noise reduction in -2 in the film mode, because using this denoise muds some areas leaving noise in other areas, it does not do homogeneous denoise in all areas of image. so keep noise reduction in -2 for all patches and for all film modes.
Keep white balance in 3100K, it shows less chroma noise. Above will introduce red/magenta noise, below will introduce blue noise.
This is very close to tungsten. Drewnet showed, and multiple other parties confirmed, higher white balance settings are bad news on the GH2 and it's better to either filter when shooting daylight (Project Blue Light) or correct out the blue in post. I've been shooting with my GH2 never leaving tungsten since. Perhaps you discovered the GH2's true, native color temp or is this just specific to your patch, do you think?
this is not project blue light (I already read about it). the solution I found does not need color correction in post, it delivers good colors straight from camera.
3100k is the native sweet spot from the sensor, no matter the patch. It is the point which the sensor outputs less noise.
set manual white balance to 3100k and do this:
filter 85B for daylight = turns 5500K into 3200k or 5400k into 3100k
filter FL-DAY for fluorescent light = removes the green from fluorescent light
filter 1A = can be an add on to the FL-DAY, the two togheter to warm the image a little bit.
pay attention, some fluorescent light is near 5200k, so maybe the 85B can be better, or the 85 or 85A which are less strong.
you need to try.
@Manicd the room had a window, light was coming from the left of the picture but never direct sunlight. It was shot one after the other, the light didn't change.
What you see in the front wood of the record player it's noise (it can be seen in the video footage). In The End is worst than in Valkyrie & Moon.
I was also very pleased with the image colours straight from the camera in The End, but yes, the artifacts are visible.
@apefos I'll try the Epilog patch! Thanks!
@icp pay attention, better do the tests under artificial light... I can see light changes comparing the 4 patches in iso 640 and this can make difference in results. the end is much darker than valkirie, darker enough to show a worst image.
try to do the test in a condition nothing changes... tripod, closed windows, or night time, artificial light in same position, same settings on camera...
just a tip: if you want a clean image, the end patch can be better option. denoise in camera does not introduce trembing from denoise softwares and saves time, this can be perfect for web which is low datarate in the final upload and the videos will be seen in screens from 5 inch to 60 inch in good distance enouch to not increase mud or macroblock perception. epilog can show noise that you want to remove in post, more time, introducing trembling in gross denoised areas. do an analisys what is more ok to your daily workflow... what is better for web, what is better for the big screen. maybe you will want to leave the noise from epilog because it can look good in the big screen, so no denoise in post, all subjective choices.
@apefos: I'm interested in your formula about the combination of filters, but some things make me confused.
I see the filter 85B is orange, makes the picture much warmer, while you say it turns 5500K into 3200k. Maybe it's a matter of different brands. Google shows 85B as warm filter, but Kodak 85B filter is cold, etc.
Would you take a photos of the filters you mentioned?
Also, it would be great if you make some video test applying every filter one-by-one, so that I can see the difference after every next filter until the final result.
Thank you in advance!
@producer google it, ebay it... these are filters from the film photo era.
stil images comparison must pay attention to which frame are selected. there are I, P and B frames. if you select an I frame from patch x and a B frame from patch y, the patch x will looks better because the compression on I frames are less than B frames. a video comparison uploading 5 seconds original mts files will always be better.
do not use auto wb or auto exposure on tests, use artificial ligth, close windows, to avoid light changes, use tripod.
An interesting question: in real world shoots, which patch looks good when viewing from a confortable distance from the screen, at 100% size? (the default playback experience, as people says: lay back anbd enjoy the movie)
Did you compare the stable version vs. the high datarate version to perceive differences in mud and macroblocking? in both epilog and the end?
It looks like you're new here. If you want to get involved, click one of these buttons!