2019-04-18 02:39 AM
Hello, we are creating an embedded camera application on the STM32F7. In snapshot mode we allow the user to save individual images to SDCard in RGB format, or in video mode to save successive images at about 5 per second to SDCard, also in RGB format.
We also allow the saving of selected images to USB. It just takes an image, opens a file, saves a BMP header to the file, and then saves the RGB format to the file. This works great, saves viewable BMP image files to the USB stick.
We'd now like to add the function to save successive images to a *video* format on the USB stick. We can choose any video format we'd like, we simply want to "stitch" the images together into a file that the user can double click (after moving the USB stick to a PC or Mac) and have the file play, showing the images at about the original 5hz speed. We don't really need compression, and we'd like the video to not be "lossy", to show the entire image data (this will be used for diagnostic purposes).
Thus far we are having trouble finding a suitable output format or conversion algorithm. A GIF, it turns out, can only support a small palette so we would lose image information. Other formats seem to require advanced codecs, and we are happy incorporating some third party code but so far we haven't found one in any format, suitable for our bare metal STM32F7 (they all seem to require Linux or Win32 calls). We are also happy rolling our own encoder, but most of these video formats are pretty daunting -- if there were a simple one with no compression that would be fine, we'd roll it up.
Does anyone know of a solution to this that fits our requirements? Thanks very much.
2019-04-18 09:31 AM
AVI is definitely capable of storing uncompressed video and is not overly complex.
Matroska can do almost anything, but is more complex and chaotic.
2019-04-18 01:02 PM
As the speed is low, one possibility is to use an open-source JPEG encoder/decoder to output the images one at a time. Wouldn't have all the motion blur corrections and so on that MPEG-2/4 has, but more chance of it fitting on an F7.