[FFmpeg-devel] Latest FFMPEG 0.9 Issues

C Chatterjee cchatterj at hotmail.com
Sat Dec 31 06:52:21 CET 2011


Thanks for fixing the aacdec.c bug in item 1 below in an email sent by you earlier.

On item 2 I believe that checking as below:
     else if (enc->codec_id == CODEC_ID_AAC && pkt->size > 2 &&
                (AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
         av_log(s, AV_LOG_ERROR, "malformated aac bitstream, use -absf aac_adtstoasc\n");
         return -1;
may not be necessary because the 2 byte header can be at the start of a payload too.
I have used this stream on a number of players - VLC, Flash and iPhone. All works. 
Is there a case of a player where it does not work.
I comment out the lines above in flvenc.c and movenc.c and use ffmpeg as:

ffmpeg -y -i xx.flv -acodec copy -vcodec -preset superfast -b:v 150k ff.flv
ff.flv works fine on all players I have used.


Date: Fri, 30 Dec 2011 22:21:02 +0100
From: michaelni at gmx.at
To: ffmpeg-devel at ffmpeg.org
Subject: Re: [FFmpeg-devel] Latest FFMPEG 0.9 Issues

On Thu, Dec 29, 2011 at 12:04:23PM -0800, C Chatterjee wrote:
> I have been working with the latest ffmpeg 0.9 release and discovered the following issues which did not exist in the last ffmpeg I have been using from Jan 2011.
> 1. AAC audio decode.
> I have a number of (H264+AAC) sequences which decoded fine but now I get an error in the first packet and works fine from there on. I found the issue in parse_adts_frame_header() function in aacdec.c. The sequence is initialized with ac->m4ac.chan_config = 2. But this function sets it to 0. Hence it fails in aac_decode_frame_int() and produces the following error:
>             if (!(che=get_che(ac, elem_type, elem_id))) {
>                 av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n",
>                        elem_type, elem_id);
>                 return -1;
>             }
> The old ffmpeg initialized ac->m4ac.chan_config to 0 and set it to 2 in the parse_adts_frame_header().
> Commenting out ac->m4ac.chan_config = 0; in parse_adts_frame_header() works great.
can you upload a sample or provide a url of an existing sample with
which this is reproduceable ?
> 2. AAC Encode to flv and mp4/mov
> If the first aac packet has the 2 byte header and payload together, the old ffmpeg encoded it correctly. The new ffmpeg checks for the pkt size to be 2 and errors.
> flvenc.c - flv_write_packet() and 
> movenc.c - ff_mov_write_packet()
> have the following lines of code:
>     else if (enc->codec_id == CODEC_ID_AAC && pkt->size > 2 &&
>                (AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
>         av_log(s, AV_LOG_ERROR, "malformated aac bitstream, use -absf aac_adtstoasc\n");
>         return -1;
> Commenting this out the pkt->size > 2  works great. Otherwise we need to use -absf aac_adtstoasc.
I suspect the files generated without the check are invalid and will
not play on all players. But i may be wrong
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
What does censorship reveal? It reveals fear. -- Julian Assange

ffmpeg-devel mailing list
ffmpeg-devel at ffmpeg.org

More information about the ffmpeg-devel mailing list