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

查看:670
本文介绍了如何使用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 is what I have so far:

# 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天全站免登陆