Save mode

From edgertronic high speed video camera
Revision as of 15:31, 5 July 2018 by Tfischer (talk | contribs)
Jump to: navigation, search

Save modes

Save mode Description
Auto User sets the multishot count to the number of videos to be captured and then camera will automatically save the videos once the number of trigger events matches the multishot count.
Review When the user has captured all the events of interest, the user can review the captured fames and adjust some settings and the start and end frame to save, before saving a video.
Background After a video is captured, the camera allows another video to be captured while

Auto save mode

Out of the box, a new edgertronic camera is pre-configured to allow you to trigger the camera and then the camera encodes the captured frames into a video file and saves the file to the SD card. This is a simple model to understand and works well when learning to take high speed videos.

The simplest camera operation is continuously filling the pretrigger buffer with video frames while waiting for a trigger event. Once triggered, the camera fills the post trigger buffer and automatically saves the captured frames to a file. When multi-shot is enabled, the camera repeats the pretrigger fill, trigger, post trigger fill process until all buffers are filled, then automatically saves each buffer one by one. In either case, once the camera is configured, the user control is simply to create a trigger event. With multi-shot, an additional user control is to request the captured buffers be saved without having to fill all the multi-shot buffers. This mode of operation is called auto-save.



When you increase the multishot count, you will be able to capture several events, followed by the camera encoding and saving the videos, The camera will wait until the number of triggers matches the multishot count, then the camera will encode and save the captured video frames. You can also save captured videos even if all of the multishot buffers are not full.

When the camera is set to auto save mode, the camera will encode and save the captured videos when number of triggers matches the multishot count.

Review then save mode

You can review a video before saving, allowing you to trim the uninteresting beginning and end of your captured video. There are also some settings you can change after the video has been captured, including ISO and the text that is overlaid on each video frame. You can even save the same video multiple times, selection different regions to save.

Another camera mode of operation is review. The user can capture one or more videos, then review each a video setting the starting and ending frame for selective saving a region of the video. Once the user is done reviewing and saving selected regions of the captured videos, the user can again run the camera to restart the pretrigger fill, trigger, post trigger fill process. In the review mode of operation, the camera allows videos to be reviewed after all multi-shot buffers are filled instead of automatically saving all captured frames for all captured videos. In a similar way, with multi-shot enabled, an additional user control is to allow the captured buffers be reviewed without having to fill all the multi-shot buffers.

Examples of when review then save mode can be useful include:

  • Immediate viewing: In some cases you might not want to save the frames at all. Instead, you may want to view the video frames as soon as possible then take action based on what was observed. Example of this include adjusting camera settings before taking the real high speed video, using high speed videography to improve your golf swing or verify a piece of equipment being manufactured is operational.
  • Selecting a region of capture video to save: When reviewing a captured video, you can pick the starting and ending frames to save so your high speed video files only contain the portion of the capture video that is of interest.
  • Imaging processing: The edgertronic high speed camera can be viewed as a video source (really a source of image frames), allowing the imaging processing software to receive, via the camera's network connection, a series of video frames.


When the camera is set to review then save mode, you can review the captured video, saving just the portion of the video that is of interest.

Background save mode

Capturing video frames is much, much faster than the time it takes to encode video frames. If you are capturing regular events, such as a baseball pitches, you can focus on capturing the events of interest, with the camera encoding and saving the videos in the background. If your camera has sufficient memory, you will always be able to trigger. If the camera memory becomes full of unsaved captured videos, then triggering is disabled until the current video being saved is done.

When the camera is set to background save mode, you can continue to capture new events while the camera is encoding and saving the already captured videos in the background.

Web User Interface support for save mode

The captured video review feature can be enabled or disabled using the camera's web U.I. When disabled, the camera automatically saves captured videos when the configured number of multishot buffers are filled. When review is enabled, the camera does not automatically save videos. Instead, after one or more videos have been captured to multishot buffers, a review bar is shown below the video window. The review bar has two markers, one for setting the starting frame and the other to set the last frame. As long as you have are dragging one of the markers, the frame associated with that marker position is displayed.

You can also select which captured video to review by setting the multishot buffer value.

Once you have set the starting frame and end frame markers, you can save the selected region by pressing the save icon. The filename of the video, and associated metadata file, is modified to include the start and end frame number. This allows you to save different segments of a the same captured video buffer to different files. An example would be a captured video buffer containing two lightning strikes. You might save the first lightning strike to one file and save the second lightning strike to another files.

When you are done reviewing the videos, you can discard all captured video frames and capture more videos by clicking on the run icon.

CAMAPI support for save mode

Auto save mode, review before save mode, and background save mode are supported by camera configuration settings, the camera state machine, and camera status information that can be retrieved.

The active save mode is set when invoking the run() CAMAPI method, by including in the requested settings dictionary the requested_save_mode key set to 0 for auto, 1 for review, and 2 for background save mode.

There are several dictionary keys in the camstatus dictionary returned by calls to the get_camstatus() CAMAPI method:

Key Value
data type
Example
value
Description
save_state integer 1 - idle
5 - saving
9 - interrupted
State of the saving state machine. If there is no captured video to be saved, the state will be idle and the save_buffer, save_level, and save_time will be meaningless. Interrupted means more video file storage (SD card, USB storage, or network storage) is needed to finish saving the captured videos.
save_buffer integer 1 The number of the buffer being saved. The first buffer captured after a call to run() is buffer number 1.
save_level integer 0 .. 100 The percentage saved of the save_buffer video.
unsaved_count Number of captured buffers that have not been saved.
save_time integer 4 Approximate number of minutes for all of the unsaved videos to saved. Applies to the current video being saved in review before save mode or all the captured, but not yet saved videos in auto save mode or background save mode.

CAMAPI support for review before save

Camapi-states-review-with-test-labels.png

Review and selective save are supported by the camera by means of the REVIEW state in the camera's state machine, as shown to the right.

Controlling frames being reviewed

When the camera is in the REVIEW state, the review_frame() CAMAPI method allows the camera to be configured to read out captured video frames at a specified rate, from the specified start frame to the specified end frame. The review() method also allow you to control if you want the camera to continuously loop, sending the selected region of frames over and over. If you want to lock step control the camera so you get exactly one frame per review() invocation, set the start and end frame to the same value and the frame rate to zero.

Saving reviewed video

When you ready to save a captured video and the camera is in the REVIEW state, use the selective_save() CAMAPI method. When the save is complete, the camera will return to the REVIEW state.

Capturing new video when review is complete

When you no longer need the captured video frames and want to capture new video, invoke the run() CAMAPI method.

Implementation details

  • The metadata file contains items that refer to the video captured to the buffer. This includes the camera settings, and the capture information capture buffer number, frame count, pre-trigger frames, trigger time, and trigger delay. Be aware that a selective save may mean the file doesn't contain the trigger frame.
  • For selective save, two additional metadata values indicate which region of the captured video buffer was saved in the file. These two fields are first saved frame and last saved frame.
  • To allow different regions of the same captured video buffer to be saved to files, videos saved using selective save will include the frist and last saved frame in the filename in the form:

slomo_$EPOC_$BUFFER_frames_$START_to_$END.mov.

  • The start frame number and end frame number are index based on the trigger frame being frame 0. This means the start and end frames will be negative numbers if the frames of interest occurred before the trigger event.
  • Using selective save, the user can save the same captured video twice; once with overlays on and again with overlays off.