Pixel Exact GBI-HF Output
tikevin83 Mar 18th, 2019 (edited) 920 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- Obtaining Pixel Exact GBI-HF Output
- A quick overview of the GB/GBC/GBA pixel dimensions:
- GB/GBC is 160 pixels wide, 144 tall at 59.7275 frames per second.
- GBA is 240 pixels wide, 160 pixels tall at the same framerate.
- GBI-HF's part
- GBI-HF does a double scale using nearest neighbor (integer scale) to 320x288 or 480x320, then letterboxes to 720x480 (fills the rest of the pixels with empty space).
- The problem
- The DOL-001 model GameCube's digital port operates on a funky protocol called ITU-R BT.656. It's not really important to understand the signal protocol except that it only is capable of 4:2:2 color. This means that straight from the GameCube, whether the source is a GB game or a full GameCube game, the color of every other vertical line is interpolated (guessed) based on nearby pixels. This makes it impossible to capture the full color accuracy of the original signal over a digital connection. However, a GCVideo-DVI 2.4b device like the Insurrection Carby or Eon GCHD MkII can upsample the 4:2:2 signal to 4:4:4 RGB and deliver the image with both the original lines and interpolated lines over HDMI for capture.
- The solution
- The GameCube's output error from 4:2:2 only hits every other line of pixels, and GBI-HF has done a double integer scale. This means that for GBI-HF we can drop the half of the vertical lines that are interpolated to recreate the original double scaled image. Sadly because we can't double scale GameCube games the same fix cannot be done for them over native HDMI out.
- This OBS filter does that:
- And this is the result, scaled up 15x to 2400x2160 to fit 4K height perfectly.
- A few more pixel exact examples from tweets with less insane scaling:
- Technical requirements:
- A DOL-001 model Gamecube, a Game Boy Player, a method to load homebrew, and a GCVideo 2.4b HDMI output device
- A Datapath Vision RGB E1 or similar capture card and a computer with an available PCIe slot operating at x4
- And OBS-Studio compiled from my linked source branch. I'll look into how this effect might be more widely distributed as building OBS sources is challenging. Andersama, who helped write the filter, has an experimental plugin to load shaders on the fly in OBS.
- Additional Reference Capture for YouTube:
- In OBS, set the output size to 480x320 and export in lossless AVI for further processing in FFMPEG
- Then this CLI for FFMPEG should output 4k video for upload to YT
- ffmpeg -i input.avi -vf scale=2880x1920:flags=neighbor,pad=3840:2160:(ow-iw)/2:(oh-ih)/2 -c:v libx264 -crf 0 -c:a copy -pix_fmt yuv444p output.mkv
RAW Paste Data