如何使用 ffmpeg 将自定义缩略图添加到 .mp4 文件? [英] How do I add a custom thumbnail to a .mp4 file using ffmpeg?

查看:29
本文介绍了如何使用 ffmpeg 将自定义缩略图添加到 .mp4 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到合适的 ffmpeg 命令来将 .png 或 .jpg 图像作为缩略图添加到 .mp4 视频中.该命令最终将由 C# 程序自动执行.

I am trying to find the proper ffmpeg command to add a .png or .jpg image to a .mp4 video as a thumbnail. The command will eventually automatically be executed by a C# program.

这是我目前所拥有的:

# This does not work. It only removes the default thumbnail.
ffmpeg -i video.mp4 -i image.png -acodec copy -vcodec copy -map 0 -map 1:0 OUTPUT.mp4

我想要的 ffmpeg 可以实现吗?如果是这样,请指导我朝着正确的方向前进.

Is what I want possible with ffmpeg? If so, please guide me in the right direction.

推荐答案

使用 ffmpeg 4.0,2018 年 4 月 20 日或更新版本,

Using ffmpeg 4.0, released Apr 20 2018 or newer,

ffmpeg -i video.mp4 -i image.png -map 1 -map 0 -c copy -disposition:0 attached_pic out.mp4

这篇关于如何使用 ffmpeg 将自定义缩略图添加到 .mp4 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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