如何使用ffmpeg从视频文件中提取图像 [英] how to extract images from a video file using ffmpeg

查看:1077
本文介绍了如何使用ffmpeg从视频文件中提取图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从视频中获取一个图像以用作缩略图

所以我正在尝试:

  ffmpeg -ss 00:05:34.05 -i input.avi -vframes 1 -sameq output.jpg 

这个功能很好,但是每一次我碰到一个文件失败,并出现以下错误消息。

  av_interleaved_write_frame():发生I / O错误

通常这意味着输入文件被截断和/或损坏。



我有什么选择?

谢谢

解决方案

尝试此命令

  ffmpeg -ss 5 -i sample.mp4 -vframes 1 -s 320x240 -f image2 -y sample.jpg; 

始终设置-i之前的-i,以优化性能,同时从长长的视频抓取拇指。 / p>

I need to get one image out of an video to use as a thumbnail
So I am trying this:

ffmpeg -ss 00:05:34.05 -i input.avi -vframes 1 -sameq output.jpg  

This works just fine however every once in a while I come across a file where this fails with the following error message

av_interleaved_write_frame(): I/O error occurred  

Usually that means that input file is truncated and/or corrupted.

What are my options if any ?
Thanks

解决方案

Try this command

ffmpeg -ss 5 -i sample.mp4 -vframes 1 -s 320x240 -f image2 -y sample.jpg;

always set -ss before -i in order to optimize performance while grabbing thumbs from long length videos.

这篇关于如何使用ffmpeg从视频文件中提取图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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