38 #if JPEG_WITH_EXIF_HEADER
42 #ifndef VIDEO_CAPTURE_PATH
43 #define VIDEO_CAPTURE_PATH /data/video/images
46 #ifndef VIDEO_CAPTURE_JPEG_QUALITY
47 #define VIDEO_CAPTURE_JPEG_QUALITY 99
50 #ifndef VIDEO_CAPTURE_FPS
51 #define VIDEO_CAPTURE_FPS 0
73 gettimeofday(&tv, NULL);
74 tm = localtime(&tv.tv_sec);
77 tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
78 tm->tm_hour, tm->tm_min, tm->tm_sec);
118 char save_dir_cmd[256];
119 sprintf(save_dir_cmd,
"mkdir -p %s",
save_dir);
120 if (system(save_dir_cmd) != 0) {
121 printf(
"[video_capture] Could not create images directory %s.\n",
save_dir);
131 printf(
"[video_capture] Saving image to %s.\n", save_name);
138 #if JPEG_WITH_EXIF_HEADER
142 FILE *fp = fopen(save_name,
"w");
144 printf(
"[video_capture] Could not write shot %s.\n", save_name);
uint32_t buf_size
The buffer size.
void image_free(struct image_t *img)
Free the image.
static char save_dir[256]
bool video_capture_record_video
void image_create(struct image_t *img, uint16_t width, uint16_t height, enum image_type type)
Create a new image.
uint32_t pprz_ts
The timestamp in us since system startup.
void video_capture_save(struct image_t *img)
void video_capture_shoot(void)
struct video_listener * cv_add_to_device(struct video_config_t *device, cv_function func, uint16_t fps)
void video_capture_stop_capture(void)
void video_capture_start_capture(void)
int write_exif_jpeg(char *filename, const unsigned char *image_jpg, const unsigned int image_jpg_len, const unsigned int image_jpg_x, const unsigned int image_jpg_y)
#define VIDEO_CAPTURE_PATH
Computer vision framework for onboard processing.
void * buf
Image buffer (depending on the image_type)
#define VIDEO_CAPTURE_JPEG_QUALITY
#define VIDEO_CAPTURE_FPS
Default FPS (zero means run at camera fps)
Encode images with the use of the JPEG encoding.
struct image_t * video_capture_func(struct image_t *img)
void jpeg_encode_image(struct image_t *in, struct image_t *out, uint32_t quality_factor, bool add_dri_header)
Encode an YUV422 image.
bool video_capture_take_shot
Write JPEG images containing EXIF headers with GPS coordinates.
void video_capture_init(void)
An JPEG encoded image (not per pixel encoded)