3 ms·
This tutorial is very outdated, eg. `AVPicture`, which is used throughout, is completely deprecated and removed from the library, so you will simply encounter l
by kaladin-jasnah 4y ago
This tutorial is very outdated, eg. `AVPicture`, which is used throughout, is completely deprecated and removed from the library, so you will simply encounter linker errors trying to follow this tutorial and will have to replace every `avpicture` call made in the tutorial. Also, `avcodec_decode_video2` is deprecated and you have to use `avcodec_send_packet` and `avcodec_receive_frame`.
The FFmpeg libraries are possibly the worst thing I have ever worked with in my life. I have never been more afraid to use a library than this. FFmpeg libraries randomly break themselves, so if you find an answer from a few years ago, chances are it's useless. Want to free an AVPacket? `av_free_packet` is deprecated,. You can use `av_packet_unref` (but there's _also_ a function named `av_packet_free` that doesn't do quite the same thing).
Most questions on Stack Overflow or related platforms have no replies, the library is not well-documented (requiring you to always read the massive source code and the API reference). In addition, some things are outright undocumented and missing from the API reference or documentation and require reading often-unfinished conversations on the mailing lists with no solution. The FFmpeg libraries have very little error handling, which means if you're a bad C developer like me you are required to recompile FFmpeg with debugging information unstripped so you can trace segfaults in gdb.
https://github.com/leandromoreira/ffmpeg-libav-tutorial/ https://github.com/leandromoreira/ffmpeg-libav-tutorial/ is a better and more up-to-date tutorial than this one.
- mort96 4y agoFor the last point: Most distros have some way to get debug symbols. On Ubuntu for example, you add some repos and install -dbgsym packages (documented in https://wiki.ubuntu.com/Debug%20Symbol%20Packages https://wiki.ubuntu.com/Debug%20Symbol%20Packages).
- swyx 4y agoah thanks.. was trying to learn ffmpeg last night and the old tutorial was the best i found.. appreciate any and all links and resources
- weaksauce 4y agoas the old saying goes... the best way to get a correct answer on the internet is not to ask a question but to post an incorrect answer on the internet. it's fine you opened up the discussion for everyone to see this much more well written resource.
- swyx 4y agoyeah ive definitely internalized that one https://www.swyx.io/learn-in-public/ https://www.swyx.io/learn-in-public/
- warangal 4y agoYes, ffmpeg is one hell of a library and documentation doesn't make things easier. You have to ask a lot of questions to understand the low level details, and also have to answer them yourself by doing experiments. For the point about packet freeing, i think ``av_packet_unref`` is supposed to de-reference the ``encoded video/audio`` data being read in the RAM, so that internal ffmpeg code can deallocate it. It has to be called for every ``av_read_frame``. ``av_packet_free`` is supposed to release the generic ``packet`` object/struct allocated by ``av_packet_alloc``. I learnt this while making a simple video player based on ffmpeg library.