Technical

Tips, Tricks and Technical Information

DHDR/HDR YUV RAW Video Format

dt logo 1.5inchDrastic software can read many file formats which it does not natively understand.  Formats that have a fixed video frame size and are logically organized can be described using the industry standard HDR text file format (NOTE:  Not the still image HDR).  This page describes the file format. 

To do this the following basic criteria must be met: 

  • The frames within the stream or series of images, must be the same size.
  • The frames must be in a supported compression format (see below)
  • A header (.HDR/.STILLS) file must be created to describe the video


The .DHDR/.STILLS must be in the following format:

DHDR File Format
Drastic Technologies Ltd
(c) Copyright 1995-2024, Drastic Technologies Ltd
All Rights Reserved


Contents:
---------

1. Overview
2. Settings
3. Calculations
4. Samples


==============================================================================
==============================================================================
===========================================================
=======================================
===================
1. Overview
===================
===================

This document describes the header (*.dthdr/*.hdr) file format for use with the Drastic Technologies dtx_HdrYuv.d1x plug in for MediaReactor and QuickClip/VVW. This format has been in use for over 25 years in various forms as a *.hdr. By default, Drastic software now writes and reads a *.dthdr (as well as still reading the *.hdr). The *.dthdr is the same format with more capabilities including better audio, and split long file and time code support. Herein are outlined the most common descriptors and their meanings as they have been standardized in our software.

The basic concept of the hdr file is a text file that describes a simple video stream in which each frame is the same size, and its associated video and audio information. On disk, there will be 2 or more files, normally with the same starting name:

E:\TestRecord\Testing.dthdr
E:\TestRecord\Testing.yuv
E:\TestRecord\Testing.wav

In this example the .yuv file contains all the captured frames (as opposed to individually numbered yuv files), the .wav file contains the matched audio and the .hdr file describes them as specified below. When loading the file into QuickClip or MediaReactor, the hdr file should be chosen to make sure all files are picked up properly. The basic format of the .hdr file consists of a series of settings, each setting taking two text lines. The first line is the label and is always preceded by a percentage sign (%) and the second line is the value of the setting:

% Image Size (This line describes what the next line specifies)
486 720 (This contains the values - NTSC 720 x 486)


==============================================================================
==============================================================================
===========================================================
=======================================
===================
2. Settings
===================
===================

-----------------------------------------------------------------
% Color Format
YUV420
This setting describes the format of the video frames within the file. The current possible formats are:

yuv422_16 - 4:2:2 Planar YCbCr in I420 order, 16 bits per component
yuv422_16le - Little endian 4:2:2 planar YCbCr in I420 order, 16 bits per component
yvu422_16 - 4:2:2 Planar YCbCr in YV12 order, 16 bits per component
yvu422_16le - Little endian 4:2:2 planar YCbCr in YV12 order, 16 bits per component
yuv422_10 - 4:2:2 Planar YCbCr in I420 order, 10 bits per component in 16 bit container
yuv422_10le - Little endian 4:2:2 planar YCbCr in I420 order, 10 bits per component in 16 bit container
yvu422_10 - 4:2:2 Planar YCbCr in YV12 order, 10 bits per component in 16 bit container
yvu422_10le - Little endian 4:2:2 planar YCbCr in YV12 order, 10 bits per component in 16 bit container
yuv422_12 - 4:2:2 Planar YCbCr in I420 order, 12 bits per component in 16 bit container
yuv422_12le - Little endian 4:2:2 planar YCbCr in I420 order, 12 bits per component in 16 bit container
yvu422_12 - 4:2:2 Planar YCbCr in YV12 order, 12 bits per component in 16 bit container
yvu422_12le - Little endian 4:2:2 planar YCbCr in YV12 order, 12 bits per component in 16 bit container
yuv422_14 - 4:2:2 Planar YCbCr in I420 order, 14 bits per component in 16 bit container
yuv422_14le - Little endian 4:2:2 planar YCbCr in I420 order, 14 bits per component in 16 bit container
yvu422_14 - 4:2:2 Planar YCbCr in YV12 order, 14 bits per component in 16 bit container
yvu422_14le - Little endian 4:2:2 planar YCbCr in YV12 order, 14 bits per component in 16 bit container
yuv444_10 - 4:4:4 Planar YCbCr in I420 order, 10 bits per component in 16 bit container
yuv444_10le - Little endian 4:4:4 planar YCbCr in I420 order, 10 bits per component in 16 bit container
yvu444_10 - 4:4:4 Planar YCbCr in YV12 order, 10 bits per component in 16 bit container
yvu444_10le - Little endian 4:4:4 planar YCbCr in YV12 order, 10 bits per component in 16 bit container
yuv444_12 - 4:4:4 Planar YCbCr in I420 order, 12 bits per component in 16 bit container
yuv444_12le - Little endian 4:4:4 planar YCbCr in I420 order, 12 bits per component in 16 bit container
yvu444_12 - 4:4:4 Planar YCbCr in YV12 order, 12 bits per component in 16 bit container
yvu444_12le - Little endian 4:4:4 planar YCbCr in YV12 order, 12 bits per component in 16 bit container
yuv444_14 - 4:4:4 Planar YCbCr in I420 order, 14 bits per component in 16 bit container
yuv444_14le - Little endian 4:4:4 planar YCbCr in I420 order, 14 bits per component in 16 bit container
yvu444_14 - 4:4:4 Planar YCbCr in YV12 order, 14 bits per component in 16 bit container
yvu444_14le - Little endian 4:4:4 planar YCbCr in YV12 order, 14 bits per component in 16 bit container
yuv420_10le - Little endian 4:2:0 Planar YCbCr in I420 order, 10 bits per component, 16 bit container
yvu420_10le - Little endian 4:2:0 Planar YCbCr in yv12 order, 10 bits per component, 16 bit container
yuv420_10 - 4:2:0 Planar YCbCr in I420 order, 10 bits per component, 16 bit container
yvu420_10 - 4:2:0 Planar YCbCr in yv12 order, 10 bits per component, 16 bit container
yuv420_12le - Little endian 4:2:0 Planar YCbCr in I420 order, 12 bits per component, 16 bit container
yvu420_12le - Little endian 4:2:0 Planar YCbCr in yv12 order, 12 bits per component, 16 bit container
yuv420_12 - 4:2:0 Planar YCbCr in I420 order, 12 bits per component, 16 bit container
yvu420_12 - 4:2:0 Planar YCbCr in yv12 order, 12 bits per component, 16 bit container
YUV420 - Planar YCbCr in IYUV/I420 order (ST/Thompson/MPEG Groups)
YV12 - Planar YCbCr in YV12 order
NV12 - Planar YCbCr in I420 order, interleaved chroma (NVIDIA)
NV21 - Planar YCrCb in YV12 order, interleaved chroma (NVIDIA)
YUV422P - Planar YCbCr with 4:2:2 sub sampling (Sony)
YVU422P - Planar YCbCr with 4:2:2 sub sampling (chroma inverted)
V210 - Interleaved 10 Bit YCbCr v210 format (standard Quick Clip 10 Bit YCbCr)
YUV4224_10 - Interleaved 10 Bit YCbCr v210 format with alpha/key channel
YUV4224 - Interleaved 8 Bit YCbCr yuv2/UYVY format with alpha/key channel
YUV422_fields - Separate fields of 4:2:2 YCbCr (Crescent)
YUV422 - Interleaved 8 Bit YCbCr UYVY format (standard Quick Clip 8 Bit YCbCr) alias uyvy422
yuvi422_16 - Interleaved 16 Bit YCbCr UYVY format
yuvi422_16le - Little endian interleaved 16 Bit YCbCr UYVY format
UYVY422 - YUV 4:2:2 interleaved 8 bit packed as U Y V Y U Y V Y ...
YUY2_16 - YUV 4:2:2 interleaved 16 bit packed as Y U Y V Y U Y V ...
YUY2_16le - Little endian YUV 4:2:2 interleaved 16 bit packed as Y U Y V Y U Y V ...
YUY2 - YUV 4:2:2 interleaved 8 bit packed as Y U Y V Y U Y V ...

DPXRGBLEFILL - DPX 10 bit RGB, little endian, filled
DPXRGBLE - DPX 10 bit RGB, little endian, padded
DPXRGBFILL - DPX 10 bit RGB, big endian, filled
DPXRGB - DPX 10 bit RGB, big endian, padded
DPXABGRLEFILL - DPX 10 bit ABGR, little endian, filled
DPXABGRLE - DPX 10 bit ABGR, little endian, padded
DPXABGRFILL - DPX 10 bit ABGR, big endian, filled
DPXABGR - DPX 10 bit ABGR, big endian, padded

PRGB - 8 bit x 3 Planar RGB
PRGBA - 8 bit x 4 Planar RGBA
PBGR - 8 bit x 3 Planar BGR
PABGR - 8 bit x 4 Planar ABGR
PBGRA - 8 bit x 4 Planar BGRA
PARGB - 8 bit x 4 Planar ARGB

RGBA - 32 Bit Interleaved RGB (TIFF)
ARGB - 32 Bit Interleaved RGB (Mac)
BGRA - 32 Bit Interleaved RGB (Windows BMP/TGA)
BGR - 24 Bit Interleaved RGB (Windows BMP/TGA)
RGB - 24 Bit Interleaved RGB (TIFF)
TIFF24 - 24 Bit Interleaved RGB TIFF ordering
TIFF32 - 32 Bit TIFF (same as RGBA)
FULLDUAL - 10 bit dual frame YCbCr (stereo)
Grey - 8 bit grey/gray plane of video data alias Gray
DVSD - DVSD 'dv/dif' stream 4:2:0 or 4:1:1 8 bit SD
DV25 - DV25 'dv/dif' stream 4:2:0 8 bit SD
DV50 - DVCPro 50 stream 4:2:2 8 bit SD alias avdv
DV100 - DVCPro HD/DV-100 stream 4:2:2 8 bit HD alias avd1
AVCI100 - Panasonic AVCi 100
DNXHD - Avid DNxHD stream alsias av10, avd0~9
IMX30 - Sony IMX MPEG 30 Mbit stream 4:2:2 8 bit
IMX40 - Sony IMX MPEG 40 Mbit stream 4:2:2 8 bit
IMX50 - Sony IMX MPEG 50 Mbit stream 4:2:2 8 bit

STEREO8 - Dual 8 bit YCbCr interleaved streams (one after another)
STEREO10 - Dual 10 bit YCbCr interleaved streams (one after another)
STEREO30 - Dual 10 bit RGB DPX interleaved streams (one after another)
STEREO32 - Dual 8 bit BGRA (windows order) interleaved streams (one after another)
stereo12bggr - Dual 12 bit raw bayer (one after another)
stereo12rggb - Dual 12 bit raw bayer (one after another)
stereo12gbrg - Dual 12 bit raw bayer (one after another)
stereo12grbg - Dual 12 bit raw bayer (one after another)

bggrbe12 - Bayer pattern, 12 bits per component packed big endian
rggbbe12 - Bayer pattern, 12 bits per component packed big endian
gbrgbe12 - Bayer pattern, 12 bits per component packed big endian
grbgbe12 - Bayer pattern, 12 bits per component packed big endian
bggr12 - Bayer pattern, 12 bits per component packed little endian
rggb12 - Bayer pattern, 12 bits per component packed little endian
gbrg12 - Bayer pattern, 12 bits per component packed little endian
grbg12 - Bayer pattern, 12 bits per component packed little endian

ARRIBAYERDLRAW12 - ARRI dual link raw 12 bit bayer packed into YCbCr 10

*** DEPRECATED **

RGB_10 - 30 Bit DPX/Cineon Ordering
RGB_10LE - 30 Bit little endian DPX/Cineon ordering

*** NOT AVAILABLE **

n/a YUV411 - Interleaved YCbCr DV Order
n/a YUV411P - Planar YCbCr DV Order
n/a YUV410 - Interleaved YCbCr 4:1:0
n/a YUV410P - Planar YCbCr 4:1:0
n/a YUVA444 - Interleaved 8 bit YCbCrAlpha (Adobe)
n/a UYV444 - YUV 4:4:4 packed as U Y V U Y V ...
n/a MJPEG - Motion JPEG

-----------------------------------------------------------------
% Image Size (NbRows,NbCols)
486 720

The vertical and horizontal size of the video frame. Can be any size, but the following sizes are normal: 480x640, 480x704, 480x720, 486x720, 512x720, 576x704, 576x720, 608x720, 720x1280, 1080x1920, 1088x1920 (please note, the 'x' between the height and width is not supported. It must be a space in the .hdr file)

-----------------------------------------------------------------
% Number of Fields per Image (optional)
2

Number of separate images that make up a field. For most images this would be 1 indicating 1 full size plane with progressive or interleaved lines. If there are two separate images that need to be interleaved, this would be set to 2. This value does not affect the Image Size above, that is always the absolute number of pixels vertically and horizontally. Please note: this is the correct interpretation of this value, previously we ignored this and recommended 2 where it should have been 1.

-----------------------------------------------------------------
% Signal Format Type
interlaced

The recommended signal format output type: interlaced, progressive or segmented (psf).

-----------------------------------------------------------------
% Number of Image
1800

The number of individual frames in a file. If this value is larger than the actual number of frames available, it will be corrected, so if you are unsure set it to a very large value (e.g. 4000000)

-----------------------------------------------------------------
% Frames per Second
29

The frame rate of the video frames. This may be any value, but some values have special meanings:
23 - Means 23.98
24 - Standard film
25 - PAL/25p/50i
29 - Means 29.97 - NTSC/29.97p/59.94i
30 - NTSC NDF/30p/60i
50 - 50p
59 - Means 59.94p (for 720p, 1080p, etc.)
60 - Means 60p (for 720p, 1080p, etc.)

-----------------------------------------------------------------
% Header Offset (optional)
0

How far into the file the series of video frames starts

-----------------------------------------------------------------
% Video Alignment (optional)
512

Alignment of each frame within the stream. If the frames are back to back this value will be 1. It is normal to pad each frame to align it to a disk sector for higher speed reads and writes. This value is normally either 0 (which indicates 1), 512 (windows), 4096 (sgi), 16384 (js)

-----------------------------------------------------------------
% Video Line Pitch (optional)
1440

The number of bytes in one line of video. Especially important for YCbCr 10 bit when frame size is 1280x720 or 2048x1080

-----------------------------------------------------------------
% Video Offset (optional)
0

How far into each frame, from the calculated start, the actual video starts

-----------------------------------------------------------------
% Video Name (optional)
ThisFile.YUV

This is the name of the video file/stream associated with this header. Normally the video file has the same name as the .hdr file, but with a .yuv extension. This allows the video name to be overridden to any file name.

-----------------------------------------------------------------
% Audio Name (optional)
ThisFile.Wav

This is the name of an associated audio file. Normally QuickClip/MediaReactor look for sidebar wave or aiff files with the same name as the header file. This allows the audio file to be specified.

-----------------------------------------------------------------
% Audio Format
Stereo

-----------------------------------------------------------------
% Audio Frequency
48000

-----------------------------------------------------------------
% Audio Block Align
4

-----------------------------------------------------------------
% Audio Bits Per Sample
24

-----------------------------------------------------------------
% Timecode (optional)
01:00:00:00

This is the time code value of the first frame. The time is assumed to run contiguously from this point.

-----------------------------------------------------------------
% Userbits (optional)
BAADF00D

This is the user bits returned for this stream. It is assumed it is the same for all video frames.

-----------------------------------------------------------------
% Start Frame (optional)
100

This specifies the first video frame of the stream. By default, this is 0, but in a circular file the last frame written may not be the last frame of the file. In the case above, if start frame is 100, the last frame written was 99. The reader will read from 100->end of file and then 0->99 automatically.

-----------------------------------------------------------------
% Max Segment (optional)
1296000

This specifies how long one segment of a multi segment record will be. Defaults to 12 hours (above is 12 hours in frames, NDF 30).


Please note, comments and other information may exist in the file, but if the file is re-written by QuickClip or VVW, then that information will be lost.

==============================================================================
==============================================================================
===========================================================
=======================================
===================
3. Calculations
===================
===================

Total Frame Pixels = <% Image Size (NbRows,)> * <% Image Size (,NbCols)>

(1)Frame Size = <size of video file> / <% Number of Image>

(2)Frame Size =
YUV420 (<totalframepixels> + (<totalframepixels> / 2))
YUV411P (<totalframepixels> + (<totalframepixels> / 2))
YUV422P (<totalframepixels> * 2)
YUV411 (<totalframepixels> + (<totalframepixels> / 2))Order
YUV422 (<totalframepixels> * 2)
YUV422_10 (<totalframepixels> * 16 / 6)
YUVA444 (<totalframepixels> * 4)
RGBA (<totalframepixels> * 4)
RGB (<totalframepixels> * 3)
RGB_10 (<totalframepixels> * 4)
RGB_10LE (<totalframepixels> * 4)
*NOTE: 720x1280 in YUV422_10 is a special case. Please use a (1) calc for this

(1) Aligned Frame Size = <size of video file> / <% Number of Image>

(2) Aligned Frame Size = (((<Frame Size> + <% Video Alignment> - 1) / <% Video Alignment>) * <% Video Alignment>
*NOTE: Above math MUST be integer to work properly

Seek to a frame offset = <required frame number> * <Aligned Frame Size>


==============================================================================
==============================================================================
===========================================================
=======================================
===================
4. Samples
===================
===================

calendar_01.hdr
-snip------------------------------------------------------------
% Color Format (YUV420, YUV422, YUV422P, YUV422_10, RGB, RGBA)
YUV422P % Planar 422
% Image Size (NbRows,NbCols) (576 720, 486 720, 720 1280, 1080 1920)
576 720 % PAL Size
% Number of Fields per Image
1 % Both fields in single frame group
% Number of Image
12 % If greater than actual, reader will correct
% Frame per second
25 % PAL rate
%% Video Alignment
%512 % no alignment
%% Video Name
% optional e:\calendar_01.yuv
% Audio Format
%Stereo % none, should be wav or aiff
% timecode
00:00:00;00 D
% userbits
FFFFFFFF
% Start Frame
0
-snip------------------------------------------------------------

table_tennis.hdr (mpeg test stream)
-snip------------------------------------------------------------
% Color Format
YUV420
% Image Size (NbRows,NbCols)
288 352
% Number of Fields per Image
1
% Number of Image
250
% Frame per second
25
-snip------------------------------------------------------------

(c)opyright 1995-2024 Drastic Technologies Ltd. All Rights Reserved.

http://www.drastictech.com
http://www.drastictech.com/hdrfileformat.txt
support at drastictech.com
416 255 5636


 

 

Trademarks, Registered Trademarks, and Copyrights

 

Trademarks, Registered Trademarks, and Copyrights

ARRI AG - Arri T-Link is a registered trademark of the ARRI Group
Avid Technology, Inc. - Avid Media Composer®, Avid MediaCentral®, Avid Interplay®, and Avid NewsCutter® are either trademarks or registered trademarks of Avid Technology, Inc. or its subsidiaries in the United States and/or other countries.
Drastic Technologies, Ltd. – trademarks specified here.
Eastman Kodak Company - Cineon™ is a trademark of Eastman Kodak Company
Microsoft Corporation – Microsoft: Windows®, Video For Windows (VFW), DirectShow, Microsoft, Skype, Microsoft Azure, Microsoft Teams, Wave Mapper, Microsoft, Windows NT|2000|XP|XP Professional|Server 2003|Server 2008 |Server 2012, Windows 7, Windows 8, Media Player, Media Encoder, .Net, Internet Explorer, SQL Server 2005|2008|2012|2014, Windows Media Technologies and Internet Explorer are trademarks of Microsoft Corporation.
NVIDIA Corporation - NVIDIA, the NVIDIA logo, NVIDIA Quadro, Rivermax, BlueField2, PhysX, and NVIDIA RTX are trademarks and/or registered trademarks of NVIDIA Corporation in the U.S. and/or other countries
Panasonic Holdings Co., Ltd - Panasonic is a trademark of Panasonic Holdings Co., Ltd
Sony – Sony DVD Architect, DVD, and Vegas are trademarks of Sony Corporation and/or its affiliates.
All other trademarks are the property of their respective owners.

 

 

Image

For more than three decades, Drastic™ has been developing cutting edge digital video solutions for television, post production and sports broadcasting, from real time web delivery to 8K broadcast.

We offer standalone software for the end user or enterprise, integrated solutions for automated workflows, and OEM tools for custom applications or branded devices.

Contact Us

Address:
523 The Queensway, Suite 201
Toronto, ON
M8Y 1J7, Canada

Phone: +1 (416) 255 5636

Email: sales@drastictech.com

Fax: + 1 (416) 255 8780

Follow us on Social Media