1s Color WebM
1s Color WebM is a WebM sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.
color-1s.webmVideo
Web向けのMatroska派生コンテナ。EBMLヘッダの1A 45 DF A3から始まります。
1A 45 DF A3 .E..SIGNATURE = bytes.fromhex("1a45dfa3")
OFFSET = 0
def is_webm(path: str) -> bool:
with open(path, "rb") as f:
f.seek(OFFSET)
head = f.read(len(SIGNATURE))
return head == SIGNATUREconst SIGNATURE = [0x1a, 0x45, 0xdf, 0xa3];
const OFFSET = 0;
// bytes: a Uint8Array / Buffer holding the start of the file
export function isWebm(bytes) {
return SIGNATURE.every((byte, i) => bytes[OFFSET + i] === byte);
}package fileid
import "bytes"
var iswebmSignature = []byte{0x1a, 0x45, 0xdf, 0xa3}
const iswebmOffset = 0
func IsWebm(b []byte) bool {
end := iswebmOffset + len(iswebmSignature)
if len(b) < end {
return false
}
return bytes.Equal(b[iswebmOffset:end], iswebmSignature)
}const SIGNATURE: &[u8] = &[0x1a, 0x45, 0xdf, 0xa3];
const OFFSET: usize = 0;
fn is_webm(bytes: &[u8]) -> bool {
bytes.get(OFFSET..OFFSET + SIGNATURE.len()) == Some(SIGNATURE)
}<?php
$signature = "\x1a\x45\xdf\xa3";
$offset = 0;
function is_webm(string $bytes): bool {
global $signature, $offset;
return substr($bytes, $offset, strlen($signature)) === $signature;
}WebM は動画プレビュー、エンコード確認、レスポンシブUIのテスト、アップロード処理で使われます。コンテナとコーデックは別の問題なので、先頭バイトだけでは再生可否は判断できません。
メディアファイルも、壊れたメタデータ・極端な寸法・長い再生時間・異常なチャンクでデコーダに負荷をかけることがあります。処理前にサイズ・寸法・長さを読み取ってください。
11 個のサンプルで、再生時間の処理・再生開始・メタデータ読み取り・ダウンロード挙動をテストできます。
1s Color WebM is a WebM sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.
color-1s.webmCloud Flight WEBM 0.5s is a WebM sample based on Wikimedia Commons, 160 x 284, 0.5s. It can be used to test downloads, parsers, previews, and file type detection.
01-flight-over-clouds.webm4f8795ff434b987b64523f6aba51be11e304da71d8396ce78ba83dd2bfb098b6Cloud Flight WEBM 1s is a WebM sample based on Wikimedia Commons, 240 x 426, 1s. It can be used to test downloads, parsers, previews, and file type detection.
02-flight-over-clouds.webmdd5b30623c6daa77d60c793b86d973a799140e836c92c4d96610e43e9bc53bd5Cloud Flight WEBM 1.5s is a WebM sample based on Wikimedia Commons, 320 x 568, 1.5s. It can be used to test downloads, parsers, previews, and file type detection.
03-flight-over-clouds.webm0cbdf422385dc969242f6b7b9205c52f3b1f53e1b2aaeb739c2f0ef787b12c2cCloud Flight WEBM 2s is a WebM sample based on Wikimedia Commons, 480 x 854, 2s. It can be used to test downloads, parsers, previews, and file type detection.
04-flight-over-clouds.webm22e8050151f15b8bd26b6d5330f7d78330cf47c989d035599fa09722b2faa84bCloud Flight WEBM 3s is a WebM sample based on Wikimedia Commons, 640 x 1138, 3s. It can be used to test downloads, parsers, previews, and file type detection.
05-flight-over-clouds.webmc3c94f61d6af9ccc72bceedcbc7211fbc0360e6c2210630d65279e9e8af7168dCloud Flight WEBM 4s is a WebM sample based on Wikimedia Commons, 720 x 1280, 4s. It can be used to test downloads, parsers, previews, and file type detection.
06-flight-over-clouds.webme820dd77bbe9618d9d3d3f6fe2813027911e1932faf50363ba5c8f37399cecb8Cloud Flight WEBM 5s is a WebM sample based on Wikimedia Commons, 854 x 1518, 5s. It can be used to test downloads, parsers, previews, and file type detection.
07-flight-over-clouds.webm77c5c24769695148b130924796d6438f2aa6475560a265950ca6304256180a83Cloud Flight WEBM 6s is a WebM sample based on Wikimedia Commons, 960 x 1706, 6s. It can be used to test downloads, parsers, previews, and file type detection.
08-flight-over-clouds.webm94c9fd21e74b0fb6a76654629230bb884486973f356452f39fa4b541bcb7947fCloud Flight WEBM 8s is a WebM sample based on Wikimedia Commons, 1080 x 1920, 8s. It can be used to test downloads, parsers, previews, and file type detection.
09-flight-over-clouds.webmf6ec21e5f4c03c5c14bf6eba1b6e398261a3217d4e35614034bbdc633029c611NASA Clouds WEBM is a WebM sample based on NASA Image and Video Library, 480 x 270, 2s. It can be used to test downloads, parsers, previews, and file type detection.
nasa-clouds-orbit.webmea9f8789a512641c556a43e75a6e1e59324f2e5eddd656dfd047e6ea25f9b063WebM ファイルはバイトシグネチャ 1A 45 DF A3 (".E..") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。
WebM のMIMEタイプは video/webm, audio/webm です。
WebM ファイルは .webm 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。