NRG (file format)

{{short description|Proprietary optical disc image file format}}

{{unreferenced|date=November 2011}}

{{Infobox file format

| name = NRG

| logo =

| icon =

| iconcaption =

| screenshot =

| caption =

| extension = .nrg

| mime =

| type code =

| uniform type = com.nero.nrg-image

| conforms to = public.iso-image,
com.apple.disk-image,
public.archive,
public.data,
public.item,
public.disk-image

| magic =

| developer = Nero AG

| released =

| latest release version =

| latest release date =

| genre = disk image

| container for = filesystem and volumes

| contained by =

| extended from =

| extended to =

| standard =

| free =

| url =

}}An NRG file is a proprietary optical disc image file format originally created by Nero AG for the Nero Burning ROM utility.[https://file.org/extension/nrg] It is used to store disc images. Other than Nero Burning ROM, however, a variety of software titles can use these image files. For example, Alcohol 120%, or Daemon Tools can mount NRG files onto virtual drives for reading.

Contrary to popular belief, NRG files are not ISO images with a .nrg extension and a header attached. They can store audio tracks for Audio CDs, which ISO images cannot. Nero's NRG format is one of the few formats besides BIN/CUE, Alcohol 120%'s MDF/MDS and CloneCD's CCD/IMG/SUB disc image formats to support Mixed Mode CDs which contain audio CD tracks as well as data tracks.

File format

{{Original research|date=May 2010}}

The file format specification below is unofficial and as such is lacking some data. There may also be errors.

The NRG file format uses a variation of the Interchange File Format (IFF) and stores data in a chain of "chunks". All integer values are stored unsigned in big endian byte order. Version 1 NRG format stores values as 32-bit integers. Nero Burning ROM v5.5 introduced a new NRG file format, version 2, with support for 64-bit integers.

=Header=

The NRG format does not store its data as a header at the beginning of a file. It is instead attached at the end of the file like a footer. Image information is stored as a serialized chain of IFF chunks. To get the offset of the first chunk one must read the NRG footer from the last 8 or 12 bytes of the file.

{{Col-begin}}

{{Col-break}}

class="wikitable"

|+ Nero footer (Version 1)

Size (bytes)

! Type

! Value or purpose

4Chunk ID"NERO"
432-bitOffset of the first chunk data chain

{{Col-break}}

class="wikitable"

|+ Nero footer (Version 2)

Size (bytes)

! Type

! Value or purpose

4Chunk ID"NER5"
864-bitOffset of the first chunk data chain

{{Col-end}}

=Chunks=

==(CUES) Cue Sheet==

Available in all versions of NRG file format.

The CUEX chunk is the concatenation of fixed-size blocks, each one representing a cue point.

The index0 points are present even when they are identical to the index1 ones. The index0 points in audio tracks are incorrect if Nero has been asked to record all the sub-channel data (in that case the sector size is 2448 bytes). No index other than 0 or 1 has been encountered, although the chunk format allows for such cue points to be recorded; thus the number of cue blocks seems to be always 2*(#track + 1): two indices for each track, an index0 for the lead-in and an index1 for the lead-out.

{{Col-begin}}

{{Col-break}}

class="wikitable"

|+ Version 1

Size (bytes)

! Type

! Value / Purpose

4Chunk ID"CUES"
432-bitChunk size (bytes)

{{Col-break}}

class="wikitable"

|+ Version 2

Size (bytes)

! Type

! Value / Purpose

4Chunk ID"CUEX"
432bitChunk size (bytes)
style="background:silver"

| 1

8bitMode (values found: 0x01 for audio; 0x21 for non copyright-protected audio; 0x41 for data)
style="background:silver"

| 1

8bitTrack number (BCD coded; 0xAA for the lead-out area)
style="background:silver"

| 1

8bitIndex number (probably BCD coded)
style="background:silver"

| 1

8bitPadding? (always zero found)
style="background:silver"

| 4

32bitLBA position in sectors (signed integer value)

{{Col-end}}

==(DAOI) DAO Information==

Available in all versions of NRG file format.

DAOI chunks store disc at once sessions specific information in two parts. The first part contains data that is specific for the session only. The second part repeats track specific information (grey) once for each track. Parse the SINF chunks to get the number of tracks for a specific session.

{{Col-begin}}

{{Col-break}}

class="wikitable"

|+ Version 1

Size (bytes)

! Type

! Value / Purpose

4Chunk ID"DAOI"
432bitChunk size (bytes) big endian
432bitChunk size (bytes) little endian
14 UPC
432bitToc type
18bitFirst track
18bitLast track
style="background:silver"

| 12

 ISRC
style="background:silver"

| 4

32bitSector size
style="background:silver"

| 4

32bitMode
style="background:silver"

| 4

32bitIndex0 (Pre gap)
style="background:silver"

| 4

32bitIndex1 (Start of track)
style="background:silver"

| 4

32bitIndex2 (End of track + 1)

{{Col-break}}

class="wikitable"

|+ Version 2

Size (bytes)

! Type

! Value / Purpose

4Chunk ID"DAOX"
432bitChunk size (bytes) big endian
432bitChunk size (bytes) (big endian already encountered; maybe also little endian on some machines)
13TextUPC (or NULLs)
18-bitPadding? (always NULL found)
216-bitToc type (values already found: 0x0000 for audio; 0x0001 for data; 0x2001 for Mode 2/form 1 data)
18bitFirst track in the session
18bitLast track in the session
style="background:silver"

| 12

TextISRC (or NULLs)
style="background:silver"

| 2

16bitSector size in the image file (bytes)
style="background:silver"

| 2

16bitMode of the data in the image file (values already found: 0x0700 for audio; 0x1000 for audio with sub-channel; 0x0000 for data; 0x0500 for raw data; 0x0f00 for raw data with sub-channel; 0x0300 for Mode 2 Form 1 data; 0x0600 for raw Mode 2/form 1 data; 0x1100 for raw Mode 2/form 1 data with sub-channel)
style="background:silver"

| 2

16bitUnknown (always 0x0001 found)
style="background:silver"

| 8

64bitIndex0 (Pre-gap) (bytes)
style="background:silver"

| 8

64bitIndex1 (Start of track) (bytes)
style="background:silver"

| 8

64bitEnd of track + 1 (bytes)

{{Col-end}}

==(CDTX) CD-text==

Available in version 2 NRG file format.

The CDTX chunk is the concatenation of raw CD-text packs of 18 bytes each.

class="wikitable"

|+ Version 2

Size (bytes)

! Type

! Value / Purpose

4Chunk ID"CDTX"
432bitChunk size (bytes)
style="background:silver"

| 1

8bitPack type
style="background:silver"

| 1

8bitPack type (track number)
style="background:silver"

| 1

8bitPack number in the block
style="background:silver"

| 1

8bitBlock number etc.
style="background:silver"

| 12

TextNULL-separated text strings
style="background:silver"

| 2

16bitCRC

==(ETNF) Extended Track Information==

Available in all versions of NRG file format.

ETNF chunks are used to store track information for track at once sessions. The data is repeated once for each track. Parse the SINF chunks to get the number of tracks for a specific session.

{{Col-begin}}

{{Col-break}}

class="wikitable"

|+ Version 1

Size (bytes)

! Type

! Value / Purpose

4Chunk ID"ETNF"
432bitChunk size (bytes)
style="background:silver"

| 4

32bitTrack offset in image
style="background:silver"

| 4

32bitTrack length (bytes)
style="background:silver"

| 4

32bitMode
style="background:silver"

| 4

32bitStart lba on disc
style="background:silver"

| 4

 ?

{{Col-break}}

class="wikitable"

|+ Version 2

Size (bytes)

! Type

! Value / Purpose

4Chunk ID"ETN2"
432bitChunk size (bytes)
style="background:silver"

| 8

64bitTrack offset in image
style="background:silver"

| 8

64bitTrack length (bytes)
style="background:silver"

| 4

32bitMode (values found: 0x7 for audio; 0x0 for data; 0x3 for Mode 2 data)
style="background:silver"

| 4

32bitStart lba on disc (sectors) (the start is after a lead-in of 150 sectors)
style="background:silver"

| 4

32bitUnknown (only zero found)
style="background:silver"

| 4

32bitTrack length (sectors)

{{Col-end}}

==(SINF) Session Information==

Available in all versions of NRG file format.

Session information chunks should be used to quickly scan the image for session and track count. SINF chunks are always listed in sequential order corresponding to the sessions order. To get more details information about a specific session one must parse the corresponding DAOI or ETNF chunk.

class="wikitable"

|+ Version 1 and 2

Size (bytes)

! Type

! Value / Purpose

4Chunk ID"SINF"
432bitChunk size (bytes)
432bit# tracks in session

==(MTYP) Media Type?==

Available in all versions of NRG file format.

This chunk and its use is unknown. A value of 1 (big endian) was found in images of several CD (audio or data; CD-ROM or CD-R).

class="wikitable"

|+ Version 1 and 2

Size (bytes)

! Type

! Value / Purpose

4Chunk ID"MTYP"
432bitChunk size (bytes)
4 ?

==(DINF) Disc Information?==

Found in TAO images in version 2 of NRG file format. Found in DAO images in version of NRG file format only if Nero was asked not to close the disc.

This chunk and its use is unknown.

class="wikitable"

|+ Version 2 (and 1?)

Size (bytes)

! Type

! Value / Purpose

4Chunk ID"DINF"
432bitChunk size (bytes)
432bitUnknown (found 0x1 for an unclosed disc; 0x0 otherwise)

==(TOCT) TOC T?==

Found in TAO images in version 2 of NRG file format.

This chunk and its use is unknown.

class="wikitable"

|+ Version 2 (and 1?)

Size (bytes)

! Type

! Value / Purpose

4Chunk ID"TOCT"
432bitChunk size (bytes)
2 Unknown (always zero found)

==(RELO)==

Found in TAO images in version 2 of NRG file format.

This chunk and its use is unknown.

class="wikitable"

|+ Version 2 (and 1?)

Size (bytes)

! Type

! Value / Purpose

4Chunk ID"RELO"
432bitChunk size (bytes)
4 Unknown (always zero found)

==(END!) End of chain==

Available in all versions of NRG file format.

End of chain chunk is signals that there are no more chunks to be read.

class="wikitable"

|+ Version 1 and 2

Size (bytes)

! Type

! Value / Purpose

4Chunk ID"END!"
432bitChunk size (always zero)

{{Disk images}}

{{DEFAULTSORT:Nrg (File Format)}}

Category:Archive formats

Category:Disk images