Sign in to follow this  
Followers 0

Mac app to resample GH4 8 bit 4:2:0 to 10 bit 4:4:4

58 posts in this topic

Posted

Hey guys, I've written a really simple command line app for Mac that will resample GH4 footage from 4K 4:2:0 to 2K 4:4:4 using pixel summing. This will give you real 10 bit data in the luminance channel, so it's not just doing a brute-force bump from 8 bits to 10 bits. There actually is some interesting pixel finagling going on here:

 

http://www.mediafire.com/download/f7h950spj5hrn9f/gh444.dmg

 

There's no GUI, so you'll need to run it from the terminal. Do this by copying the app into the directory that contains the GH4 MOV files and using the following command in a terminal:

./gh444 INPUTFILE.MOV

Make sure you cd to the current directory first if necessary. You can do this by typing "cd" into the terminal, add a space, and then drag the folder containing the MOV files into the terminal window. It will automatically add the path to the cd command. It'll look like this:

cd /path/to/gh4/files

The app will spit numbered DPX frames out in a folder named "dpx_out."

 

I'd love for you guys to give it a try and see if you find it useful!

Share this post


Link to post
Share on other sites

Posted

Sounds great. I'm sure I'll have questions for you once I actually have the camera in my hands. Any idea about the processing power required to handle 10 bit 4:4:4? Same as 4K?

Share this post


Link to post
Share on other sites

Posted

Sounds great. I'm sure I'll have questions for you once I actually have the camera in my hands. Any idea about the processing power required to handle 10 bit 4:4:4? Same as 4K?

 

It's typically easier for the CPU to process uncompressed data, but disk bandwidth is more of an issue. Since this app is designed mainly for testing, the DPX files will be large and require lots of storage bandwidth. If it makes sense, I can add the ability to save ProRes 4444 files at 2K. Generally speaking, ProRes footage is much easier to decompress and display than H.264 footage, even when it's 444/RGB. I haven't run into any problems with GH4 footage, though. The files are relatively small and any recent system should have enough CPU power to play them back in realtime.

Share this post


Link to post
Share on other sites

Posted

Not to look a gift horse in the mouth! Any thoughts on a GUI? 

 

How do you program something like this anyway! (I'm really impressed!) and what are DPX files?

Share this post


Link to post
Share on other sites

Posted

Windows version? ;) I'd give that a try for sure. Getting my hands on a GH4 v 1.0 in a few days...

Share this post


Link to post
Share on other sites

Posted

Great news. How are you finding the 2k images Thomas? Does it smooth the slight aliasing on the car windows in the Porsche shot?

Share this post


Link to post
Share on other sites

Posted

Here's a 16 bit PNG file, converted from a DPX file output by gh444:

 

'>

Share this post


Link to post
Share on other sites

Posted

Forgive the re-post from Andrew's other thread on the subject but I wonder how hard would it be to, instead of summing, do a poisson disc sample to arrive at the 2K image?  

Share this post


Link to post
Share on other sites

Posted

Here's a 16 bit PNG file, converted from a DPX file output by gh444:

 

'>

 

Impressive.

Share this post


Link to post
Share on other sites

Posted

very interesting thank you.

 

Can you share just 1 frame of the original 4k and the same frame downsample to 2k 10bit?

 

Just to experiment in post to test the difference 

Share this post


Link to post
Share on other sites

Posted

+1 for windows version

It's not about gh4, it's how we say fuck to firmware limits on panasonic, canon, Nikon, etc

Share this post


Link to post
Share on other sites

Posted

What could be the resulting file converted to 2.5K?

I think that in terms of size it could be of general interest, or at least of my general interest.  :)

Share this post


Link to post
Share on other sites

Posted

+1 for Windows Please! :) Thanks

Share this post


Link to post
Share on other sites

Posted

Too much numbers for my tastes: someone could please verify if the downscaled version grades better than the original?

Share this post


Link to post
Share on other sites

Posted

Please show us examples. Proof. That is awesome and well done Thomas if true

Share this post


Link to post
Share on other sites

Posted

Here's a GUI I quickly put together:

 

http://www.mediafire.com/download/s9wyyfw9qvh8cfl/GH444_GUI.dmg

 

You still need to download the original gh444 file.  Let me know if it's broken.  It's super basic.  It doesn't provide any info on progress, but it'll let you know when it's done.

 

Edit:

A little explanation:

  • Download the file, mount it and copy "GH444 GUI" to your computer somewhere (e.g. Applications).
  • Open the app, click "Browse" to specify which file you want to convert.  The output will be in a folder called dpx_output in the same folder as the 4K file.
  • Click "Start"
  • Select the gh444 file that Thomas Worth provided
  • Wait.  A popup with the word "Done" will been shown when it's done.

Known issues:

  • It doesn't show progress.
  • If you cancel it, it will still say "Done"
  • Not sure if it works with OS X 10.7 or earlier, I haven't tested.
  • No way to set the output directory

Share this post


Link to post
Share on other sites

Posted

Here's a GUI I quickly put together:

 

http://www.mediafire.com/download/s9wyyfw9qvh8cfl/GH444_GUI.dmg

 

You still need to download the original gh444 file.  Let me know if it's broken.  It's super basic.  It doesn't provide any info on progress, but it'll let you know when it's done.

 

Great stuff!! Thanks a million James.

Share this post


Link to post
Share on other sites

Posted

Here's a 16 bit PNG file, converted from a DPX file output by gh444:

 

'>

 

Can someone (Andrew?) grab the exact same frame from the 4K source file and post it as a 16 bit PNG file?

Share this post


Link to post
Share on other sites

Posted

Hi all,

 

I experimented with this piece of software but I get inconsistent results with some bad frames.

 

I tried both with and without the GUI.

 

My setup : Mac Pro 2013 with Mavericks, using Resolve 10.1.4 for grading the DPX files.

 

Thanks for your feedback.

Share this post


Link to post
Share on other sites

Posted

I can post some 10 bit and 8bit 4k files that can be downsampled and the grade compared if it would help the discussion about how much it helps? I am on PC so I can't do the comparison myself unfortunately.

Share this post


Link to post
Share on other sites

Posted

Tested it my self a while back and found no benefit to grading so far. Although I haven't tested anything from this particular app since I am on windows. It was done using floating point pixel summing though.

Share this post


Link to post
Share on other sites

Posted

Tested it my self a while back and found no benefit to grading so far. Although I haven't tested anything from this particular app since I am on windows. It was done using floating point pixel summing though.

What did you use for this?  Did it result in a 10-bit luma channel?

Share this post


Link to post
Share on other sites

Posted

Yes it did result in 10bit, 1024 potential values. I am a CG artist and TD so I actually did this in animation software, 3DS Max. It has a scripting language that supports per pixel image manipulation and I find it is the fastest way for me to whip something up for testing, slow to process though. It looks to me like the footage grades well as is and the conversion just artificially increases color precision, but since it doesn't add any more dynamic range it doesn't make a very large difference. My initial impressions, could still be proven wrong. 

Share this post


Link to post
Share on other sites

Posted

So I have come to the conclusion that while it is mathematically possible to convert 4k 8bit to HD 10bit this 10bit is artificial and therefor doesn't offer the same grading benefits as true 10bit would. I will try to explain why.

 

8bit has 256 possible values 10bit has 1024 values, 4 times more. Going from 4k to 2k you are reducing the number of pixels by 4 hence 4 pixels are merged to make 1. If you take 4 8bit values and average them in floating point then multiply that value by 4 to transform it into a 10 bit range you will get the same result as if you just add all 4 values together. (p1+p2+p3+p4)/4 * 4 = p1+p2+p3+p4.

 

Example.

 

If I had a perfectly evenly lit scene and filmed it to true 10 bit it may end up with a 10bit value of 801.

Convert 10bit 801 to 8bit: 801/4 = 200.25 this becomes 200 since values must be integers.

Take 4 8bit values and make 1 10bit: 200+200+200+200 = 800.

 

So by down sampling and converting to 10bit I would be getting a value of 800 when that value would have been 801 if it was originally recorded to 10bit. This means that there is an error when performing this down sampling and my initial impression is that this error is equal to the gained precision you get from going 8bit to 10 bit, +- 3.

 

My conclusion is that while there is an increased numerical precision there is not a increased color accuracy therefore there is no real benefit for color grading. The resulting 10bit image does not more accurately represent what was recorded than the original 8bit did, same amount of error. 4:4:4 is the only benefit I can see.

Share this post


Link to post
Share on other sites

Posted

My conclusion is that while there is an increased numerical precision there is not a increased color accuracy therefore there is no real benefit for color grading. The resulting 10bit image does not more accurately represent what was recorded than the original 8bit did, same amount of error. 4:4:4 is the only benefit I can see.

 

Which begs the question if there's any benefit at all.  If it's not more gradable, if it doesn't significantly reduce macroblocking and other compression artifacts, if it doesn't significantly reduce digital noise then what are you left with?  Chroma smoothing and interpolation to some approximation of a full color signal can be done without a reduction in spatial resolution.  The resize technique was more or less a cheap/fast way to get there that really only ticks the box for smoother, interpolated chroma.  It trades capture resources for a simplistic but still multi-step pre-grade workflow.  

 

I'm all for being clever, but this isn't really that.  At least not yet.  Half of what folks are observing, as far as chroma smoothness goes, has to do with gh444 transcoding in a, I think it's safe to assume, very 5DtoRGB way which already does a better job than Adobe does, for instance.  Then a reduction of spatial resolution makes error near problem edges that much smaller and filtered again.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0