When using -acodec libfaac, some encodes fail. I believe it's when the audio track is first. Output when it fails: FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al. configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --enable-static --enable-shared --cc=i686-pc-linux-gnu-gcc --disable-debug --enable-libfaac --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-libxvid --enable-libdc1394 --disable-demuxer=alsa --disable-demuxer=oss --disable-muxer=alsa --disable-muxer=oss --enable-pthreads --enable-libfaad --enable-libdirac --enable-libschroedinger --enable-libspeex --enable-libopenjpeg --enable-libgsm --enable-libamr-nb --enable-libamr-wb --enable-nonfree --disable-altivec --cpu=prescott --enable-gpl --enable-postproc --enable-avfilter --enable-avfilter-lavf --enable-swscale --disable-stripping --enable-hardcoded-tables libavutil 49.15. 0 / 49.15. 0 libavcodec 52.20. 0 / 52.20. 0 libavformat 52.31. 0 / 52.31. 0 libavdevice 52. 1. 0 / 52. 1. 0 libavfilter 0. 4. 0 / 0. 4. 0 libswscale 0. 7. 1 / 0. 7. 1 libpostproc 51. 2. 0 / 51. 2. 0 built on Mar 17 2009 18:45:37, gcc: 4.2.4 (Gentoo 4.2.4-r1 p1.1) Seems stream 1 codec frame rate differs from container frame rate: 59.94 (60000/1001) -> 29.97 (30000/1001) Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/obt/repos/sesame/sv/files/media/e1dc259a-804e-11de-b569-00163e681479/file.mp4': Duration: 00:04:32.87, start: 0.000000, bitrate: 9573 kb/s Stream #0.0(eng): Audio: aac, 44100 Hz, stereo, s16 Stream #0.1(eng): Video: h264, yuv420p, 640x480, 29.97 tbr, 29.97 tbn, 59.94 tbc Output #0, mp4, to '/home/obt/repos/sesame/sv/files/media/e1dc259a-804e-11de-b569-00163e681479/ipod5gen-20090803080808/file.mp4.mp4': Stream #0.0(eng): Video: libx264, yuv420p, 320x240, q=2-35, 235 kb/s, 90k tbn, 29.97 tbc Stream #0.1(eng): Audio: libfaac, 48000 Hz, stereo, s16, 128 kb/s Stream mapping: Stream #0.1 -> #0.0 Stream #0.0 -> #0.1 [libx264 @ 0x8091f90]using cpu capabilities: MMX2 SSE2Fast SSSE3 PHADD SSE4.1 Cache64 [libx264 @ 0x8091f90]max bitrate less than average bitrate, ignored. [libx264 @ 0x8091f90]profile Baseline, level 1.3 Press [q] to stop encoding [aac @ 0x80805f0]channel element 1.1 is not allocated Error while decoding stream #0.0 Error while decoding stream #0.0 Error while decoding stream #0.0 Error while decoding stream #0.0 Error while decoding stream #0.0 Error while decoding stream #0.0 ... The line that is the culprit is: [aac @ 0x80805f0]channel element 1.1 is not allocated ... this is a miscommunication in FFmpeg using libfaac -- the channel element being addressed should be 0.1, and not 1.1 to match the scanned streams. This issue was resolved upstream in svn r17856: https://roundup.ffmpeg.org/roundup/ffmpeg/issue800 ... sadly, it looks like it was fixed at almost exactly the same time that 0.5 was released. I've created a patch from the commit diff. It fixes the problems. I've tested on known good and known bad files with AAC audio transcoding to AAC audio. Reproducible: Always ... adding patch after creating ticket.
Created attachment 200171 [details, diff] Patch the fixes AAC related channel ordering issue.
Created attachment 200173 [details, diff] Adds a src_unpack to ffmpeg ebuild where patch is applied.
I've put a new ffmpeg snapshot from trunk in the tree. This bug should be fixed, though the ebuild is still masked until we take care of the few build failures that this upgrade causes.