如何使用ffmpeg添加专辑封面? [英] How to add album art with ffmpeg?

查看:641
本文介绍了如何使用ffmpeg添加专辑封面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直坚持在mp3文件上添加专辑封面.

I've been stuck to add album art on mp3 files.

我已经研究和搜索了此问题,但尚未找到解决方案. ffmpeg文档建议此脚本将图像(相册)添加到mp3中:

I've already researched and googled this issue but haven't found a solution yet. The ffmpeg documentation recommends this script to add image (album art) to mp3 :

ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3

来源: http://www.ffmpeg.org/ffmpeg-all.html #mp3

但是它不起作用.我的控制台输出是:

But it doesn't work. My console output is:

Unrecognized option 'c'
Failed to set value 'copy' for option 'c'

我正在寻找另一种解决方案,并获得了以下解决方案: http://trac.ffmpeg.org/ticket/2221 :

I looked for another solution and got this: http://trac.ffmpeg.org/ticket/2221:

ffmpeg -i input.mp3 -i cover.png -map 0:0 -map 1:0 -c copy -id3v2_version 3 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3

这将返回相同的输出:

Unrecognized option 'c'
Failed to set value 'copy' for option 'c'

有人可以帮助我吗?

nb:我使用ubuntu 12.04和ffmpeg版本0.8.6-4:0.8.6-0.

nb: I use ubuntu 12.04 and ffmpeg version 0.8.6-4:0.8.6-0.

谢谢.

推荐答案

使用最新版本

ffmpeg -i in.mp3 -i test.png -map 0:0 -map 1:0 -c copy -id3v2_version 3 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (front)" out.mp3

使用-map将输入流与输出相关联
使用-c copy直接解复用/重新复用
-id3v2_version 3是您的命令行中缺少的内容.请注意,它将编写一个IDV2.3,但您可以要求使用2.4(-id3v2_version 4)

Use -map to associate input stream to the output
Use -c copy to directly demux/remux
The -id3v2_version 3 is what is missing in your command line. Note that that wil write an IDV2.3 but you can ask for a 2.4 (-id3v2_version 4)

使用-id3v2_version 3选项,将很好地解释-metadata选项

with the -id3v2_version 3 option the -metadataoption will be well interpreted

注意:元数据注释区分大小写.

Note: the metadata comment is case-sensitive.

这篇关于如何使用ffmpeg添加专辑封面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆