如何使用ffmpeg [英] how to use ffmpeg

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

问题描述

我想从视频中提取帧..我选择ffmpeg(告诉我,如果你知道更好的东西)为这个任务

i下载它的源..我不知道如何使用它?我怎么编译它?

什么是推荐的语言呢?我知道python和C ++

请注意我使用的是windows vista 64x。

解决方案

从视频中提取帧并将它们保存到文件,您只需在命令行中使用ffmpeg:

  ffmpeg -i video.avi image%d.jpg 

对于这种方法,你不需要构建ffmpeg应该是一个Windows二进制文件可供下载。



如果你想显示框架或对其执行一些其他处理,你可能想使用libavformat和libavcodec部分的ffmpeg项目)提取视频帧的代码。 这里是一个很好的教程,介绍如何使用libavcodec和libavformat从视频中获取帧。 libavformat和libavcodec是C库,所以我想使用C或C ++,如果你想直接接口到他们。对于ffmpeg有这个python包装器,看起来很有前途,但我没有尝试过。 / p>

您可以下载编译的ffmpeg库,以便您不必自己构建它们。 ffmpeg不会根据文档构建在MSVC ++上,因此您必须设置mingw环境。 此网站有很多Windows构建和教程,介绍如何构建如果你真的想要图书馆。


im trying to extract frames from a video .. and i picked ffmpeg ( tell me if you know something better ) for this task
i downloaded it's source .. and i don't know how to use it ?? how do i compile it ??
what is the recommended language for it ?? i know python and C++
please note that i use windows vista 64x .

解决方案

If you just want to extract the frames from a video and save them to file, you can just use ffmpeg at the command line:

ffmpeg -i video.avi image%d.jpg

For this method, you do not need to build ffmpeg as there should be a windows binary available for download.

If you are wanting to display the frames or perform some other processing on them, you may want to use libavformat and libavcodec (main parts of the ffmpeg project) to extract the video frames in code. Here is a pretty good tutorial on how to get frames from a video using libavcodec and libavformat. libavformat and libavcodec are C libraries so I would use C or C++ if you want to interface directly to them. There is this python wrapper for ffmpeg that looks promising, but I haven't tried it.

You can download the compiled ffmpeg libraries as well so you shouldn't have to build them yourself. ffmpeg will not build on MSVC++ as per the documentation so you would have to set up a mingw environment. This site has a lot of Windows builds and tutorials on how to build the libraries if you really want to.

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

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