I'm decrypting an audible audiobook using this command:
ffmpeg -audible_key KEY -audible_iv IV -i book.aax -c copy out.m4b
The output file seems fine on my Windows machine. Metadata and cover are are present. But when I copy the file to my android device, the cover art isn't loaded (CX File Explorer and Smart Audiobook Player). The audio plays as expected and chapters are present, but no cover art. I've also tried mapping just the audio stream to output and using atomicparsley to add the cover art, and I get the same result. I've tried -moovflags faststart; same result. Also, if I put the aax file on my android device and change its extension to m4b, the cover art DOES show.
But, if I instead use the following command:
ffmpeg -audible_key KEY -audible_iv IV -i book.aax -c:a copy -f adts pipe: | ffmpeg -f aac -i pipe: -i book.aax -map 0:a -map 1:v -map_metadata 1 -c copy out.m4b
Then the output file's cover art DOES show on Android. However, this is a less than ideal solution for several reasons. Any ideas how I can use one ffmpeg process to decrypt the audiobook but still have cover art display?
Additional details:
- This only seems to be a problem on 44kHz book. All 22kHz books I've
tested with the simple command work perfectly. But this could just be related to file site. > ~500 MB the cover are doesn't load on Androud, but smaller files do work. - I've also tried this:
ffmpeg -i goodfile.m4b -i badfile.m4b -map 0:v -map 1:a -map_metadata 0 -c copy out.m4b, and the resulting output has the same problem: no cover art on android. There's something wonky with the audio stream.
Below are the outputs of ffprobe -show_streams -show_format on both files.
From First command (not working):
Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
handler_name : ?Apple Sound Media Handler
vendor_id : [0][0][0][0]
Stream #0:1(eng): Data: bin_data (text / 0x74786574)
Metadata:
handler_name : SubtitleHandler
Stream #0:2: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 500x500 [SAR 1:1 DAR 1:1], 90k tbr, 90k tbn, 90k tbc (attached pic)
Unsupported codec with id 100359 for input stream 1
[STREAM]
index=0
codec_name=aac
codec_long_name=AAC (Advanced Audio Coding)
profile=LC
codec_type=audio
codec_tag_string=mp4a
codec_tag=0x6134706d
sample_fmt=fltp
sample_rate=44100
channels=2
channel_layout=stereo
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/44100
start_pts=0
start_time=0.000000
duration_ts=1744992092
duration=39568.981678
bit_rate=125588
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=1704094
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=eng
TAG:handler_name=↓Apple Sound Media Handler
TAG:vendor_id=[0][0][0][0]
[/STREAM]
[STREAM]
index=1
codec_name=bin_data
codec_long_name=binary data
profile=unknown
codec_type=data
codec_tag_string=text
codec_tag=0x74786574
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/1000
start_pts=0
start_time=0.000000
duration_ts=39568982
duration=39568.982000
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=27
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=eng
TAG:handler_name=SubtitleHandler
[/STREAM]
[STREAM]
index=2
codec_name=mjpeg
codec_long_name=Motion JPEG
profile=Baseline
codec_type=video
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=500
height=500
coded_width=500
coded_height=500
closed_captions=0
has_b_frames=0
sample_aspect_ratio=1:1
display_aspect_ratio=1:1
pix_fmt=yuvj420p
level=-99
color_range=pc
color_space=bt470bg
color_transfer=unknown
color_primaries=unknown
chroma_location=center
field_order=unknown
refs=1
id=N/A
r_frame_rate=90000/1
avg_frame_rate=0/0
time_base=1/90000
start_pts=0
start_time=0.000000
duration_ts=3561208380
duration=39568.982000
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=1
DISPOSITION:timed_thumbnails=0
[/STREAM]
[FORMAT]
filename=Out.m4b
nb_streams=3
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=0.000000
duration=39568.982000
size=628025322
bit_rate=126973
probe_score=100
TAG:major_brand=M4A
TAG:minor_version=512
TAG:compatible_brands=M4A isomiso2
TAG:title=The Martian (Unabridged)
TAG:artist=Andy Weir
TAG:album_artist=Andy Weir
TAG:album=The Martian (Unabridged)
TAG:date=2020
TAG:encoder=Lavf58.76.100
TAG:comment=Six days ago, astronaut Mark Watney became one of the first people to walk on Mars. Now, he's sure he'll be the first person to die there. After a dust storm nearly kills him and forces his crew to evacuate while thinking him dead, Mark finds himself stranded....
TAG:genre=Audiobook
TAG:copyright=©2011, 2014, 2019 by Andy Weir;(P)2019 Audible, Inc.
[/FORMAT]
From Second command (working):
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
creation_time : 2019-12-18T12:58:20.000000Z
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream #0:1(eng): Data: bin_data (text / 0x74786574)
Metadata:
creation_time : 2019-12-18T12:58:20.000000Z
handler_name : SubtitleHandler
Stream #0:2: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 500x500 [SAR 1:1 DAR 1:1], 90k tbr, 90k tbn, 90k tbc (attached pic)
Unsupported codec with id 100359 for input stream 1
[STREAM]
index=0
codec_name=aac
codec_long_name=AAC (Advanced Audio Coding)
profile=LC
codec_type=audio
codec_tag_string=mp4a
codec_tag=0x6134706d
sample_fmt=fltp
sample_rate=44100
channels=2
channel_layout=stereo
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/44100
start_pts=0
start_time=0.000000
duration_ts=1744992256
duration=39568.985397
bit_rate=125588
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=1704094
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:creation_time=2019-12-18T12:58:20.000000Z
TAG:language=und
TAG:handler_name=SoundHandler
TAG:vendor_id=[0][0][0][0]
[/STREAM]
[STREAM]
index=1
codec_name=bin_data
codec_long_name=binary data
profile=unknown
codec_type=data
codec_tag_string=text
codec_tag=0x74786574
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/1000
start_pts=0
start_time=0.000000
duration_ts=39568982
duration=39568.982000
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=27
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:creation_time=2019-12-18T12:58:20.000000Z
TAG:language=eng
TAG:handler_name=SubtitleHandler
[/STREAM]
[STREAM]
index=2
codec_name=mjpeg
codec_long_name=Motion JPEG
profile=Baseline
codec_type=video
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=500
height=500
coded_width=500
coded_height=500
closed_captions=0
has_b_frames=0
sample_aspect_ratio=1:1
display_aspect_ratio=1:1
pix_fmt=yuvj420p
level=-99
color_range=pc
color_space=bt470bg
color_transfer=unknown
color_primaries=unknown
chroma_location=center
field_order=unknown
refs=1
id=N/A
r_frame_rate=90000/1
avg_frame_rate=0/0
time_base=1/90000
start_pts=0
start_time=0.000000
duration_ts=3561208740
duration=39568.986000
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=1
DISPOSITION:timed_thumbnails=0
[/STREAM]
[FORMAT]
filename=out.m4b
nb_streams=3
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=0.000000
duration=39568.986000
size=628025821
bit_rate=126973
probe_score=100
TAG:major_brand=M4A
TAG:minor_version=512
TAG:compatible_brands=M4A isomiso2
TAG:creation_time=2019-12-18T12:58:20.000000Z
TAG:title=The Martian (Unabridged)
TAG:artist=Andy Weir
TAG:album_artist=Andy Weir
TAG:album=The Martian (Unabridged)
TAG:date=2020
TAG:encoder=Lavf58.76.100
TAG:comment=Six days ago, astronaut Mark Watney became one of the first people to walk on Mars. Now, he's sure he'll be the first person to die there. After a dust storm nearly kills him and forces his crew to evacuate while thinking him dead, Mark finds himself stranded....
TAG:genre=Audiobook
TAG:copyright=©2011, 2014, 2019 by Andy Weir;(P)2019 Audible, Inc.
[/FORMAT]
FFMpeg Versiom:
ffprobe version n4.4-19-g8d172d9409 Copyright (c) 2007-2021 the FFmpeg developers
built with gcc 10-win32 (GCC) 20210408
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-version3 --disable-debug --enable-shared --disable-static --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libvmaf --enable-vulkan --enable-amf --enable-libaom --disable-avisynth --enable-libdav1d --disable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --enable-libglslang --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --disable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libvidstab --disable-libx264 --disable-libx265 --disable-libxavs2 --disable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
Simple multimedia streams analyzer