AXIOM Beta/experimental raw video

From apertus wiki
Revision as of 16:17, 5 July 2018 by Sebastian (talk | contribs)
Jump to: navigation, search

AXIOM Beta UHD Raw Workflow Explained: https://www.apertus.org/axiom-beta-uhd-raw-mode-explained-article-may-2016

1 Experimental UHD Raw Recording

Note: This experimental raw mode works only in 1080p60 (A+B Frames) and is only tested with the Atomos Shogun currently.

To measure the required compensations with a different recorder follow this guide: raw processing recorder benchmarking

This mode requires darkframes which are created in the course of a camera Factory Calibration. Early Betas are not calibrated yet - this step needs to be completed by the user.

1.1 Enable raw Recording Mode

On the AXIOM Beta execute:

./hdmi_rectest.sh

from https://github.com/apertus-open-source-cinema/beta-software/blob/master/software/scripts/hdmi_rectest.sh

Inside that script the following command is worth noting:

Enable experimental raw mode:

scn_reg 31 0x0A01

Disable experimental raw mode:

scn_reg 31 0x0001


if you get an error report like this:

Traceback (most recent call last):
  File "rcn_darkframe.py", line 17, in <module>
    import png
ImportError: No module named 'png'

Make sure the Beta is connected to the Internet via Ethernet and run:

pip install pypng

More details see the dedicated experimental raw wiki page

1.2 Processing

Post-processing software to recover the raw information (DNG sequences) is on github: https://github.com/apertus-open-source-cinema/misc-tools-utilities/tree/master/raw-via-hdmi

required packages: ffmpeg build-essentials

Mac requirements for compiling: gcc4.9(via homebrew):

brew install homebrew/versions/gcc49

also install ffmpeg

To do all the raw processing in one single command (after ffmpeg codec copy processing):

./hdmi4k INPUT.MOV - | ./raw2dng --fixrnt --pgm --black=120 frame%05d.dng

1.2.1 Raw Processing Recorder Benchmarking

We can analyze footage recorded by the third party recorders but we would need the following:

  • make sure your Beta is running in experimental 4k raw mode (1080p60 with A+B frames)
  • short HDMI captured clip from the 3rd party recorder
  • raw12 still image captured during the HDMI recording

This kind of script is helpful to execute during HDMI recording:

#stop HDMI stream:
fil_reg 15 0

#capture image
./cmv_snap3 -r -2 -e 10ms > image.raw12

#start HDMI stream:
fil_reg 15 0x01000100

Taking a snapshot during HDMI recording with the above script will pause the HDMI stream for a few seconds, where it will alternate between two frames. These two frames will be from the same raw data as image.raw12, so they contain all that's needed to figure out what kind of processing the HDMI recorder applies to the image, and how to undo it in order to recover the raw data.

Ideally, the scene should contain fine details (such as tissue, fine print) and rich colors. A color chart (which usually contains some fine print as well) is a very good choice.

  • HDMI captured 1-minute clip with dark frames (lens cap on camera, black cloth covering camera in a dark room)

1.3 Experimental Raw Video to PGM Sequence Conversion

Converts a video file recorded in AXIOM raw to a PGM image sequence and applies the darkframe (which needs to be created beforehand).

Currently clips must go through ffmpeg before hdmi4k can read them:

ffmpeg -i CLIP.MOV -c:v copy OUTPUT.MOV

To cut out a video between IN and OUT with ffmpeg but maintaing the original encoding data:

ffmpeg -i CLIP.MOV -ss IN_SECONDS -t DURATION_SECONDS -c:v copy OUTPUT.MOV
hdmi4k
HDMI RAW converter for Axiom BETA

Usage:
  ./hdmi4k clip.mov
  raw2dng frame*.pgm [options]

Calibration files:
  hdmi-darkframe-A.ppm, hdmi-darkframe-B.ppm:
  averaged dark frames from the HDMI recorder (even/odd frames)

Options:
-                   : Output PGM to stdout (can be piped to raw2dng)
--3x3               : Use 3x3 filters to recover detail (default 5x5)
--skip              : Toggle skipping one frame (try if A/B autodetection fails)
--swap              : Swap A and B frames inside a frame pair (encoding bug?)
--onlyA             : Use data from A frames only (for bad takes)
--onlyB             : Use data from B frames only (for bad takes)