An ffmpeg and SDL Tutorial (2015)
dranger.com
dranger.com
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/ is a better and more up-to-date tutorial than this one.
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.
I'm curious, how accurate/ useful is this 2015 guide today, Vs the newer (?) one you linked (which is also very cool too!).
Having been watching various media related YouTube videos lately, in wondering whether to jump on the AV1 bandwagon for encoding all of my family videos.
Currently I'm using H264/MP4 in 4K, my kids are only 1 and 3yo and I already have a couple of terabytes of video, not to mention all of the photos.
I did figure out the very simple switches to convert WAV to FLAC. Mercifully I don't need it for anything else (yet).
Of course, you still have this morbid curiosity: "Is that it? What am I not seeing?"
Then you shudder and close the page.
Then proceeds to use a pseudocode that looks like BASIC. Tasteful.