file in abyss
フォーマット一覧へ戻る

Audio

OGG Ogg Container

VorbisやOpusなどを格納できるコンテナ形式。ページ単位でOggSキャプチャパターンから始まります。

Extensions .ogg, .oga, .ogv
MIME audio/ogg, video/ogg, application/ogg

マジックナンバー

ファイルを解析
オフセット 0 Ogg page capture pattern
4F 67 67 53
OggS

構造

  1. Ogg page header
  2. Segment table
  3. Packet data

注意点

  • OggSだけではVorbis/Opus/Theoraなど格納コーデックまでは判別できません。

判定コード例

SIGNATURE = bytes.fromhex("4f676753")
OFFSET = 0

def is_ogg(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

実践的な使い方

ユースケース

Ogg Container は再生、波形処理、アップロードチェック、再生時間の処理、ビットレート検証などで使われます。短いクリップ・無音・環境音はプレイヤーや変換の境界条件を洗い出すのに役立ちます。

よくある判定ミス

  • .ogg / .oga / .ogv という拡張子だけではファイルの中身を保証できません。アップロードや変換の処理では、拡張子・MIMEタイプ・先頭バイト・形式固有の構造チェックを組み合わせるべきです。
  • Ogg Container は 4F 67 67 53 のようなシグネチャで始まりますが、関連するコンテナや破損ファイルでは追加の検証が必要になる場合があります。

セキュリティ上の注意

メディアファイルも、壊れたメタデータ・極端な寸法・長い再生時間・異常なチャンクでデコーダに負荷をかけることがあります。処理前にサイズ・寸法・長さを読み取ってください。

サンプルの活用

11 個のサンプルで、再生時間の処理・再生開始・メタデータ読み取り・ダウンロード挙動をテストできます。

サンプルファイル

11 / 11 files
Sample Traits Size Source / license / SHA-256
Aud

1s Silence Ogg Opus

1s Silence Ogg Opus is a Ogg Container sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.

silence-1s.ogg
Type Sample
Small file
395 B
Generated CC0 1.0
SHA-256 33b2c6af711336ecaf46c956d3f5bbc919576ea22cceb04f3d50e0f4079ebc47
Download
Aud

Lake Waves OGG 0.25s

Lake Waves OGG 0.25s is a Ogg Container sample based on Wikimedia Commons, 0.25s. It can be used to test downloads, parsers, previews, and file type detection.

01-lake-waves.ogg
Duration 0.25s
Short clip
1.2 KB
SHA-256 8cd34db8b45af5bca3f5a24957fe8a9ddadfe7c611d1d3b14b2094220683f7bb
Download
Aud

Lake Waves OGG 0.5s

Lake Waves OGG 0.5s is a Ogg Container sample based on Wikimedia Commons, 0.5s. It can be used to test downloads, parsers, previews, and file type detection.

02-lake-waves.ogg
Duration 0.5s
Short clip
3.2 KB
SHA-256 983311e4be6fbbba530134835a69e421ca8cdc631bf26c74f2d1a4c456242db3
Download
Aud

Lake Waves OGG 1s

Lake Waves OGG 1s is a Ogg Container sample based on Wikimedia Commons, 1s. It can be used to test downloads, parsers, previews, and file type detection.

03-lake-waves.ogg
Duration 1s
1s media
5.5 KB
SHA-256 1583f8f319620ab5dae086f0a9caeb7e6cf208b5df30ac5387b470b440424a91
Download
Aud

Lake Waves OGG 1.5s

Lake Waves OGG 1.5s is a Ogg Container sample based on Wikimedia Commons, 1.5s. It can be used to test downloads, parsers, previews, and file type detection.

04-lake-waves.ogg
Duration 1.5s
1.5s media
8.7 KB
SHA-256 771cb5be0d3852287972dd1e043fdc35cdf5c24f000df364ec622f7eaf7341e7
Download
Aud

Lake Waves OGG 2s

Lake Waves OGG 2s is a Ogg Container sample based on Wikimedia Commons, 2s. It can be used to test downloads, parsers, previews, and file type detection.

05-lake-waves.ogg
Duration 2s
2s media
11 KB
SHA-256 c89b8764a36ecda854ab4121390e52571c9ee0a90fd1acc39cb60a9cafdd5d70
Download
Aud

Lake Waves OGG 3s

Lake Waves OGG 3s is a Ogg Container sample based on Wikimedia Commons, 3s. It can be used to test downloads, parsers, previews, and file type detection.

06-lake-waves.ogg
Duration 3s
3s media
17 KB
SHA-256 ae80a4a437d92a168508f95bde80c8dc666886d39296e0dffd28e5d08bbbcd03
Download
Aud

Lake Waves OGG 4s

Lake Waves OGG 4s is a Ogg Container sample based on Wikimedia Commons, 4s. It can be used to test downloads, parsers, previews, and file type detection.

07-lake-waves.ogg
Duration 4s
4s media
22 KB
SHA-256 3ee59ef9daca42b9512d42a3fdb6d5e792f1bfcee2b5286b7736cc2f48addb94
Download
Aud

Lake Waves OGG 6s

Lake Waves OGG 6s is a Ogg Container sample based on Wikimedia Commons, 6s. It can be used to test downloads, parsers, previews, and file type detection.

08-lake-waves.ogg
Duration 6s
6s media
35 KB
SHA-256 0f67ae95c91ddbe13455e2cdb81dc3226394fe36eab201fd7fa6bc17867c29cc
Download
Aud

Lake Waves OGG 8s

Lake Waves OGG 8s is a Ogg Container sample based on Wikimedia Commons, 8s. It can be used to test downloads, parsers, previews, and file type detection.

09-lake-waves.ogg
Duration 8s
8s media
44 KB
SHA-256 83c99b7d9b838019b5da0d1134ab3803a5cb2c036581cc37525c5e666cdef23b
Download
Aud

NASA TV Audio OGG

NASA TV Audio OGG is a Ogg Container sample based on NASA Image and Video Library, 2s. It can be used to test downloads, parsers, previews, and file type detection.

nasa-tv-audio.ogg
Duration 2s
2s media
12 KB
SHA-256 8cf72800660ed530575aa9e442bccc793f009fbb7e83bce11e7eb9526accac0b
Download

よくある質問

Ogg Container のマジックナンバー(ファイルシグネチャ)は?

Ogg Container ファイルはバイトシグネチャ 4F 67 67 53 ("OggS") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。

Ogg Container のMIMEタイプは?

Ogg Container のMIMEタイプは audio/ogg, video/ogg, application/ogg です。

Ogg Container の拡張子は?

Ogg Container ファイルは .ogg, .oga, .ogv 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。

関連フォーマット