License | Documentation | Download | Change log | Related Software | Contact | Back

R3D source plugin for AviSynth

Screenshot of the R3D AviSynth plugin in action This plugin allows you to load Redcode™ RAW files (that is: footage shot with a RED ONE™ Camera) in the AviSynth video scripting platform for Windows.

For free Windows RED workflows, see also my R3D input plugin for VirtualDub and R3D shell extension.

For an online discussion of this project, see the official RED User forum.

License

By downloading and using the R3D source plugin for AviSynth you agree to the terms and conditions set forth in this End User License Agreement ("EULA").

The R3D source plugin for AviSynth ("Plugin") is freeware. You may use it without time or legal restrictions for either commercial or non-commercial purpose.

The plugin was developed and tested by Gábor Kertai ("Author") to his best knowledge, however Author takes absolutely no responsibility that the Plugin works as expected.

You can use the Plugin at your own risk. This Plugin is provided to you "as is", and Author expressly disclaims all warranties of any kind, either implied or express, including but not limited to warranties of merchantability, fitness for a particular purpose, and non-infringement. Author makes no warranty, either implied or express, that any part of the Plugin will be error-free, virus-free, secure, accurate, reliable, or of any quality.

In no event will Author be liable to you for any damages, claims or costs whatsoever arising from this EULA and/or your use of the Plugin of any component thereof.

The Plugin uses technology licensed from RED Digital Cinema Camera Company ("RED") in the form of the R3D SDK, however it has NOT been approved, tested or certified by RED. RED makes no warranties regarding the stability, accurateness and performance of their technology. As per licensing instructions of the R3D SDK, the Plugin is only made available to you in binary format.

You must not reverse engineer, decompile, disassemble or otherwise try to discover the source code of the Plugin and/or the file formats related to RED poducts, especially the Redcode™ RAW (R3D) file format.

The Plugin and any authorized copies that you make are intellectual property of Author and also contain copyrighted material from RED. You agree that all copies of the Plugin reproduced for any reason by you will contain the same copyright and trademark notices as this EULA.

The Plugin may not be redistributed, sold or otherwise made available through any channel other than a download from this website.

RED Digital Cinema, RED ONE, and REDCODE are trademarks of the RED Digital Cinema Camera Company.

Installation

Extract the R3DSource.dll from the ZIP file and place it in a directory of your choice, preferably plugins folder of your AviSynth installation. You are now ready to write AviSynth scripts that load and process R3D clips.

The plugin requires AviSynth V2.5 or newer.

Documentation

R3DSource Syntax

R3DSource( string filename, string "render_size", string "crop_aspect", string "gamma_space", string "color_space", int "iso", float "kelvin", float "tint", float "exposure", float "brightness", float "contrast", float "saturation", float "drx", float "gain_r", float "gain_g", float "gain_b", int "denoise_level", int "olpf_compensation" )

Loads a clip from the specified R3D file.

R3DSource Parameters

filename: Specify the path and name of the R3D file to be loaded, such as "D:\Project\R004_C001_0116R3.RDC\R004_C001_0116R3_001.R3D". For multi-segment clips, this can be any one of the segments, and the entire clip will be loaded. So it's kind of practical to use segment #1.

render_size: Specifies the resolution and quality that the video will be decoded at. It can be one of "full", "half", "quarter", "eight" or "sixteenth". At "half" render size you can also specify "half_premium" (same as "half") and "half_good" for different qualities. The latter might give you some performance advantage. Defaults to "full".

crop_aspect: Specifies the frame aspect that the clip should be cropped to. It can be any one of "4:3" (alternatively "1.33"), "16:9" (alternatively "1.78"), "1.85", "2.40", "default" or "disabled". The "default" setting will use whatever aspect ratio is stored in the clip metadata. The "disabled" setting will not do any cropping at all. Defaults to "disabled".

gamma_space: Any one of "Linear", "Rec709", "REDspace", "PDlog685", "PDlog985", "REDlog" or "default", where "default" means to use the gamma setting from the clip metadata.

color_space: Any one of "CameraRGB", "Rec709", "REDspace" or "default", where "default" means to use the gamma setting from the clip metadata.

iso: Specifies an ISO exposure adjustment (just like setting ISO on the camera). Can be one of the following values: 50, 80, 100, 125, 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1280, 1600, 2000. Defaults to use clip metadata.

kelvin, tint, exposure, brightness, contrast, saturation, drx, gain_r, gain_g, gain_b: Float values that can be used to tweak image processing settings similarly to the same settings of the camera. The following table shows allowed ranges and reference origin values. Each one of these settings defaults to clip metadata.

Minimum and maximum values for some parameters
Name Minimum Maximum Origin Description
kelvin 1700.0 100000.0 5000.0 Adjusts color temperature in K degrees
tint -100.0 100.0 0.0 Adjusts color cast on the magenta - green channel
exposure -7.0 7.0 0.0 Adjusts exposure compensation
brightness -10.0 10.0 0.0 Adjusts brightness without crushing highlights
contrast -1.0 1.0 0.0 Adjusts the overall contrast of the image (-1.0 is flat)
saturation 0.0 4.0 1.0 Adjusts color saturation (0.0 is monochrome)
drx 0.0 1.0 0.5 Adjusts dynamic range expansion
gain_r 0.0 10.0 1.0 Adjusts the gain of the RED channel only
gain_g 0.0 10.0 1.0 Adjusts the gain of the GREEN channel only
gain_b 0.0 10.0 1.0 Adjusts the gain of the BLUE channel only

denoise_level: Applies denoising to the picture when debayering. Valid range is 0 (no denoising applied) to 6 (strong denoising). Defaults to zero.

olpf_compensation: Applies an unsharp mask filter to compensate for the softness of the image caused by the Optical Low-Pass Filter in front of the CMOS. Valid range is 0 (no compensation) to 3 (strong compensation). Defaults to zero.

Video

Video is always decoded to the RGB32 color representation, where the alpha channel is left empty (opaque). Note that images are internally decoded to 8 bits per channel, which is lower than the color resolution that Redcode allows. This is a limitation of AviSynth at the moment. Should it ever start supporting more precise color representations, I'll change the plugin accordingly.

Audio

Audio is decoded at its full quality, 48kHz and 24 bits per channel. Only recorded tracks will carry audio data, there's no option to create silence for missing tracks. I might add this in a future build (analog to the same feature of my R3D input plugin for VirtualDub).

R3DMetaData Syntax

R3DMetaData(clip c, string name)

Retrieves the specified meta data value for a loaded R3D clip.

R3DMetaData Parameters

c: R3D clip that was loaded using R3DSource.

Important: The clip variable must be the original clip from R3DSource without any clipping, resizing or other filters applied. If you pass a clip that is not from R3DSource, or that has been altered in any way, you'll get an invalid parameter error.

Note: When you have several R3D clips opened in the same script, there's a chance that R3DMetaData returns values from a different clip than you would expect. It is very unlikely, but still, it can happen. You've been warned. And I made a note to myself to iron this out in a next release.

name: Specify the name of the metadata you want to retrieve. The return type can be int, float or string, depending on the value requested. Note that not all of these values are guaranteed to exist. In case you request meta data which is not stored in the clip, you'll get a void return value. The name can be any one of the following:

Download

Latest version: AviSynth_R3D_Source_V1.2.zip (395.6 kilobytes)

Older versions:
AviSynth_R3D_Source_V1.1.zip (332.6 kilobytes)
AviSynth_R3D_Source_V1.0.zip (331 kilobytes)

If you need something to experiment with, but don't have any recordings of your own, you can grab sample R3D files from the Official Red User Forums.

Version History

V1.2 (released: 2010-01-25) V1.1 (released: 2009-02-16) V1.0 (released: 2009-02-08)

Related Software

If you're handling Redcode™ RAW files on Windows, you will probably find my R3D Shell Extension useful.

Contact

Should you have any useful feedback, bug report, comment or idea for improvement, you can reach me at my email address.

I reserve the right to ignore any emails with a bad attitude or lack of respect.

Verified XHTML