Thank you very much but it didn't work. I double checked it and i did exactly you wrote. The result is same..
$ ffmpeg -acodec libfaad -i heye.aac hey.wav FFmpeg version SVN-r20073, Copyright (c) 2000-2009 Fabrice Bellard, et al. built on Sep 29 2009 11:51:12 with gcc 4.0.1 (Apple Inc. build 5493) configuration: --enable-cross-compile --disable-mmx --disable-mmx2 --disable-ssse3 --enable-libfaad --enable-gpl --disable-ffserver --enable-static --disable-shared --disable-iwmmxt --disable-armvfp --disable-armv5te --disable-neon --disable-ffplay --disable-armvfp --enable-avfilter --enable-libfaac --enable-nonfree 2009/9/29 avcoder <[email protected]>: > On Tue, Sep 29, 2009 at 3:51 PM, jacob jacob <[email protected]> wrote: > >> I have two questions >> >> >> 2) ffmpeg does not multiply sample rate of lc aac sbr, so final file >> plays in slow motion (22050 instead of 44100). ( note: faad itself >> perfectly converts and multiplys it by just itself out of ffmpeg ). >> How to solve this problem for ffmpeg? >> > > I hacked ffmpeg as following : > > @ libavformat/utils.c > > Index: utils.c > =================================================================== > --- utils.c (revision 83) > +++ utils.c (working copy) > @@ -1896,6 +1896,12 @@ > enc->codec_id == CODEC_ID_AAC || > enc->codec_id == CODEC_ID_SPEEX)) > return 0; > + /* MUST decode some frames to fix SBR upsampling or > downsampling issue */ > + if(enc->codec_id == CODEC_ID_AAC && enc->sample_rate && !enc- >>codec){ > > + enc->sample_rate = 0; > + enc->channels = 0; > + return 0; > + } > break; > case CODEC_TYPE_VIDEO: > val = enc->width && enc->pix_fmt != PIX_FMT_NONE; > > //@ libavcodec/aac_ac3_parser.c > > Index: aac_ac3_parser.c > =================================================================== > --- aac_ac3_parser.c (revision 83) > +++ aac_ac3_parser.c (working copy) > @@ -71,7 +71,12 @@ > *poutbuf_size = buf_size; > > /* update codec info */ > - avctx->sample_rate = s->sample_rate; > + /* we do not override AAC sample_rate because SBR+PS issue */ > + if(avctx->codec_id == CODEC_ID_AAC){ > + if(!avctx->sample_rate) > + avctx->sample_rate = s->sample_rate; > + }else > + avctx->sample_rate = s->sample_rate; > if(s->codec_id) > avctx->codec_id = s->codec_id; > > @@ -84,7 +89,12 @@ > avctx->codec_id == CODEC_ID_EAC3)))) { > avctx->channels = avctx->request_channels; > } else if (avctx->codec_id != CODEC_ID_AAC || s->channels) { > - avctx->channels = s->channels; > + /* we do not override AAC channels because SBR+PS issue */ > + if(avctx->codec_id == CODEC_ID_AAC){ > + if(!avctx->channels) > + avctx->channels = s->channels; > + }else > + avctx->channels = s->channels; > avctx->channel_layout = s->channel_layout; > } > avctx->bit_rate = s->bit_rate; > > -- > ----------------------------------------------------------------------------------------- > My key fingerprint: d1:03:f5:32:26:ff:d7:3c:e4:42:e3:51:ec:92:78:b2 > Inspired by http://www.nextplayer.net. Your potential. Our passion. > _______________________________________________ > libav-user mailing list > [email protected] > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
