[FFmpeg-devel] [PATCH]Warn the user when trying to mux ac3 in mpeg-1 stream

Carl Eugen Hoyos cehoyos at ag.or.at
Thu Nov 21 12:22:15 CET 2013


Hi!

WMP (and mplayer -demuxer mpegps) refuse to read ac3 in MPEG-1 streams, both 
work fine with -f vob and -f dvd.

Trying to address ticket #1720

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/ffmpeg.c b/ffmpeg.c
index 5eb395f..74c0964 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2189,6 +2189,12 @@ static int transcode_init(void)
                 if (codec->codec_type == AVMEDIA_TYPE_AUDIO || codec->codec_type == AVMEDIA_TYPE_VIDEO)
                     ost->st->disposition = AV_DISPOSITION_DEFAULT;
         }
+        if (!strcmp(oc->oformat->name, "mpeg") &&
+            ( ost->stream_copy && icodec->codec_id == AV_CODEC_ID_AC3 ||
+             !ost->stream_copy && ost->enc && !strcmp(ost->enc->name, "ac3")))
+            av_log(NULL, AV_LOG_WARNING,
+                   "ac3 in MPEG-1 system streams is not widely supported, "
+                   "consider using -f vob or -f dvd to force MPEG-2 program stream.\n");
 
         if (ost->stream_copy) {
             AVRational sar;


More information about the ffmpeg-devel mailing list