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

4

14

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?

Moen answered 9/7, 2012 at 13:41 Comment(5)
How about: inb.uni-luebeck.de/~boehme/using_libavcodec.html (which is basically a tutorial linked from: ffmpeg.org/documentation.html)Dariusdarjeeling
have a look at this one...not up-to-date but will be a good start. dranger.com/ffmpeg and don't forget the ffmepg doxygen doc ffmpeg.org/doxygen.Shakedown
I found this too: ffmpeg.org/developer.htmlScilla
+1 for the dranger.com tutorial. It's the only one I've found that provides a step-by-step tutorial on creating a simple stripped-down application to play video while explaining every step and covering some of the API peculiarities.Nightshirt
Minimal runnable resize example in C at: #12832261Wintertide
L
8

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.

Lawana answered 26/9, 2012 at 17:27 Comment(0)
N
4

i was searching for a FFmpeg tutorial and php but i found the following are the best places to learn it with any language a book i think it's the only book about FFmpeg FFmpeg Basics: Multimedia handling with a fast audio and video encoder

http://www.amazon.com/FFmpeg-Basics-Multimedia-handling-encoder/dp/1479327832/ref=sr_1_12?ie=UTF8&qid=1357356672&sr=8-12&keywords=ffmpeg

enter image description here

and the scond place is http://ffmpeg.org/documentation.html

Nellanellda answered 5/1, 2013 at 3:36 Comment(0)
M
3

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.

Marchak answered 30/4, 2020 at 20:28 Comment(0)
S
0

TLDR;

https://github.com/ShootingKing-AM/ffmpeg-pseudocode-tutorial - A broad workflow understanding of ffmpeg-cli through loose pseudocode.


The best way as per FFmpeg devs is to read thorugh source of ffmpeg libav and/or ffmpeg-cli.

The goal of understanding ffmpeg-cli is to be able to to integrate FFmpeg into our projects without having to call the ffmpeg-cli in background to do multimedia operation. This is important because,

  • Starting up an external executable tends to be blocked by antivirus software and can cause issues with users.
  • Optimize your project specific libav usage and skip unnecessary code from ffmpeg-cli Also, ffmpeg official documentation being vague at best, the only option for developers looking to implement ffmpeg's libraries (libav) functionality into their code is to read the command line interface's source code.

But, Reading ffmpeg-cli's source code is very hard, because its not meant to be used as a study material for understanding how to use libav but as a optimized multimedia tool. Hence, i tried to straighten out its source code into simple pseudocode function highlighting when and where to call important(almost all) libav's functions, for an overall broader picture of ffmpeg workflow. For information regarding how to call a libav function call, one can refer to the doxygen documentation and ffmpeg-cli-source files.

Struthious answered 22/2, 2021 at 10:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.