MKS
application/octet-stream
Magic Bytes
Offset: 0
1A 45 DF A3
The Matroska Subtitle (MKS) format is an elementary stream container developed by the Matroska project specifically for storing subtitle tracks independently of video or audio data. It primarily serves to encapsulate text-based captions or image overlays within the Extensible Binary Meta Language (EBML) structure. While less common than embedding subtitles directly into standard MKV video files, this specific format allows for the modular distribution of caption data and is supported by most advanced media players.
Validation Code
How to validate .mks files in Python
Python
def is_mks(file_path: str) -> bool:
"""Check if file is a valid MKS by magic bytes."""
signature = bytes([0x1A, 0x45, 0xDF, 0xA3])
with open(file_path, "rb") as f:
return f.read(4) == signature
How to validate .mks files in Node.js
Node.js
function isMKS(buffer: Buffer): boolean {
const signature = Buffer.from([0x1A, 0x45, 0xDF, 0xA3]);
return buffer.subarray(0, 4).equals(signature);
}
Go
func IsMKS(data []byte) bool {
signature := []byte{0x1A, 0x45, 0xDF, 0xA3}
if len(data) < 4 {
return false
}
return bytes.Equal(data[:4], signature)
}
API Endpoint
GET
/api/v1/mks
curl https://filesignature.org/api/v1/mks