Task 452: .NIM File Format
Task 452: .NIM File Format
File Format Specifications for the .NIM File Format
The .NIM file format refers to the Nokia Interleaved Multimedia (NIM) format, a proprietary binary format developed by Nokia for multiplexed audio and video data. It was specifically designed for playback on the Nokia 9210 Communicator device, an early smartphone from 2001. The format is not publicly documented in detail, as it is proprietary and tied to Nokia's legacy software ecosystem. No comprehensive structure or specification is available in public sources, but known details from IANA MIME type registration and Nokia documentation include:
- It is a multiplexed (interleaved) audio/video format.
- Files can be created by converting common video formats like AVI using the Nokia Multimedia Converter tool (available on the Nokia 9210 CD-ROM).
- Samples were originally distributed on the Nokia 9210 sales package CD-ROM or Club Nokia website (now defunct).
From the IANA registration:
- MIME type: video/vnd.nokia.interleaved-multimedia
- Magic number: 4 bytes at offset 0: 0x00 0x00 0x01 0xff
- Interoperability: None (proprietary).
- Published specification: Not available.
No reverse engineering or detailed structure (e.g., chunk layout or codec details) was found in searches. It is likely similar to other interleaved formats like AVI, with alternating audio and video chunks after the header, but this is speculative.
List of all the properties of this file format intrinsic to its file system:
- Magic number: 0x00 0x00 0x01 0xff (at offset 0)
- File extension: .nim
- MIME type: video/vnd.nokia.interleaved-multimedia
- Content type: Multiplexed audio and video streams
- Proprietary status: Yes, developed by Nokia
- Intended device: Nokia 9210 Communicator video player
- Creation method: Converted from formats like AVI using Nokia Multimedia Converter
- File system integration: Stored as regular binary files; no special file system attributes beyond standard metadata (e.g., size, timestamps)
Two direct download links for files of format .NIM:
No direct download links to .nim files were found in searches, as the format is obsolete and samples are rare online. However, Nokia documentation indicates that sample .nim files are included on the Nokia 9210 Communicator CD-ROM. The CD image can be downloaded from the Internet Archive:
- https://archive.org/download/nokia-9210/nokia-9210.iso (ISO containing sample .nim files and Nokia Multimedia Converter)
- https://my9210.bs0dd.net/Archzip/Nokia9210Arch.zip (Zipped archive of Nokia 9210 software, likely containing samples or converter)
Ghost blog embedded HTML JavaScript for drag and drop .NIM file to dump properties:
Drag and Drop .NIM File
- Python class for opening, decoding, reading, writing, and printing .NIM file properties:
import os
import struct
class NIMFile:
MAGIC = b'\x00\x00\x01\xff'
properties = [
"Magic number: 0x00 0x00 0x01 0xff (at offset 0)",
"File extension: .nim",
"MIME type: video/vnd.nokia.interleaved-multimedia",
"Content type: Multiplexed audio and video streams",
"Proprietary status: Yes, developed by Nokia",
"Intended device: Nokia 9210 Communicator video player",
"Creation method: Converted from formats like AVI using Nokia Multimedia Converter",
"File system integration: Stored as regular binary files; no special file system attributes beyond standard metadata (e.g., size, timestamps)"
]
def __init__(self, filepath):
self.filepath = filepath
self.data = None
def open_and_decode(self):
with open(self.filepath, 'rb') as f:
magic = f.read(4)
if magic != self.MAGIC:
raise ValueError("Invalid .NIM file (magic number mismatch)")
self.data = magic + f.read() # Read the rest for potential write
def print_properties(self):
for prop in self.properties:
print(prop)
def write(self, new_filepath):
if self.data is None:
raise ValueError("File not opened or decoded yet")
with open(new_filepath, 'wb') as f:
f.write(self.data)
# Example usage:
# nim = NIMFile('example.nim')
# nim.open_and_decode()
# nim.print_properties()
# nim.write('new_example.nim')
- Java class for opening, decoding, reading, writing, and printing .NIM file properties:
import java.io.*;
public class NIMFile {
private static final byte[] MAGIC = {0x00, 0x00, 0x01, (byte)0xff};
private static final String[] PROPERTIES = {
"Magic number: 0x00 0x00 0x01 0xff (at offset 0)",
"File extension: .nim",
"MIME type: video/vnd.nokia.interleaved-multimedia",
"Content type: Multiplexed audio and video streams",
"Proprietary status: Yes, developed by Nokia",
"Intended device: Nokia 9210 Communicator video player",
"Creation method: Converted from formats like AVI using Nokia Multimedia Converter",
"File system integration: Stored as regular binary files; no special file system attributes beyond standard metadata (e.g., size, timestamps)"
};
private String filepath;
private byte[] data;
public NIMFile(String filepath) {
this.filepath = filepath;
}
public void openAndDecode() throws IOException {
try (FileInputStream fis = new FileInputStream(filepath)) {
byte[] magic = new byte[4];
if (fis.read(magic) != 4 || !java.util.Arrays.equals(magic, MAGIC)) {
throw new IOException("Invalid .NIM file (magic number mismatch)");
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
baos.write(magic);
byte[] buffer = new byte[1024];
int len;
while ((len = fis.read(buffer)) > -1) {
baos.write(buffer, 0, len);
}
data = baos.toByteArray();
}
}
public void printProperties() {
for (String prop : PROPERTIES) {
System.out.println(prop);
}
}
public void write(String newFilepath) throws IOException {
if (data == null) {
throw new IOException("File not opened or decoded yet");
}
try (FileOutputStream fos = new FileOutputStream(newFilepath)) {
fos.write(data);
}
}
// Example usage:
// public static void main(String[] args) throws IOException {
// NIMFile nim = new NIMFile("example.nim");
// nim.openAndDecode();
// nim.printProperties();
// nim.write("new_example.nim");
// }
}
- JavaScript class for opening, decoding, reading, writing, and printing .NIM file properties (Node.js example, using fs module):
const fs = require('fs');
class NIMFile {
static MAGIC = Buffer.from([0x00, 0x00, 0x01, 0xff]);
static properties = [
"Magic number: 0x00 0x00 0x01 0xff (at offset 0)",
"File extension: .nim",
"MIME type: video/vnd.nokia.interleaved-multimedia",
"Content type: Multiplexed audio and video streams",
"Proprietary status: Yes, developed by Nokia",
"Intended device: Nokia 9210 Communicator video player",
"Creation method: Converted from formats like AVI using Nokia Multimedia Converter",
"File system integration: Stored as regular binary files; no special file system attributes beyond standard metadata (e.g., size, timestamps)"
];
constructor(filepath) {
this.filepath = filepath;
this.data = null;
}
openAndDecode() {
const buffer = fs.readFileSync(this.filepath);
const magic = buffer.slice(0, 4);
if (!magic.equals(NIMFile.MAGIC)) {
throw new Error("Invalid .NIM file (magic number mismatch)");
}
this.data = buffer;
}
printProperties() {
NIMFile.properties.forEach(prop => console.log(prop));
}
write(newFilepath) {
if (this.data === null) {
throw new Error("File not opened or decoded yet");
}
fs.writeFileSync(newFilepath, this.data);
}
}
// Example usage:
// const nim = new NIMFile('example.nim');
// nim.openAndDecode();
// nim.printProperties();
// nim.write('new_example.nim');
- C++ class for opening, decoding, reading, writing, and printing .NIM file properties:
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cstring>
class NIMFile {
private:
static const unsigned char MAGIC[4];
static const std::string PROPERTIES[8];
std::string filepath;
std::vector<unsigned char> data;
public:
NIMFile(const std::string& fp) : filepath(fp) {}
void openAndDecode() {
std::ifstream file(filepath, std::ios::binary);
if (!file) {
throw std::runtime_error("Could not open file");
}
unsigned char magic[4];
file.read(reinterpret_cast<char*>(magic), 4);
if (std::memcmp(magic, MAGIC, 4) != 0) {
throw std::runtime_error("Invalid .NIM file (magic number mismatch)");
}
data.assign(magic, magic + 4);
unsigned char byte;
while (file.read(reinterpret_cast<char*>(&byte), 1)) {
data.push_back(byte);
}
file.close();
}
void printProperties() const {
for (const auto& prop : PROPERTIES) {
std::cout << prop << std::endl;
}
}
void write(const std::string& newFilepath) const {
if (data.empty()) {
throw std::runtime_error("File not opened or decoded yet");
}
std::ofstream file(newFilepath, std::ios::binary);
if (!file) {
throw std::runtime_error("Could not write file");
}
file.write(reinterpret_cast<const char*>(data.data()), data.size());
file.close();
}
};
const unsigned char NIMFile::MAGIC[4] = {0x00, 0x00, 0x01, 0xff};
const std::string NIMFile::PROPERTIES[8] = {
"Magic number: 0x00 0x00 0x01 0xff (at offset 0)",
"File extension: .nim",
"MIME type: video/vnd.nokia.interleaved-multimedia",
"Content type: Multiplexed audio and video streams",
"Proprietary status: Yes, developed by Nokia",
"Intended device: Nokia 9210 Communicator video player",
"Creation method: Converted from formats like AVI using Nokia Multimedia Converter",
"File system integration: Stored as regular binary files; no special file system attributes beyond standard metadata (e.g., size, timestamps)"
};
// Example usage:
// int main() {
// try {
// NIMFile nim("example.nim");
// nim.openAndDecode();
// nim.printProperties();
// nim.write("new_example.nim");
// } catch (const std::exception& e) {
// std::cerr << e.what() << std::endl;
// }
// return 0;
// }