|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
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);
void image_create(struct image_t *img, uint16_t width, uint16_t height, enum image_type type)
Create a new image.
void jpeg_encode_image(struct image_t *in, struct image_t *out, uint32_t quality_factor, bool add_dri_header)
Encode an YUV422 image.
struct video_listener * cv_add_to_device(struct video_config_t *device, cv_function func, uint16_t fps, uint8_t id)
void video_capture_start_capture(void)
void image_free(struct image_t *img)
Free the image.
uint32_t buf_size
The buffer size.
void video_capture_shoot(void)
#define VIDEO_CAPTURE_JPEG_QUALITY
void video_capture_save(struct image_t *img)
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)
@ IMAGE_JPEG
An JPEG encoded image (not per pixel encoded)
bool video_capture_record_video
bool video_capture_take_shot
#define VIDEO_CAPTURE_FPS
Default FPS (zero means run at camera fps)
struct image_t * video_capture_func(struct image_t *img, uint8_t camera_id)
void video_capture_init(void)
void video_capture_stop_capture(void)
#define VIDEO_CAPTURE_PATH
static char save_dir[256]
uint32_t pprz_ts
The timestamp in us since system startup.
void * buf
Image buffer (depending on the image_type)