[FFmpeg-devel] [PATCH]Warn all lavf users if ac3 (dts, pcm) is muxed into mpeg-1 system

Michael Niedermayer michaelni at gmx.at
Fri Nov 22 13:26:35 CET 2013


On Fri, Nov 22, 2013 at 12:17:34AM +0100, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached is a second variant of the mpeg-1 system warning patch 
> (as suggested by Michael).
> 

> This still assumes that ac-3 (dts, pcm) in MPEG-1 System is valid, 
> I don't know if this is true.

i cant say without reading mpeg 1 systems and probably various
specs based on top of it that i dont have access to ...
maybe someone else knows ?


> 
> Please comment, Carl Eugen

should be ok


>  mpegenc.c |    9 +++++++++
>  1 file changed, 9 insertions(+)
> dc6eae62a0346a3b1516c31cd995701f1525a982  patchmpegac3-2.diff
> diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
> index 0a9d69b..e4233b4 100644
> --- a/libavformat/mpegenc.c
> +++ b/libavformat/mpegenc.c
> @@ -344,6 +344,15 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
>  
>          switch(st->codec->codec_type) {
>          case AVMEDIA_TYPE_AUDIO:
> +            if (!strcmp(ctx->oformat->name, "mpeg") &&
> +                (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) {

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131122/a3ba70ac/attachment.asc>


More information about the ffmpeg-devel mailing list