Skip to content

Scripts

You can download the tapemigration scripts from at http://m3.shore.mbari.org/apps/tapemigration-0.5.5.zip. To see help for a script, run it without arguments

add-timecode

Adds a timecode to a time. Useful for debugging problems.

❯ add-timecode
Missing required parameters: '<time>', '<timecode>'
Usage: <main class> <time> <timecode>
      <time>       The time of the video file as HH:MM:ss
      <timecode>   The timecode to subtract from the time as HH:MM:ss:ff

add-timecode Example

❯ add-timecode "00:00:00" "01:23:45:01"
01:23:45.033

edit-dive-time

Edit the start and/or end time of a dive in the expedition database.

❯ edit-dive-time
Missing required parameter: '<deploymentId>'
Usage: edit-dive-time [-hV] [-d=<allowedDiffMinutes>] [-e=<endTime>]
                      [-s=<startTime>] <deploymentId>
Change the start and/or end times of a dive
      <deploymentId>        The dive to edit
  -d, --diff=<allowedDiffMinutes>
                            Maximum allowed time change, in minutes
                            default: 10
  -e, --end=<endTime>       End time of the dive, use yyyy-MM-ddTHH:mm:ssZ
                              format
  -h, --help                Show this help message and exit.
  -s, --start=<startTime>   Start time of the dive, use yyyy-MM-ddTHH:mm:ssZ
                              format
  -V, --version             Print version information and exit.

Note that the deployment id can be either form of V1234 or Ventana 1234

edit-dive-time Examples

Use the -s flag to set the dive’s start time

❯ edit-dive-time V1234 -s "1997-04-11T18:20:01Z" 
Ventana 1234 start time has been changed to 1997-04-11T18:20:01Z

Set the -eflag to set the dive’s end time

❯ edit-dive-time V1234 -e "1997-04-11T19:40:00Z"                                                        Ventana 1234 end time has been changed to 1997-04-11T19:40:00Z

You can set the start and end times in one command

❯ edit-dive-time V1234 -s "1997-04-11T18:20:00Z" -e "1997-04-11T19:40:00Z" 
Ventana 1234 start time has been changed to 1997-04-11T18:20:00Z
Ventana 1234 end time has been changed to 1997-04-11T19:40:00Z

IMPORTANT

By default, the script will prevent you from making changes to the dates that are more than 10 minutes from the original date. This is to help prevent you from making big changes accidentally (e.g. using the wrong date).

❯ edit-dive-time V1234 -s "1997-04-11T18:20:00Z"
Unable to change 1997-04-11T18:20:00Z to 1997-04-11T19:20:01Z. 
Change is greater than allowed adjustment of 00:10:00 (h:m:s)

If you need to change the date by more than 10 minutes, use the -d flag to set the maximum number of minutes. For example, to change the start of the dive by an hour you might allow up to a 70 minute change like so:

❯ edit-dive-time V1234 -e "1997-04-11T19:40:00Z" -d 70
Ventana 1234 end time has been changed to 1997-04-11T19:40:00Z

inspect-tapes

Display a report of tapes before, during, and after a dive. Useful to determine which dive tapes belong to when there's more than a single dive in a day.

❯ inspect-tapes
Missing required parameter: '<videoSequenceName>'
Usage: <main class> [-a=<annoEndpoint>] [-e=<endpoint>] [-t=<timeoutSeconds>]
                    <videoSequenceName>
      <videoSequenceName>   The video sequence name of interest. e.g. Ventana
                              1234
  -a, --annoendpoint=<annoEndpoint>
                            The Annosaurus (annotation manager) endpoint
                            DEFAULT: http://m3.shore.mbari.org/anno/v1
  -e, --endpoint=<endpoint> The vampire squid (video asset manager) endpoint
                            DEFAULT: http://m3.shore.mbari.org/vam/v1
  -t, --timeout=<timeoutSeconds>
                            The vampire squid access timeout
                            DEFAULT: 10

inspect-tapes Example

❯ inspect-tapes 'Ventana 1234'
-- Tapes before, during, and after Ventana 1234
   Tape       | StartTime                | VideoSequenceName | AnnotationCount
   V1233-01   | 1997-04-11T15:56:15.403Z | Ventana 1233      |    14
   V1233-02   | 1997-04-11T16:28:03.540Z | Ventana 1233      |    16
   V1233-03   | 1997-04-11T17:08:52.073Z | Ventana 1233      |    33
   V1233-04   | 1997-04-11T17:35:45.060Z | Ventana 1233      |    20
-> V1234-01   | 1970-01-01T00:00:00Z     | Ventana 1234      |     0
-> V1234-05   | 1997-04-11T18:25:32.243Z | Ventana 1234      |    33
-> V1234-06   | 1997-04-11T19:18:57.500Z | Ventana 1234      |    24
   V1235-07   | 1997-04-11T20:29:37.973Z | Ventana 1235      |    70
   V1235-08   | 1997-04-11T21:05:31.687Z | Ventana 1235      |    19

subtract-timecode

Subtracts a timecode from a time. Useful for debugging

❯ subtract-timecode
Missing required parameters: '<time>', '<timecode>'
Usage: <main class> <time> <timecode>
      <time>       The time of the video file as HH:MM:ss
      <timecode>   The timecode to subtract from the time as HH:MM:ss:ff

subtract-timecode Example

❯ subtract-timecode "00:00:00" "01:23:45:01"
22:36:14.967

tc-estimator

Given an IMES video file name, generate the corresponding M3/VARS file name. If there are timecode resets in the camera logs, a guess for the file name will be provided for each section of the camera logs with unbroken timecodes.

❯ tc-estimator
Missing required parameter: '<sourceFile>'
Usage: tc-estimator [-hV] <sourceFile>
Given an IMES video file name, generate the corresponding M3/VARS file name.
If there are timecode resets in the camera logs, a guess for the file name
will be provided for each section of the camera logs with unbroken timecodes.
      <sourceFile>   Source video file name
  -h, --help         Show this help message and exit.
  -V, --version      Print version information and exit

tc-estimator Example

❯ tc-estimator V1354_SD01_Seq04_00-27-08-07_W748073138_h264.mp4                                                                                                                                   (base)
Analyzing V1354_SD01_Seq04_00-27-08-07_W748073138_h264.mp4
Start: 1997-12-16T18:39:55Z   Timecode: 00:00:02:10
End:   1997-12-16T19:16:25Z   Timecode: 00:27:07:27
-- Extrapolated: V1354_19971216T191625.514Z_t1s4_sd_tc00270807_h264.mp4
Start: 1997-12-16T19:16:27Z   Timecode: 00:27:07:20
End:   1997-12-16T19:34:11Z   Timecode: 20:02:21:00
-- Extrapolated: V1354_19971216T191628.348Z_t1s4_sd_tc00270807_h264.mp4
-- Guess:        V1354_19971216T191628.348Z_t1s4_sd_tc00270807_h264.mp4
Start: 1997-12-16T19:34:16Z   Timecode: 00:44:35:02
End:   1997-12-16T21:59:46Z   Timecode: 02:36:11:28
-- Extrapolated: V1354_19971216T191605.730Z_t1s4_sd_tc00270807_h264.mp4

titan-mv-script

❯ titan-mv-script
Missing required parameters: '<sourceDir>', '<targetDir>'
Usage: titan-mv-script [-hV] [-o=<scriptPath>] <sourceDir> <targetDir>
Walks directories containing iron mountain videos and builds a script for
moving them into place.
This script is meant to be run on a titan node
After running this, the generated script will need the paths adjust using
something like:
sed -i'.original' "s=/Volumes/m3/=/data/M3/=g" imes_mv.sh
      <sourceDir>   The root directory with movies from Iron Mountain
      <targetDir>   The root M3 directory to write files to. It should contain
                      'master' and 'mezzanine'
  -h, --help        Show this help message and exit.
  -o, --output=<scriptPath>
                    The path and name of the script to be created
                    DEFAULT: imes_mv.sh
  -V, --version     Print version information and exit.

titan-mv-script Example

❯ titan-mv-script /Volumes/m3/IMES/S99519L8 /Volumes/m3 -o S99519L8.sh