Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use FFmpeg

Tags:

c++

python

ffmpeg

I'm trying to extract frames from a video and I've picked ffmpeg ( tell me if you know something better ) for this task.

I've downloaded its source and don't know how to use it ?? how can I compile it?

What is the recommended language for it ? I know Python and C++. Please note that my operating system is Windows Vista 64 bit .

like image 404
Moayyad Yaghi Avatar asked Dec 15 '09 15:12

Moayyad Yaghi


People also ask

What can I do with FFmpeg?

FFmpeg is a great tool for quickly changing an AV file's format or quality, extracting audio, creating GIFs, and more. There are many open source tools out there for editing, tweaking, and converting multimedia into exactly what you need.

How do I run FFmpeg video?

Command-line To make things easy, you should add FFMPEG to your Path variable. This will allow you to use the app from any folder. Open File Explorer and navigate to the folder that has a video you want to play. In the location bar, enter cmd, and tap Enter.


Video Answer


2 Answers

If you know C++, you can modify sample from article using ffmpeg.

like image 88
user220048 Avatar answered Sep 27 '22 22:09

user220048


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.

like image 41
Jason B Avatar answered Sep 27 '22 22:09

Jason B