FFMpeg Mp4 封面艺术在 Windows 上显示,但在 Android 上不显示

FFMpeg Mp4 封面艺术在 Windows 上显示,但在 Android 上不显示

我正在使用以下命令解密有声读物:

ffmpeg -audible_key KEY -audible_iv IV -i book.aax -c copy out.m4b

输出文件在我的 Windows 机器上看起来不错。元数据和封面都存在。但是当我将文件复制到我的 Android 设备时,封面图片没有加载(CX 文件资源管理器和智能有声读物播放器)。音频按预期播放,章节也存在,但没有封面图片。我还尝试过将音频流映射到输出并使用 atomicparsley 添加封面图片,我得到了相同的结果。我试过 -moovflags faststart; 结果相同。此外,如果我将 aax 文件放在我的 Android 设备上并将其扩展名更改为 m4b,封面图片确实会显示出来。

但是,如果我使用以下命令:

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

然后输出文件的封面图片就会显示在 Android 上。但是,由于多种原因,这不是一个理想的解决方案。有什么想法可以让我使用一个 ffmpeg 进程来解密有声读物,同时仍显示封面图片吗?

额外细节:

  • 这似乎只是 44kHz 书籍的问题。我
    用简单命令测试过的所有 22kHz 书籍都运行良好。但这可能只是与文件站点有关。> ~500 MB 封面无法在 Androud 上加载,但较小的文件可以加载。
  • 我也尝试过这个: ffmpeg -i goodfile.m4b -i badfile.m4b -map 0:v -map 1:a -map_metadata 0 -c copy out.m4b,结果输出有同样的问题:Android 上没有封面。音频流有点问题。

以下是两个文件的 ffprobe -show_streams -show_format 的输出。

从第一个命令(不起作用):

  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]

从第二条命令(有效):

      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 版本:

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

答案1

解决了。​​在 aaxc 文件中,AAC-LC 流的音频特定配置 (ASC) 框设置了dependsOnCoreCoder 标志,但 ASC 不够大,无法包含 CoreCoderDelay。当我以第二种方式转换时,ffmpeg 保持了dependsOnCoreCoder 标志的设置,但管道 ffmpeg 命令正确地将该标志设置为 0。

这似乎是一个 ffmpeg 错误。

相关内容