[FFmpeg-devel] [PATCH] mpegtsenc: Support AAC packet which does not contain extradata

Hendrik Leppkes h.leppkes at gmail.com
Mon Nov 23 01:18:40 CET 2015


Am 22.11.2015 22:50 schrieb "Hagen Schmidt" <schmidthagen at googlemail.com>:
>
> extradata_size is checked by adts_write_header().
> Fixes ticket 279.
> ---
>  libavformat/mpegtsenc.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
> index 468bad4..b1ac627 100644
> --- a/libavformat/mpegtsenc.c
> +++ b/libavformat/mpegtsenc.c
> @@ -809,8 +809,7 @@ static int mpegts_write_header(AVFormatContext *s)
>              service->pcr_pid = ts_st->pid;
>              pcr_st           = st;
>          }
> -        if (st->codec->codec_id == AV_CODEC_ID_AAC &&
> -            st->codec->extradata_size > 0) {
> +        if (st->codec->codec_id == AV_CODEC_ID_AAC) {
>              AVStream *ast;
>              ts_st->amux = avformat_alloc_context();
>              if (!ts_st->amux) {
> @@ -1490,8 +1489,7 @@ static int
mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
>              AVPacket pkt2;
>
>              if (!ts_st->amux) {
> -                av_log(s, AV_LOG_ERROR, "AAC bitstream not in ADTS
format "
> -                                        "and extradata missing\n");
> +                av_log(s, AV_LOG_ERROR, "AAC bitstream not in ADTS
format\n");
>                  if (!st->nb_frames)
>                      return AVERROR_INVALIDDATA;
>              } else {
> --
> 2.6.2
>

This seems wrong when the bitstream already is adts, the adts muxer isn't
needed then, and when remuxing aac from mpegts to mpegts, it should be adts
without extradata, shouldn't it.


More information about the ffmpeg-devel mailing list