1s Color MP4
1s Color MP4 is a MPEG-4 Part 14 sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.
color-1s.mp4Video
Web動画で広く使われるISO BMFFベースのコンテナ形式。通常は4バイト目からftyp box typeが現れます。
66 74 79 70 ftypSIGNATURE = bytes.fromhex("66747970")
OFFSET = 4
def is_mp4(path: str) -> bool:
with open(path, "rb") as f:
f.seek(OFFSET)
head = f.read(len(SIGNATURE))
return head == SIGNATUREconst SIGNATURE = [0x66, 0x74, 0x79, 0x70];
const OFFSET = 4;
// bytes: a Uint8Array / Buffer holding the start of the file
export function isMp4(bytes) {
return SIGNATURE.every((byte, i) => bytes[OFFSET + i] === byte);
}package fileid
import "bytes"
var ismp4Signature = []byte{0x66, 0x74, 0x79, 0x70}
const ismp4Offset = 4
func IsMp4(b []byte) bool {
end := ismp4Offset + len(ismp4Signature)
if len(b) < end {
return false
}
return bytes.Equal(b[ismp4Offset:end], ismp4Signature)
}const SIGNATURE: &[u8] = &[0x66, 0x74, 0x79, 0x70];
const OFFSET: usize = 4;
fn is_mp4(bytes: &[u8]) -> bool {
bytes.get(OFFSET..OFFSET + SIGNATURE.len()) == Some(SIGNATURE)
}<?php
$signature = "\x66\x74\x79\x70";
$offset = 4;
function is_mp4(string $bytes): bool {
global $signature, $offset;
return substr($bytes, $offset, strlen($signature)) === $signature;
}MPEG-4 Part 14 は動画プレビュー、エンコード確認、レスポンシブUIのテスト、アップロード処理で使われます。コンテナとコーデックは別の問題なので、先頭バイトだけでは再生可否は判断できません。
メディアファイルも、壊れたメタデータ・極端な寸法・長い再生時間・異常なチャンクでデコーダに負荷をかけることがあります。処理前にサイズ・寸法・長さを読み取ってください。
11 個のサンプルで、再生時間の処理・再生開始・メタデータ読み取り・ダウンロード挙動をテストできます。
1s Color MP4 is a MPEG-4 Part 14 sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.
color-1s.mp4Cloud Flight MP4 0.5s is a MPEG-4 Part 14 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.mp43124ee6bdaa1142bdbc2ebf477978400df31a7fcabf0562affb499de8c290f5eCloud Flight MP4 1s is a MPEG-4 Part 14 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.mp4d11350777aacf7aa8c3364c7ca3f0989b287296b5671359dfca3287618142915Cloud Flight MP4 1.5s is a MPEG-4 Part 14 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.mp4fa15aeb91a3c364ab3b5b6092182fe0c4e80b2a7b8e771f93bb2cac91e7755d5Cloud Flight MP4 2s is a MPEG-4 Part 14 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.mp423afe1e134a5aeaa69a47431901cd19de3ebc43fc92b4cc1d604aad8ac46c7d6Cloud Flight MP4 3s is a MPEG-4 Part 14 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.mp4f3a3c73d5b310686bdd689e6a132f3cff37259005500e9442c67af3aa1f3b104Cloud Flight MP4 4s is a MPEG-4 Part 14 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.mp4d22be9a592f3ca948c729150f45d5d2b83da9ff01a9cd8fb7b082a9daa9561c6Cloud Flight MP4 5s is a MPEG-4 Part 14 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.mp41858f74816bb37cf927db55f8e4cfc38ca55335575647fcf00a25bec3f23f7afCloud Flight MP4 6s is a MPEG-4 Part 14 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.mp4a72e5fc64521419d8e95b825f1542df2c1d13c1730fa36594156030dd4b854c7Cloud Flight MP4 8s is a MPEG-4 Part 14 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.mp4720bb0e33645c5adca2ef6f89ebd71dfecd4493c355c880842cf97ac9c348801NASA Clouds MP4 is a MPEG-4 Part 14 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.mp4f9c04946c8e8510a5acca1db961cfa14839a7d8e95dfc6157b93f824fc001e8eMPEG-4 Part 14 ファイルはバイトシグネチャ 66 74 79 70 ("ftyp") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。
MPEG-4 Part 14 のMIMEタイプは video/mp4 です。
MPEG-4 Part 14 ファイルは .mp4, .m4v 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。