User Manual - Filenaming

From edgertronic high speed video camera
Jump to navigation Jump to search


Home

Favorite settings



Overview

The camera will create a default filename if none is specified. The user can also specify a filename. The specified filename can contain parameters that will be expanded by the camera to the actual value for that particular video capture when the file is created.

The camera determines which available storage device to use based on the following priority:

  1. USB removable storage device
  2. SD card removable storage device
  3. Network storage device

Because of this priority, if you want to save to a network storage device, you should specify a fully qualified filename (FQFN), as described below.

The selected storage device based on the above priority is called the active storage device. The camera continues to use the selected active storage device until it is no longer usable, independent of storage devices being inserted or removed.

The user can override the above priority by either making storage devices unavailable, meaning using CAMAPI to unmount them, or by specifying an a filename that includes an absolute path.

In addition to specifying the filename, you can also include a path. The camera will create directories as necessary to be able to save the file using the supplied path. A path that starts with a forward slash / character is called a fully qualified filename (FQFN). You can also include directories in the filename, which will save the file to the active storage device.

Specifying the storage device to use

Instead of using the camera's active storage device, you can specify which storage device to use by including a fully qualified filename (FQFN), which means the filename starts with a forward slash / character. To specify the storage device to use, start the filename with one of the strings as shown in the table below:

Storage Device Start of the FQFN Example
SD card /mnt/sdcard /mnt/sdcard/DCIM/example_%c
USB storage /mnt/usb /mnt/usb/DCIM/example_%c
Network storage /mnt/net /mnt/net/game_1/inning_5/example_%c

Characters allowed in a filename

Valid characters for a video filename include

  • Upper and lower case letters
  • Digits (numbers)
  • Special characters period '.', underscore '_', minus '-', plus '+'
  • Directory separator forward slash '/'
  • Parameter indicator ampersand '&'

All other characters are converted to an underscore '_'.

Directory naming

If the filename does not contain a forward slash, meaning no directory path is specified in the filename, the video files and metadata files will be stored in the directory named DCIM on the active storage device. The camera creates the directory if it doesn't exist.

Ways to name a video file

You can provide a filename (really a parameterized filename, as described below) in the following ways:

  • Before a video is captured (via webUI Filename tab / CAMAPI run() method)
  • When you use CAMAPI to trigger the camera (via CAMAPI trigger() method)
  • When you selective save (via webUI Filename tab / CAMAPI configure_save() and selective_save() methods)
  • When you use CAMAPI to rename a previously captured, but maybe not yet saved, video (via CAMAPI rename_last_video() method)

Both the video file and the associated metadata file have the same filename, with the extension being different.

Parameterized file naming

Default file naming

If you don't specify a filename, the camera will generate a filename automatically. The same filename is used for the video file and the file holding the associated metadata information.

For video files, the default file naming convention used is to start with slomo_ followed by a strange number, maybe some optional information, and ending in .mov. Specifically:

 slomo_&T.mov

where &T is replaced with the seconds from the start of the computer epoch (Jan 1, 1970) GMT.

For multishot videos, the file naming convention is:

 slomo_&T_&b.mov

where &b is replaced with the multishot buffer number.

For selective save, the start and end frame are included in the filename:

 slomo_&T_frames_&s_to_&e.mov

A similar pattern is used for the metadata file:

 slomo_&T.txt
 slomo_&T_&b.txt
 slomo_&T_frames_&s_to_&e.txt

User specified file naming

A more flexible file naming scheme was added in software revision 2.3. The request dictionary passed to the CAMAPI configure_camera() method supports the dictionary key requested_filename_pattern, allowing you to specify the filename pattern to be used. See the Software 2.2 compatibility section for a special format that can be used to maintain compatibility with previously released camera software.

File naming parameters

The following ampersand parameters can be included in the requested_filename_pattern entry in the requested settings dictionary that is passed to CAMAPI configure_camera() / run() methods. When the video file or associated metadata file is saved, the camera will substitute the actual value in place of the ampersand parameter.

Variable Camera Setting
&a Camera name
&b Multishot buffer
&c Video save count since camera was manufactured
&C Video save count since webUI settings modal was closed / CAMAPI run() was called
&d Trigger date (DD-MMM-YY)
&D Default version 2.2 naming scheme (described above)
&e Ending frame number where frame 0 is the trigger frame
&m Camera model - SC1 SC2X, etc.
&n Serial number
&s Starting frame number where frame 0 is the trigger frame
&t Trigger time (HH-MM-SS)
&T Integer Epoch trigger time (seconds since Jan 1, 1970 GMT
&v Floating point Epoch trigger time (seconds since Jan 1, 1970 GMT)

To keep from overwriting an existing files, once the above substitutions are done, if the created filename will overwrite an existing file, then an underscore and a letter is appended to make the filename unique.

Example parameterized filename expansion

If you want the filename to contain the epoch trigger time and the camera serial number, you could use a filename pattern like:

dump_truck_demolition_&T_&n 

If the trigger time is November 2, 2021 2:54:29 AM GMT and the camera serial number is 0x0374, (and you are you are using MOV video file format), then the expanded filenames will be

dump_truck_demolition_1635821669_0374.mov
dump_truck_demolition_1635821669_0374.txt

Directory naming

The video files and metadata files were stored in the directory named DCIM. The directory can either be on the SD card, USB storage device, or network storage device. The camera creates the directory if it doesn't exist.

You can specify a filename that includes a directory tree, such as

/mnt/sdcard/game_4/inning_6/batter_hank/pitch_4_&c.mov

The camera will automatically create any sub-directories as needed. You should start any


CAMAPI file naming support

There are several ways CAMAPI supports user specified filenames, list in highest to lowest priority order:

  • selective_save() parameter
  • trigger() parameter
  • requested_filename_pattern key in dictionary passed to run()

The filename is determined at the time the camera starts saving the video file and metadata file. If the user trims the video while saving, the actual filename used might change if the ending video frame number is included in the filename.

Multicast network trigger file naming support

You can include a filename in the Multicast network trigger UDP packet.

Future option - follow design rule for camera file system

The main reason for considering following Design rules for Camera File system (DCF) specification is the horrible VFAT file system used on the SD card and USB storage device add a huge performance delay if more than around 200 files exist in a single directory.

User specified file naming

If the configure_camera() requested dictionary parameter doesn't specify a file name pattern, then a pattern that compiles with the Design rules for Camera File system (DCF) is used. The default file naming pattern is:

 SLO_&c.mov

where &c is a 5 digit number indicating the movie save count since the last factory reset.

The file is stored in a two-deep directory tree which follows the pattern DCIM/100EDGER. When the camera powers on, or the storage media is changed, the camera either uses an existing two-deep directory or creates a new one. The camera locates the ???EDGER directory that has the largest 3 digit number (such as 105EDGER). If there are more than 200 files in the selected directory, then the camera will create a new directory with the three digit number incremented by one beyond the largest directory number (e.g. the next directory would be 106EDGER). This algorithm follows the Design rules for Camera File system (DCF) specification.



Home

Favorite settings