Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find a C/C++ FFmpeg extensive tutorial? [closed]

I want to use ffmpeg (in its c library form) to split a video in more parts, recompose them and encode the final result. Something basic. But it's very difficult to find documentation or hints about this. Where should I look/ask for advice?

like image 338
ticofab Avatar asked Jul 09 '12 13:07

ticofab


People also ask

What is the FFmpeg library?

FFmpeg is a free and open-source software project consisting of a suite of libraries and programs for handling video, audio, and other multimedia files and streams. At its core is the command-line ffmpeg tool itself, designed for processing of video and audio files.

What is the latest version of FFmpeg?

FFmpeg 2.8.21 "Feynman" 2.8.21 was released on 2022-10-30. It is the latest stable FFmpeg release from the 2.8 release branch, which was cut from master on 2015-09-05. Amongst lots of other changes, it includes all changes from ffmpeg-mt, libav master of 2015-08-28, libav 11 as of 2015-08-28.


2 Answers

I was also looking for a good c/c++ FFmpeg tutorial for a while, and this c/c++ ffmpeg-libav-tutorial is definitely the best I found so far. It explains how to use the FFmpeg as a library and before that gives a clear overview about video key words (like encoding, decoding, transconding, muxing exc.) which is very helpful for people who are not that familiar with videos.

In addition, this tutorial is great to understand the concept of video, so for those who are not familiar enough with the video world, I suggest to start with this, and only then to continue with the c/c++ ffmpeg-libav-tutorial.

like image 134
J.M. Avatar answered Sep 25 '22 13:09

J.M.


You can learn a great deal from the source of the command-line utilities maintained by the FFmpeg project.

In ffplay.c, the main() will show you how to get the library initialized. stream_component_open() demonstrates matching codecs to streams in the media, and get_video_frame() shows how to decode a packet and get its PTS (presentation time stamp). You'll need that to time your splits correctly.

That should get you started on the decode side. On the encode side, look at ffmpeg.c. It's larger and more complicated than ffplay, but the process of encoding a frame nearly mirrors the process of decoding it, so once you have decoding working, it should make more sense.

like image 25
LightStruk Avatar answered Sep 25 '22 13:09

LightStruk