sandreas / m4b-tool

m4b-tool is a command line utility to merge, split and chapterize audiobook files such as mp3, ogg, flac, m4a or m4b
MIT License
1.12k stars 79 forks source link

Not using libfdk_aac by default #230

Open LaHaine opened 1 year ago

LaHaine commented 1 year ago

This is with latest-195-g0304329 installed locally on Ubuntu 22.04. My local build of ffmpeg has support for libfdk_aac, but m4b-tool is using aac instead:

./m4b-tool.phar --jobs=4 -vvv  merge *.mp3 --output-file=output.m4b
m4b-tool development, OS: Linux (Ubuntu 22.04.2 LTS \n \l)
'ffmpeg' '-hide_banner' '-version'
ffmpeg version 4.0.0 or higher is required - installed version 1.3.0 is likely to cause errors or unexpected behaviour...
== load input files ==
found 17 files to convert
searching for cover in 
cover not found or not specified
'ffmpeg' '-nostats' '-loglevel' 'panic' '-hide_banner' '-i' 'Critical Mass-Part01.mp3' '-an' '-vcodec' 'copy' 'Critical Mass-Part01.mp3/cover.jpg'
extracting cover to Critical Mass-Part01.mp3/cover.jpg failed - maybe there was no cover embedded in Critical Mass-Part01.mp3
preparing conversion with 4 simultaneous jobs, please wait...
'ffmpeg' '-nostats' '-loglevel' 'panic' '-hide_banner' '-i' 'Critical Mass-Part01.mp3' '-map_metadata' '0' '-max_muxing_queue_size' '9999' '-strict' 'experimental' '-movflags' '+faststart' '-vn' '-ab' '64k' '-ar' '22050' '-ac' '0' '-acodec' 'aac' '-f' 'mp4' 'output-tmpfiles/01-converting.m4b'
'ffmpeg' '-nostats' '-loglevel' 'panic' '-hide_banner' '-i' 'Critical Mass-Part02.mp3' '-map_metadata' '0' '-max_muxing_queue_size' '9999' '-strict' 'experimental' '-movflags' '+faststart' '-vn' '-ab' '64k' '-ar' '22050' '-ac' '0' '-acodec' 'aac' '-f' 'mp4' 'output-tmpfiles/02-converting.m4b'
'ffmpeg' '-nostats' '-loglevel' 'panic' '-hide_banner' '-i' 'Critical Mass-Part03.mp3' '-map_metadata' '0' '-max_muxing_queue_size' '9999' '-strict' 'experimental' '-movflags' '+faststart' '-vn' '-ab' '64k' '-ar' '22050' '-ac' '0' '-acodec' 'aac' '-f' 'mp4' 'output-tmpfiles/03-converting.m4b'
'ffmpeg' '-nostats' '-loglevel' 'panic' '-hide_banner' '-i' 'Critical Mass-Part04.mp3' '-map_metadata' '0' '-max_muxing_queue_size' '9999' '-strict' 'experimental' '-movflags' '+faststart' '-vn' '-ab' '64k' '-ar' '22050' '-ac' '0' '-acodec' 'aac' '-f' 'mp4' 'output-tmpfiles/04-converting.m4b'
  17 remaining /   17 total -^C

My ffmpeg build:


ffmpeg version git-2023-01-01-62da0b4 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.3.0-1ubuntu1~22.04)
  configuration: --prefix=/home/user/ffmpeg_build --extra-cflags=-I/home/user/ffmpeg_build/include --extra-ldflags=-L/home/user/ffmpeg_build/lib --bindir=/home/user/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-nonfree --enable-openssl
  libavutil      57. 43.100 / 57. 43.100
  libavcodec     59. 55.103 / 59. 55.103
  libavformat    59. 34.102 / 59. 34.102
  libavdevice    59.  8.101 / 59.  8.101
  libavfilter     8. 53.100 /  8. 53.100
  libswscale      6.  8.112 /  6.  8.112
  libswresample   4.  9.100 /  4.  9.100
  libpostproc    56.  7.100 / 56.  7.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

It is working fine with the --audio-codec=libfdk_aac option.

LaHaine commented 1 year ago

Same with the docker version, it is also using aac instead of libfdk_aac:


m4b-tool development, OS: Linux (Welcome to Alpine Linux 3.14
Kernel \r on an \m (\l))
'ffmpeg' '-hide_banner' '-version'
== load input files ==
found 17 files to convert
searching for cover in 
cover not found or not specified
'ffmpeg' '-nostats' '-loglevel' 'panic' '-hide_banner' '-i' 'Critical Mass-Part01.mp3' '-an' '-vcodec' 'copy' 'Critical Mass-Part01.mp3/cover.jpg'
extracting cover to Critical Mass-Part01.mp3/cover.jpg failed - maybe there was no cover embedded in Critical Mass-Part01.mp3
preparing conversion with 4 simultaneous jobs, please wait...
'ffmpeg' '-nostats' '-loglevel' 'panic' '-hide_banner' '-i' 'Critical Mass-Part01.mp3' '-map_metadata' '0' '-max_muxing_queue_size' '9999' '-strict' 'experimental' '-movflags' '+faststart' '-vn' '-ab' '64k' '-ar' '22050' '-ac' '0' '-acodec' 'aac' '-f' 'mp4' '/tmp/m4b-tool/01-converting.m4b'
'ffmpeg' '-nostats' '-loglevel' 'panic' '-hide_banner' '-i' 'Critical Mass-Part02.mp3' '-map_metadata' '0' '-max_muxing_queue_size' '9999' '-strict' 'experimental' '-movflags' '+faststart' '-vn' '-ab' '64k' '-ar' '22050' '-ac' '0' '-acodec' 'aac' '-f' 'mp4' '/tmp/m4b-tool/02-converting.m4b'
'ffmpeg' '-nostats' '-loglevel' 'panic' '-hide_banner' '-i' 'Critical Mass-Part03.mp3' '-map_metadata' '0' '-max_muxing_queue_size' '9999' '-strict' 'experimental' '-movflags' '+faststart' '-vn' '-ab' '64k' '-ar' '22050' '-ac' '0' '-acodec' 'aac' '-f' 'mp4' '/tmp/m4b-tool/03-converting.m4b'
'ffmpeg' '-nostats' '-loglevel' 'panic' '-hide_banner' '-i' 'Critical Mass-Part04.mp3' '-map_metadata' '0' '-max_muxing_queue_size' '9999' '-strict' 'experimental' '-movflags' '+faststart' '-vn' '-ab' '64k' '-ar' '22050' '-ac' '0' '-acodec' 'aac' '-f' 'mp4' '/tmp/m4b-tool/04-converting.m4b'
sandreas commented 1 year ago

@LaHaine thanks for reporting - but it is supposed to work like that. The detection is not 100% accurate and libfdk_aac not 100% reliable.

I personally prefer using fdkaac, because ffmpeg sometimes (very rarely) produces bogus files, that do not work in most players. Unfortunately submitting issues is pointless in this case, because the files I used cannot be shared publicly and reproducing would take huge effort without having the files...

Would you be ok, if I update the docs and close the issue?

LaHaine commented 1 year ago

So you wouldn't switch on libfdk_aac by default even in the docker version where you have full control over the ffmpeg build? Your call. But at least this should be documented, as you are recommending to enable libfdk_aac in the docs.