Skip to content

Ogg

current

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.

ExtensionContents
.opusOpus audio in Ogg (the recommended extension for Opus)
.oggHistorically Vorbis; now ambiguous, can be Opus, FLAC or video
.ogaOgg audio, any codec
.ogvOgg video, normally Theora + Vorbis
.spxSpeex

The extension does not say which codec is inside; ffprobe does.

Codecs documented for Ogg on this wiki
RelationshipProject or formatEvidence and scopeStatus
Carried By byOpusOgg Opus uses OpusHead and OpusTags headers with 48 kHz granule-position semantics.Scope: Container Mapping · Sources: RFC 7845: Ogg Encapsulation for the Opus Audio CodecNormative
Terminal window
ffmpeg -i input.flac -c:a libopus -b:a 128k output.opus
ffmpeg -i input.flac -c:a libvorbis -q:a 5 output.ogg
ffmpeg -i input.mkv -c:v libtheora -q:v 7 -c:a libvorbis -q:a 5 output.ogv

Opus 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.

  • 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 adds R128_TRACK_GAIN and R128_ALBUM_GAIN for loudness; players apply the header’s output gain and these tags. Edit tags with opustags, vorbiscomment or ffmpeg -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 ffprobe shows sample_rate=48000 for 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.

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.