Opened 4 weeks ago

Last modified 3 weeks ago

#6683 open defect

Transport library initialization error in libfdk_aac when using aac_eld profile

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

Description

Docs show aac_eld as a recognized profile for libfdk_aac.

$ ./ffmpeg -f lavfi -i sine=d=1 -c:a libfdk_aac -profile:a aac_eld -f null -
ffmpeg version N-87351-gc34c0e3a64 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 7.2.0 (GCC)
  configuration: --enable-libfdk_aac --enable-libzimg
  libavutil      55. 76.100 / 55. 76.100
  libavcodec     57.106.101 / 57.106.101
  libavformat    57. 82.101 / 57. 82.101
  libavdevice    57.  8.101 / 57.  8.101
  libavfilter     6.105.100 /  6.105.100
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
Input #0, lavfi, from 'sine=d=1':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
[libfdk_aac @ 0x56324b0d6be0] Unable to initialize the encoder: Transport library initialization error
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

Linked to libfdk-aac 0.1.5.

Seems to work when using fdkaac:

$ ffmpeg -loglevel quiet -f lavfi -i sine=d=1 -f wav - | fdkaac - -b64 -p39 -o out.m4a
00:01.000 (83x)   
44100 samples processed in 00:00.012

Perhaps a problem on our end, but I didn't investigate and didn't try a bisect.

Change History (6)

comment:1 follow-up: Changed 3 weeks ago by cehoyos

Works fine here for an actual encode:

$ ffmpeg -f lavfi -i sine=d=1 -c:a libfdk_aac -profile:a aac_eld out.m4a
ffmpeg version N-87486-gdc522cf Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (GCC)
  configuration: --enable-libfdk-aac
  libavutil      55. 76.100 / 55. 76.100
  libavcodec     57.106.102 / 57.106.102
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57.  9.100 / 57.  9.100
  libavfilter     6.106.100 /  6.106.100
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
Input #0, lavfi, from 'sine=d=1':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
Output #0, ipod, to 'out.m4a':
  Metadata:
    encoder         : Lavf57.83.100
    Stream #0:0: Audio: aac (libfdk_aac) (ELD) (mp4a / 0x6134706D), 44100 Hz, mono, s16, 96 kb/s
    Metadata:
      encoder         : Lavc57.106.102 libfdk_aac
[Parsed_sine_0 @ 0x2c4f380] EOF timestamp not reliable
size=      13kB time=00:00:01.00 bitrate= 107.1kbits/s speed=39.4x
video:0kB audio:12kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 9.392040%

I wonder what your original command line is supposed to do, it succeeds if global headers are requested:

$ ffmpeg -f lavfi -i sine=d=1 -c:a libfdk_aac -profile:a aac_eld -flags +global_header -f null -
ffmpeg version N-87486-gdc522cf Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (GCC)
  configuration: --enable-libfdk-aac
  libavutil      55. 76.100 / 55. 76.100
  libavcodec     57.106.102 / 57.106.102
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57.  9.100 / 57.  9.100
  libavfilter     6.106.100 /  6.106.100
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
Input #0, lavfi, from 'sine=d=1':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
signaling: 2
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf57.83.100
    Stream #0:0: Audio: aac (libfdk_aac) (ELD), 44100 Hz, mono, s16, 96 kb/s
    Metadata:
      encoder         : Lavc57.106.102 libfdk_aac
[Parsed_sine_0 @ 0x3f74440] EOF timestamp not reliable
size=N/A time=00:00:01.00 bitrate=N/A speed=52.1x
video:0kB audio:12kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

comment:2 Changed 3 weeks ago by cehoyos

To get the same error with fdkaac:

$ ffmpeg -loglevel quiet -f lavfi -i sine=d=1 -f wav - | ./fdkaac - -b64 -p39 -f 2 -o out.aac
ERROR: encoder initialization failed

comment:3 Changed 3 weeks ago by cehoyos

  • Component changed from undetermined to avcodec
  • Priority changed from normal to minor
  • Status changed from new to open

comment:4 in reply to: ↑ 1 ; follow-up: Changed 3 weeks ago by llogan

Replying to cehoyos:

I wonder what your original command line is supposed to do

It's to display that there is a problem, but I think you know that and I'm going to guess that your comment is Cehoyosese for "your command is wrong".

Allow me to translate my reply: Am I correct in assuming that your comment is assuming that I am incorrect?

comment:5 in reply to: ↑ 4 Changed 3 weeks ago by cehoyos

Replying to llogan:

Replying to cehoyos:

I wonder what your original command line is supposed to do

It's to display that there is a problem, but I think you know that and I'm going to guess that your comment is Cehoyosese for "your command is wrong".

Allow me to translate my reply: Am I correct in assuming that your comment is assuming that I am incorrect?

No. (On the contrary, my comment meant that I - still - don't know what your original command line is meant to do or show.)
I believe -f null is a very useful debug feature, including for both crashes and performance tests.
Imo, it - generally - can not be used to show that encoding doesn't work though: It never produces any output which in this specific case is exactly the relevant difference: If I use the same options you used for fdkaac (which defaults to -f ipod) with ffmpeg, I get no error. The error you see with -f null can also be reproduced with -f adts which allows to be translated into an fdkaac command line which again shows the identical error - imo indicating the only thing we can fix is being more verbose.

An additional issue is of course that since your command line made the implicit assumption that it always fails for the given profile (esp. because of the comparison with the fdk cli), it took me considerable more time to understand the issue.

comment:6 Changed 3 weeks ago by heleppkes

Carls first comment was correct, you cannot encode AAC-ELD as ADTS, which is the default mode without global header. ADTS does not support the advanced AAC profiles.

If you encode a mp4/m4a file, then global header is set and raw aac is encoded, and ELD should work.

As a consequence, you also cannot encode AAC-ELD into MPEG-TS this way (since that uses ADTS by default). I'm unsure if LATM/LAOS supports these profiles. And you cannot pipe it, since that would also require ADTS.

A better error message would be appropriate.

Last edited 3 weeks ago by heleppkes (previous) (diff)
Note: See TracTickets for help on using tickets.