I want to make a quick program in C that will open a video, save each frame as a ppm, and dump motion vectors. All the tutorials I can find are from almost ten years ago and call deprecated or non-existent functions.
Are there any good online resources, websites, videos, or textbooks that cover a modern approach to doing these types of things?
This C++ code will help you to get .ppm image from USB (UVC) based camera. it saves in .ppm format. use v4l2 for linux and dshow for windows. instead of camera frame feed , a video also can be served as a input. this code cooked with latest ffmpeg libs.
libavutil 55. 24.100 / 55. 24.100
libavcodec 57. 43.100 / 57. 43.100
libavformat 57. 37.100 / 57. 37.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 46.100 / 6. 46.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
I have been working with ffmpeg and libav for several years and also have found no decent recent API-level tutorials. Sometimes I just have to dive into the source to figure out what is going on and how to use it. Also, reading the source for the CLI programs (which use the underlying libraries) can also be informative.
In fact, ffmpeg recommends that you just read source code, either for real OSS projects or their examples. Libav provides Doxygen documentation, but no step-by-step tutorials. IMO this is typical of open source projects: the source may be good, but documentation is often lacking.
Taking a step back, you might consider OpenCV, which is well documented (books exist!) and has an easier API. Lastly, ppm is such a simple format you could probably write a 50 line function to save the pixels yourself, and I found a motion extraction program here.