Opened 21 months ago

Closed 20 months ago

Last modified 19 months ago

#9866 closed defect (fixed)

Audiotoolbox AAC not working anymore

Reported by: Atarikid Owned by:
Priority: important Component: avcodec
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Atarikid)

The point release 5.1 and up to the latest daily build, there are a lot of issues when using Audiotoolbox and encoding to AAC.

Atarikid@MacBook-Pro ~ % FFmpeg -i /Users/Atarikid/Desktop/Royale.mp4 -map 0:0 -map 0:1 -c:a aac_at -c:v libx264 -y /Users/Atarikid/Movies/Test.mp4
ffmpeg version 5.1 Copyright (c) 2000-2022 the FFmpeg developers

built with Apple clang version 13.0.0 (clang-1300.0.29.30)
configuration: --prefix=/Volumes/tempdisk/sw --extra-cflags=-fno-stack-check --arch=arm64 --cc=/usr/bin/clang --enable-gpl --enable-libopenjpeg --enable-libopus --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libvpx --enable-libwebp --enable-libass --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libsnappy --enable-libaom --enable-libvidstab --enable-libzimg --enable-libsvtav1 --enable-version3 --pkg-config-flags=--static --disable-ffplay --enable-postproc --enable-nonfree --enable-neon --enable-runtime-cpudetect --disable-indev=qtkit --disable-indev=x11grab_xcb
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/Atarikid/Desktop/Royale.mp4':

Metadata:

major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.36.100

Duration: 00:02:34.55, start: 0.000000, bitrate: 1649 kb/s
Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/bt709, progressive), 720x426 [SAR 64:45 DAR 512:213], 1260 kb/s, SAR 1775:1248 DAR 125:52, 24.99 fps, 25 tbr, 90k tbn (default)

Metadata:

handler_name : VideoHandler
vendor_id : [0][0][0][0]

Stream #0:1[0x2](eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 384 kb/s (default)

Metadata:

handler_name : SoundHandler
vendor_id : [0][0][0][0]

Side data:

audio service type: main

Stream mapping:

Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (ac3 (native) -> aac (aac_at))

Press [q] to stop, ? for help
[aac_at @ 0x144f06f50] Bitrate 128000 not allowed; changing to 160000
Assertion ret <= 0 failed at libavcodec/encode.c:220
zsh: abort FFmpeg -i

For some odd reason it says bitrate 128000 is not allowed and it should change it automatically to 160000.
But it drops an error and stops.
Now when I add -ab 160k, I get this error:

Atarikid@MacBook-Pro ~ % FFmpeg -i /Users/Atarikid/Desktop/Royale.mp4 -map 0:0 -map 0:1 -c:a aac_at -ab 160k -c:v libx264 -y /Users/Atarikid/Movies/test.mp4
ffmpeg version 5.1 Copyright (c) 2000-2022 the FFmpeg developers

built with Apple clang version 13.0.0 (clang-1300.0.29.30)
configuration: --prefix=/Volumes/tempdisk/sw --extra-cflags=-fno-stack-check --arch=arm64 --cc=/usr/bin/clang --enable-gpl --enable-libopenjpeg --enable-libopus --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libvpx --enable-libwebp --enable-libass --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libsnappy --enable-libaom --enable-libvidstab --enable-libzimg --enable-libsvtav1 --enable-version3 --pkg-config-flags=--static --disable-ffplay --enable-postproc --enable-nonfree --enable-neon --enable-runtime-cpudetect --disable-indev=qtkit --disable-indev=x11grab_xcb
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/Atarikid/Desktop/Royale.mp4':

Metadata:

major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.36.100

Duration: 00:02:34.55, start: 0.000000, bitrate: 1649 kb/s
Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/bt709, progressive), 720x426 [SAR 64:45 DAR 512:213], 1260 kb/s, SAR 1775:1248 DAR 125:52, 24.99 fps, 25 tbr, 90k tbn (default)

Metadata:

handler_name : VideoHandler
vendor_id : [0][0][0][0]

Stream #0:1[0x2](eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 384 kb/s (default)

Metadata:

handler_name : SoundHandler
vendor_id : [0][0][0][0]

Side data:

audio service type: main

Stream mapping:

Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (ac3 (native) -> aac (aac_at))

Press [q] to stop, ? for help
Assertion ret <= 0 failed at libavcodec/encode.c:220
zsh: abort FFmpeg -i

This is working with 5.0.1 - but not with 5.1 up to the daily build of today.

Change History (4)

comment:1 by Atarikid, 21 months ago

Additional information:

AAC_AT needs for channel count of 3 and higher (for example 5.1) at least 160k (this is a restriction of VideoToolBox).
When the source has a less than 160kbs audiobitrate or -ab is less than 160kbs the error pops up.
With FFmpeg 5.0.1 and older, it gives a correct warning but does continue with a bitrate of 160k - this is the correct way.
With 5.1 (and latest daily build) it chokes as seen above.

Also, using -ab 160k or -ab 160000 it is not working either. But -ab 160001 is working fine. So something to look at too.

comment:2 by Atarikid, 21 months ago

Description: modified (diff)
Summary: Videotoolbox AAC not working anymoreAudiotoolbox AAC not working anymore

comment:3 by Steven Liu, 20 months ago

Resolution: fixed
Status: newclosed

comment:4 by Carl Eugen Hoyos, 19 months ago

Component: undeterminedavcodec
Note: See TracTickets for help on using tickets.