[FFmpeg-cvslog] lavf/mpegenc: Print a warning if ac3, pcm_s16be or dts are muxed into mpeg1.

Carl Eugen Hoyos git at videolan.org
Sun Nov 24 12:39:27 CET 2013


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sun Nov 24 10:37:52 2013 +0100| [e043298cb1b91625ee49e89dcd63916b410bb748] | committer: Carl Eugen Hoyos

lavf/mpegenc: Print a warning if ac3, pcm_s16be or dts are muxed into mpeg1.

Some media players don't play the resulting files.
The warning should help users to avoid the issues described in ticket #1720.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e043298cb1b91625ee49e89dcd63916b410bb748
---

 libavformat/mpegenc.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index 2c7fff2..ccf3ec2 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -346,6 +346,15 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
 
         switch(st->codec->codec_type) {
         case AVMEDIA_TYPE_AUDIO:
+            if (!s->is_mpeg2 &&
+                (st->codec->codec_id == AV_CODEC_ID_AC3 ||
+                 st->codec->codec_id == AV_CODEC_ID_DTS ||
+                 st->codec->codec_id == AV_CODEC_ID_PCM_S16BE))
+                 av_log(ctx, AV_LOG_WARNING,
+                        "%s in MPEG-1 system streams is not widely supported, "
+                        "consider using the vob or the dvd muxer "
+                        "to force a MPEG-2 program stream.\n",
+                        avcodec_get_name(st->codec->codec_id));
             if        (st->codec->codec_id == AV_CODEC_ID_AC3) {
                 stream->id = ac3_id++;
             } else if (st->codec->codec_id == AV_CODEC_ID_DTS) {



More information about the ffmpeg-cvslog mailing list