5MP Motion Camera JPEG Image and Movie Catcher  1.1.1.1
A CGI interface to capture and display pictures and movies using OpenCV.
mjpeg_utils Class Reference

#include <mjpeg_utils.hpp>

Static Public Member Functions

static void save_avi_frames (const string *avi, const string *source_file)
 
static void trim_zero_pad (string &s)
 

Member Function Documentation

◆ save_avi_frames()

void mjpeg_utils::save_avi_frames ( const string *  avi,
const string *  source_file 
)
static

Splits an AVI|MJPEG file into JPEG images and tests the magic number in each to see if it has a MIME type of image/jpeg. It saves those that do and discards the rest.

Parameters
aviinput AVI|MJPEG file
source_filethe full path and name of the source file. Used to construct output file names.

◆ trim_zero_pad()

void mjpeg_utils::trim_zero_pad ( string &  s)
static

Remove the extra zeros (0x00) sometimes left after conversion from Base64.

If the Base64 encoded string ends with equal sign(s) it will have such a pad when decoded. This version is specific to JPEG files which must end with the sequence 0xFF 0xD9. OpenCV complains of an "overread 8" error if the pad is not removed before conversion from avi to mp4 video.

This function also has the effect of removing partial frames from the end of the file; a sort of repair.

Parameters
sa Base64 decoded string.

The documentation for this class was generated from the following files: