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[266];
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);
struct video_listener * cv_add_to_device(struct video_config_t *device, cv_function func, uint16_t fps, uint8_t id)
Computer vision framework for onboard processing.
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)
Write JPEG images containing EXIF headers with GPS coordinates.
void image_free(struct image_t *img)
Free the image.
void image_create(struct image_t *img, uint16_t width, uint16_t height, enum image_type type)
Create a new image.
uint32_t buf_size
The buffer size.
void * buf
Image buffer (depending on the image_type)
uint32_t pprz_ts
The timestamp in us since system startup.
@ IMAGE_JPEG
An JPEG encoded image (not per pixel encoded)
void jpeg_encode_image(struct image_t *in, struct image_t *out, uint32_t quality_factor, bool add_dri_header)
Encode an YUV422 image.
Encode images with the use of the JPEG encoding.
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
static char save_dir[256]
bool video_capture_record_video
bool video_capture_take_shot
#define VIDEO_CAPTURE_JPEG_QUALITY
#define VIDEO_CAPTURE_PATH
struct image_t * video_capture_func(struct image_t *img, uint8_t camera_id)
#define VIDEO_CAPTURE_FPS
Default FPS (zero means run at camera fps)
void video_capture_save(struct image_t *img)
void video_capture_start_capture(void)
void video_capture_stop_capture(void)
void video_capture_shoot(void)
void video_capture_init(void)
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.