Ogg
Ogg is Xiph.Org’s open container. Today it is mostly used for audio: Opus in a .opus file is the most common case, followed by Vorbis, FLAC and Speex. It can also hold Theora video, but nobody should start a new video project on that combination.
Extensions
Section titled “Extensions”| Extension | Contents |
|---|---|
.opus | Opus audio in Ogg (the recommended extension for Opus) |
.ogg | Historically Vorbis; now ambiguous, can be Opus, FLAC or video |
.oga | Ogg audio, any codec |
.ogv | Ogg video, normally Theora + Vorbis |
.spx | Speex |
The extension does not say which codec is inside; ffprobe does.
| Relationship | Project or format | Evidence and scope | Status |
|---|---|---|---|
| Carried By by | Opus | Ogg Opus uses OpusHead and OpusTags headers with 48 kHz granule-position semantics.Scope: Container Mapping · Sources: RFC 7845: Ogg Encapsulation for the Opus Audio Codec | Normative |
Make Ogg files
Section titled “Make Ogg files”ffmpeg -i input.flac -c:a libopus -b:a 128k output.opusffmpeg -i input.flac -c:a libvorbis -q:a 5 output.oggffmpeg -i input.mkv -c:v libtheora -q:v 7 -c:a libvorbis -q:a 5 output.ogvOpus is the better modern choice; see Opus for bitrates. Moving an existing Opus stream between Ogg and MP4/MKV is lossless: ffmpeg -i input.mp4 -c copy output.opus. Ogg cannot hold AAC, MP3 or H.264 (FFmpeg rejects them), so converting from those means re-encoding.
For standalone Opus encoding, opusenc from opus-tools writes Ogg Opus directly and can embed cover art with --picture.
Properties of Ogg
Section titled “Properties of Ogg”- Streaming-first design. Ogg is made of self-contained pages with no global index, so it can be written live and chained (several files concatenated into one stream). Seeking works by bisection, which is fast for audio and sloppy for video.
- Metadata is stored as Vorbis-style comments (
ARTIST=,TITLE=…). Opus addsR128_TRACK_GAINandR128_ALBUM_GAINfor loudness; players apply the header’s output gain and these tags. Edit tags withopustags,vorbiscommentorffmpeg -metadata. - Opus timing. An Ogg Opus stream always decodes at 48 kHz, whatever the input rate, and carries a pre-skip value the decoder discards so the first sample lines up. That is why
ffprobeshowssample_rate=48000for any.opus. - Overhead. Ogg’s page structure costs a bit more than MKV or MP4 for the same stream, which is small next to Opus bitrates.
Support
Section titled “Support”Ogg Opus and Vorbis play in Chrome, Firefox, VLC, mpv, Android and most Linux and Windows players. Safari added Ogg support for Opus and Vorbis in 18.4 (March 2025, on macOS 15.4, iOS/iPadOS 18.4 and visionOS 2.4); older Apple software cannot play .opus files without help. For maximum compatibility, deliver MP4 with AAC, or an Opus-in-MP4/WebM file where the player supports it.