Encode a frame to a file on the filesystem
#include <img/img.h> int img_write_file( img_lib_t ilib, const char* path, const img_encode_callouts_t* callouts, img_t* img );
- A handle for the image library, returned by img_lib_attach().
- The full path to the file to create.
- A pointer to an img_encode_callouts_t structure that provides system callouts for the encoder. If you specify NULL for this value, the library supplies a set of default callouts.
- The address of an img_t structure describing the frame to be encoded.
Use the -l img option to qcc to link against this library.
This function encodes a frame to a file on the filesystem. This function is only capable of encoding a single frame. A codec is chosen based on the extension included in the provided filename.
The file will be automatically unlinked if the encode fails for any reason.
- Error accessing path (errno is set).
- Memory-allocation failure.
- No appropriate codec could be found that handles the extension included in the provided filename. The codec you require could be missing or corrupt.
- Input data format not supported; the codec and application could not agree on an output format.
- Error writing data; file was truncated.
- Encode was interrupted by application.