Multiplex Theora and Vorbis into Ogg Using FFmpeg

This guide demonstrates how to combine (multiplex) a pre-encoded Theora video track and a Vorbis audio track into a single Ogg container using FFmpeg. You will learn the exact command-line syntax to merge these streams quickly without losing quality through re-encoding, as well as how to handle the process if you need to transcode the source files.

Muxing Existing Theora and Vorbis Streams

If your video file is already encoded in Theora and your audio file is already encoded in Vorbis, you can multiplex them into an Ogg container (typically using the .ogv extension for video) without re-encoding. This process is instant and preserves the original quality of both streams.

Run the following command in your terminal:

ffmpeg -i input_video.theora -i input_audio.vorbis -c:v copy -c:a copy output.ogv

Command Breakdown


Encoding and Muxing in One Step

If your source video and audio files are in different formats (such as an MP4 video and a WAV audio file) and you need to encode them to Theora and Vorbis while multiplexing them into an Ogg container, use this command:

ffmpeg -i input_video.mp4 -i input_audio.wav -c:v libtheora -q:v 6 -c:a libvorbis -q:a 5 output.ogv

Encoding Command Breakdown