03-02-2025, 05:51 PM
With @SpriggsySpriggs' webcam code, we can capture still images as they come in at 30 FPS. Then QB64PE can further manipulate each frame as an image and display it to the screen & write to an image file. I find the lag to be minimal at 320x240 resolution. The one thing we don't have is the ability to output it to a video file (AVI or some common format), ideally appending to the file from QB64PE images as they come in?
I googled making an AVI file from still images, and didn't find anything in QB64. Everything I found indicated that making an AVI from scratch from frame data is a non-trivial task, but there is a Microsoft API for it, with an example at
https://www.wischik.com/lu/programmer/avi_utils.html that references "avi_utils.h". However Spriggsy looked at it and said it uses an interface, which he had not had any luck with in QB64PE.
I also found people talking about generating AVI from a bunch of image files using FFMPEG, so my low-hanging-fruit workaround would be to save still frames to a folder, then shell out to FFMPEG to make it a video.
I figure it can't hurt to ask, does anyone have any idea for generating a video file from a stream of images, say 320x240 at 30 FPS? If someone can figure out that API interface that might be a way, but that is way beyond me...
I googled making an AVI file from still images, and didn't find anything in QB64. Everything I found indicated that making an AVI from scratch from frame data is a non-trivial task, but there is a Microsoft API for it, with an example at
https://www.wischik.com/lu/programmer/avi_utils.html that references "avi_utils.h". However Spriggsy looked at it and said it uses an interface, which he had not had any luck with in QB64PE.
I also found people talking about generating AVI from a bunch of image files using FFMPEG, so my low-hanging-fruit workaround would be to save still frames to a folder, then shell out to FFMPEG to make it a video.
I figure it can't hurt to ask, does anyone have any idea for generating a video file from a stream of images, say 320x240 at 30 FPS? If someone can figure out that API interface that might be a way, but that is way beyond me...