我想知道是否可以使用 ffmpeg 将嵌入艺术作品的音频文件转换为 MP3 并保存艺术作品?我在我的服务器上安装了 ffmpeg,并且转换为 MP3 工作正常,包括除嵌入式艺术品之外的所有元数据。
谢谢,
尼克
最佳答案
FFmpeg 可以处理嵌入在 mp3 中的艺术作品。来自 the docs on mp3 :
The muxer supports writing ID3v2 attached pictures (APIC frames). The pictures are supplied to the muxer in form of a video stream with a single packet. There can be any number of those streams, each will correspond to a single APIC frame. The stream metadata tags title and comment map to APIC description and picture type respectively. See http://id3.org/id3v2.4.0-frames for allowed picture types.
...
Attach a picture to an mp3:
ffmpeg -i input.mp3 -i cover.png -c copy -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
仅仅保留附加的图片应该是将图片流复制到 mp3 的简单问题,尽管您没有提及要转换的格式,有些人可能以不同的方式存储艺术品。
关于php - 使用 ffmpeg 转换音频文件并保留专辑插图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10626845/