[FFmpeg-devel] [PATCH 3/4] avformat/oggenc: make Vorbis audio the only default for ogg muxer

James Almer jamrial at gmail.com
Thu Jul 7 02:25:26 EEST 2016


While not enforced, RFC 5334 mentions that the .ogg extension should
be used for Vorbis audio files only.

Signed-off-by: James Almer <jamrial at gmail.com>
---
This patch turns the ogg muxer into an audio only muxer to follow
the RFC's recommendation. The next patch in the set adds a new ogv
muxer to properly deal with video files.

I doubt anyone out there tries to mux theora video using the .ogg
extension (even ffmpeg2theora seems to default to .ogv), so it's
unlikely it will affect people's normal workflow.
But if someone is against it then this patch can either be dropped
or changed to only remove flac from the defaults. That way video
can still be muxed.

I personally prefer to apply this patch as is, though.

 libavformat/oggenc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index fee4c7f..2dcab15 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -669,9 +669,7 @@ AVOutputFormat ff_ogg_muxer = {
 #endif
                          ,
     .priv_data_size    = sizeof(OGGContext),
-    .audio_codec       = CONFIG_LIBVORBIS_ENCODER ?
-                         AV_CODEC_ID_VORBIS : AV_CODEC_ID_FLAC,
-    .video_codec       = AV_CODEC_ID_THEORA,
+    .audio_codec       = AV_CODEC_ID_VORBIS,
     .write_header      = ogg_write_header,
     .write_packet      = ogg_write_packet,
     .write_trailer     = ogg_write_trailer,
-- 
2.9.0



More information about the ffmpeg-devel mailing list