tesla-dashcam 0.1.21
Python program to merge video files created by Tesla dashcam
License: Apache License 2.0
Requires Python: >=3.13.0


[![image](https://img.shields.io/github/downloads/ehendrix23/tesla_dashcam/total)](https://img.shields.io/github/downloads/ehendrix23/tesla_dashcam/total)

[![image](https://img.shields.io/github/downloads/ehendrix23/tesla_dashcam/latest/total)](https://GitHub.com/ehendrix23/tesla_dashcam/releases/)

[![image](https://img.shields.io/pypi/dm/tesla-dashcam)](https://pypi.python.org/pypi/tesla-dashcam/)

# tesla_dashcam

Python program that provides an easy method to merge saved Tesla Dashcam
footage into a single video.

When saving Tesla Dashcam footage a folder is created on the USB drive
for each event and within it multiple MP4 video files are created.
Currently the dashcam leverages up to six (6) cameras (front, rear, left
repeater, right repeater, left pillar, and right pillar) and will create
a file for each of them. Every minute is stored into a separate file as
well. This means that when saving dashcam footage there is a total of 40
files video files for every 10 minutes, each event of 10 minutes is put
into a separate folder.

Using this program, one can combine the 40 video files of an event into
one (1), and combine video of multiple events together. The layout of
the six (6) different cameras within the resulting video can be
determined by choosing one of the available layouts.

This program has multiple options providing a high level of flexibility
on the videos to process, cameras to include, layout of the resulting
videos, location, format, encoding, \.... See usage section below to
read upon all the possibilities.

**Video Input** provides options related to the source videos.

*Trigger Monitor* is to have processing of videos not start upon
execution of the program but instead be based on a trigger (i.e.
inserting the USB/SD card in the PC).

**Video Layout** provides parameters to define what the resulting video
should look like. There are 4 different layouts to choose from. This can
then be further adjusted by having the left/right cameras be in
perspective or not. Swap left/right or front/rear cameras, change the
scale for all cameras and/or for certain cameras, make left/right/rear
seem as if you were watching it through a mirror, or as if you turn your
head around and looking backwards.

**Camera Exclusion** exclude certain cameras from the resulting video.

**Timestamp** options allow you to define what the timestamp in the
resulting video should look like, or just to not have it display at all.

**Timestamp Restriction** provides with the possibility to only create a
video of the portion that are important. Instead of uploading a video
where the first 5 minutes is nothing, specify the start and end
timestamps to shorten the video to the important section instead.

**Event offsets** allows you to skip a portion from the start (and/or
the end) for each event.

**Video Output** then further defines what the output should look like.
Fast-forward through the Sentry video where nothing is happening, speed
up or slow down the video, \...

**Advanced encoding settings** allows you to further define additional
encoding settings

And **Update Check** will make sure you always have the latest version
available.

Check out the Usage section of this README to get more information on
all available parameters and what each does.

## Binaries

Stand-alone binaries can be retrieved from:

-   Windows:
    <https://github.com/ehendrix23/tesla_dashcam/releases/latest/download/tesla_dashcam.zip>
-   MacOS (OSX):
    <https://github.com/ehendrix23/tesla_dashcam/releases/latest/download/tesla_dashcam.dmg>

[ffmpeg](https://www.ffmpeg.org/legal.html) is included within the
respective package. ffmpeg is a separately licensed product under the
[GNU Lesser General Public License (LGPL) version 2.1 or
later](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html). FFmpeg
incorporates several optional parts and optimizations that are covered
by the GNU General Public License (GPL) version 2 or later. If those
parts get used the GPL applies to all of FFmpeg. For more information on
ffmpeg license please see: <https://www.ffmpeg.org/legal.html>

Windows binary of ffmpeg was downloaded from:
<https://www.gyan.dev/ffmpeg/builds/>

MacOS binary of ffmpeg was downloaded from: <https://ffmpeg.martin-riedl.de>

## Notes

The video files for the same minute between the cameras are not always
the same length. If there is a difference in their duration then the
background color (black by default) will be shown for the camera which
video ended before the others (within the minute). It is thus possible
within a video to see the background color for one of the cameras, and
then when that minute has passed for it to show video again.

The date and time shown within the video comes from the timestamp
embedded in the saved videos themselves, not from the filename. Date and
time shown within resulting videos is converted to timezone set upon the
PC it is being run on.

## Requirements

This package relies on [ffmpeg](https://ffmpeg.org) to be installed,
this is a free, open source cross-platform solution to convert video.
The created executables for Windows and MacOS include an ffmpeg version.
For Mac, download the latest: [ffmpeg](https://ffmpeg.martin-riedl.de)

If not using the executables (Windows and MacOS) then
[Python](https://www.python.org) 3.13.0 or higher is required.

## Installation

Downloading the respective bundle (ZIP for Windows, DMG for MacOS) and
unpacking this in a location of your choosing is sufficient to install
this.

If downloading the source files (i.e. for Linux) then Python has to be
installed as well. I recommend in that case to install the package from
pypi using pip to ensure all package requirements (except for ffmpeg)
are met.

This package is available from
[pypi](https://pypi.org/project/tesla-dashcam/).

Install from pypi is done through:

``` bash
python3 -m pip install tesla_dashcam
```

## Docker

Tesla Dashcam can also be run using Docker, which eliminates the need to
install Python, ffmpeg, and other dependencies directly on your system.

Three Docker images are available:

-   **Standard**: Basic CPU-only processing
-   **NVIDIA**: GPU-accelerated processing using NVIDIA CUDA
-   **VAAPI**: Hardware acceleration using Intel/AMD VAAPI
-   **gpu-latest**: Hardware acceleration using NVIDIA CUDA and
    Intel/AMD VAAPI with latest ffmpeg
-   **pre-release**: Latest pre-release of tesla_dashcam with hardware
    acceleration using NVIDIA CUDA and Intel/AMD VAAPI.

### Building Docker Images

``` bash
# Standard image
docker build -t tesla_dashcam .

# NVIDIA GPU support
docker build -f Dockerfile.nvidia -t tesla_dashcam:nvidia .

# VAAPI hardware acceleration
docker build -f Dockerfile.vaapi -t tesla_dashcam:vaapi .

# Latest FFMPEG
docker build -f Dockerfile.gpu-latest -t tesla_dashcam:gpu-latest .

# Latest tesla_dashcam pre-release
docker build -f Dockerfile.pre-release -t tesla_dashcam:pre-release .
```

### Running with Docker

Basic usage:

``` bash
# Process files from a USB drive mounted at /media/tesla
docker run --rm -v /media/tesla:/data -v $(pwd)/output:/output tesla_dashcam /data --output /output

# With NVIDIA GPU acceleration
docker run --rm --gpus all -v /media/tesla:/data -v $(pwd)/output:/output tesla_dashcam:nvidia /data --output /output --gpu --gpu_type nvidia

# With VAAPI hardware acceleration
docker run --rm --device /dev/dri -v /media/tesla:/data -v $(pwd)/output:/output tesla_dashcam:vaapi /data --output /output --gpu --gpu_type vaapi
```

Common Docker options:

-   `-v /source:/data`: Mount your TeslaCam footage directory to /data
    in the container
-   `-v /output:/output`: Mount your desired output directory
-   `--rm`: Remove container after execution
-   `--gpus all`: Enable NVIDIA GPU access (nvidia image only)
-   `--device /dev/dri`: Enable VAAPI device access (vaapi image only)

### Troubleshooting VAAPI

If you encounter errors like \"Failed to initialise VAAPI connection\"
when using the VAAPI image:

1.  Verify your system has Intel integrated graphics or AMD GPU with
    VAAPI support

2.  Check that `/dev/dri/renderD128` exists on your host system:

    ``` bash
    ls -l /dev/dri/
    ```

3.  Verify VAAPI works on your host system:

    ``` bash
    # Install vainfo on host if not present
    sudo apt-get install vainfo

    # Check VAAPI status
    vainfo
    ```

4.  Ensure your user has permission to access the render device. You may
    need to add your user to the `render` or `video` group:

    ``` bash
    sudo usermod -a -G render $USER
    sudo usermod -a -G video $USER
    # Log out and back in for group changes to take effect
    ```

5.  If the issue persists, try running the container with extended
    device access:

    ``` bash
    docker run --rm --device /dev/dri:/dev/dri --group-add video \
        -v /media/tesla:/data -v $(pwd)/output:/output \
        tesla_dashcam:vaapi /data /output --gpu --gpu_type vaapi
    ```

Example with additional tesla_dashcam options:

``` bash
docker run --rm \
    -v /media/tesla:/data \
    -v $(pwd)/output:/output \
    tesla_dashcam \
    --layout FULLSCREEN \
    --quality HIGH \
    --merge \
    /data/SavedClips \
    --output /output
```

## Usage

``` bash
usage: tesla_dashcam.py [-h] [--version] [--loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--ffmpeg_debug] [--temp_dir TEMP_DIR] [--no-notification] [--display_ts] [--skip_existing]
                        [--delete_source] [--exclude_subdirs] [--monitor] [--monitor_once] [--monitor_trigger MONITOR_TRIGGER]
                        [--layout {MOSAIC,FULLSCREEN,PERSPECTIVE,CROSS,DIAMOND,HORIZONTAL}] [--perspective] [--scale CLIP_SCALE [CLIP_SCALE ...]] [--mirror] [--rear] [--swap] [--no-swap]
                        [--swap_frontrear] [--background BACKGROUND] [--title_screen_map] [--no-front] [--no-left] [--no-right] [--no-rear] [--no-left-pillar] [--no-right-pillar] [--no-timestamp]
                        [--halign {LEFT,CENTER,RIGHT}] [--valign {TOP,MIDDLE,BOTTOM}] [--font FONT] [--fontsize FONTSIZE] [--fontcolor FONTCOLOR]
                        [--text_overlay_fmt TEXT_OVERLAY_FMT] [--timestamp_format TIMESTAMP_FORMAT] [--start_timestamp START_TIMESTAMP] [--end_timestamp END_TIMESTAMP]
                        [--start_offset START_OFFSET] [--end_offset END_OFFSET] [--sentry_offset] [--sentry_start_offset START_OFFSET] [--sentry_end_offset END_OFFSET] [--output OUTPUT] [--motion_only] [--slowdown SLOW_DOWN] [--speedup SPEED_UP]
                        [--chapter_offset CHAPTER_OFFSET] [--merge [MERGE_GROUP_TEMPLATE]] [--merge_timestamp_format MERGE_TIMESTAMP_FORMAT] [--keep-intermediate] [--keep-events]
                        [--set_moviefile_timestamp {START,STOP,SENTRY,RENDER}] [--no-gpu] [--gpu] [--gpu_type {nvidia,intel,qsv,rpi,vaapi}] [--no-faststart]
                        [--quality {LOWEST,LOWER,LOW,MEDIUM,HIGH}] [--compression {ultrafast,superfast,veryfast,faster,fast,medium,slow,slower,veryslow}] [--fps FPS]
                        [--ffmpeg FFMPEG] [--encoding {x264,x265}] [--enc ENC] [--check_for_update] [--no-check_for_update] [--include_test]
                        [source [source ...]]

tesla_dashcam - Tesla DashCam & Sentry Video Creator

positional arguments:
  source                Folder(s) (events) containing the saved camera files. Filenames can be provided as well to manage individual clips. (default: None)

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Logging level. (default: INFO)
  --ffmpeg_debug        Will enable outputting FFMPEG messages when loglevel is set to debug
  --temp_dir TEMP_DIR   Path to store temporary files. (default: None)
  --no-notification     Do not create a notification upon completion. (default: True)
  --display_ts          Display timestamps on tesla_dashcam text output. DOES NOT AFFECT VIDEO OUTPUT. (default: False)

Video Input:
  Options related to what clips and events to process.

  --skip_existing       Skip creating encoded video file if it already exist. Note that only existence is checked, not if layout etc. are the same. (default: False)
  --delete_source       Delete the processed files upon completion. (default: False)
  --exclude_subdirs     Do not search sub folders (events) for video files to process. (default: False)

Trigger Monitor:
  Parameters for monitoring of insertion of TeslaCam drive, folder, or file existence.

  --monitor             Enable monitoring for drive to be attached with TeslaCam folder. (default: False)
  --monitor_once        Enable monitoring and exit once drive with TeslaCam folder has been attached and files processed. (default: False)
  --monitor_trigger MONITOR_TRIGGER
                        Trigger file to look for instead of waiting for drive to be attached. Once file is discovered then processing will start, file will be deleted when
                        processing has been completed. If source is not provided then folder where file is located will be used as source. (default: None)

Video Layout:
  Set what the layout of the resulting video should be

  --layout {MOSAIC,FULLSCREEN,PERSPECTIVE,CROSS,DIAMOND,HORIZONTAL}
                        Layout of the created video.
                            FULLSCREEN: Front camera center top with side and rear cameras smaller underneath it.
                            MOSAIC: Front and rear cameras on top with pillars and side cameras smaller underneath it.
                            PERSPECTIVE: Similar to FULLSCREEN but then with pillar and repeater cameras in perspective.
                            CROSS: Front camera center top, pillar cameras underneath, then repeater cameras underneath, and rear camera center bottom.
                            DIAMOND: Front camera center top, pillar cameras on left/right of front smaller, side cameras below on left/right of rear smaller, and rear camera center bottom.
                            HORIZONTAL: All cameras in horizontal line: left, left pillar, front, rear, right pillar, right.
                        (default: FULLSCREEN)
  --camera_position CLIP_POS [CLIP_POS ...]
                        Set camera clip position within video. Selecting this will override the layout selected!
                        The camera clip scale will be set to 1280x960, use scale to adjust accordingly.
                        Default layout is:
                            Front: 0x0
                            Rear: <front x-pos + width>x0
                            Left Pillar: 0x<max(front y-pos + height,rear y-pos + height)>
                            Right Pillar: <left pillar x-pos + width>x<max(front y-pos + height,rear ypos + height)>
                            Left: 0x<max(<left pillar y-pos + height>, <right pillar y-pos + height>
                            Right: <left-pillar x-pos + width>x<max(<left pillar y-pos + height>, <right pillar y-pos + height>
                        Using this together with argument camera_order allows one to completely customize the layout
                        Note that layout chosen also determines camera clip size and thus default position. See scale for respective sizing.
                        Further, changing the scale of a camera clip would further impact potential positioning.for example:
                          --camera_position camera=left 640x480                          Position left camera at 640x480
                          --camera_position camera=right x_pos=640                        Position right camera at x-position 640, y-position based on layout
                          --camera_position camera=front y_pos=480                        Position front camera at x-position based on layout, y-position at 480
                          --camera_position camera=rear  1280x960                        Position rear camera at 1280x960
                          --camera_position camera=left_pillar 0x960                     Position left pillar camera at 0x960
                        (default: None)
  --camera_order CLIP_ORDER
                        Determines the order of processing the camera. Normally this is not required unless there is overlap.
                        When using argument camera_position it is possible to overlap cameras partially or completely, by then
                        leveraging this argument one can determine which camera will be on top and which one will be bottom. Default order is: left, right, front, rear, left_pillar, right_pillar. If there is no overlap then the order does not matter.
                        If not all cameras are specified then default order will be followed for those not specified, and thus be more on top.for example:
                          --camera_order front,rear,left,right,left_pillar,right_pillar    Makes it that right_pillar will be on top, then left_pillar, then right, then left, then rear, and front at the bottom.
                        (default: front,rear,left,right,left_pillar,right_pillar)                            
  --perspective         Show side cameras in perspective. (default: False)
  --scale CLIP_SCALE [CLIP_SCALE ...]
                        Set camera clip scale for all clips, scale of 1 is 1280x960 camera clip.
                        If provided with value then it is default for all cameras, to set the scale for a specific camera provide camera=<front, left, right,rear> <scale>
                        for example:
                          --scale 0.5                                             all are 640x480
                          --scale 640x480                                         all are 640x480
                          --scale 0.5 --scale camera=front 1                      all are 640x480 except front at 1280x960
                          --scale camera=left .25 --scale camera=right 320x240    left and right are set to 320x240
                        Defaults:
                          MOSAIC: 1/2 (all cameras 640x480 base, front/rear boosted to 1216x912, video is 2496x1824)
                            FULLSCREEN: 1/2 (640x480, video is 1920x960)
                            CROSS: 1/2 (640x480, video is 1280x1920)
                            DIAMOND: 1/2 (640x480, video is 2560x1920)
                            HORIZONTAL: 1/2 (640x480, video is 3840x480)
                        (default: None)
  --mirror              Video from side and rear cameras as if being viewed through the mirror. Default when not providing parameter --no-front. Cannot be used in combination with
                        --rear. (default: None)
  --rear                Video from side and rear cameras as if looking backwards. Default when providing parameter --no-front. Cannot be used in combination with --mirror. (default:
                        None)
  --swap                Swap left and right cameras in output, default when side and rear cameras are as if looking backwards. See --rear parameter. (default: None)
  --no-swap             Do not swap left and right cameras, default when side and rear cameras are as if looking through a mirror. Also see --mirror parameter (default: None)
  --swap_frontrear      Swap front and rear cameras in output. (default: False)
  --swap_pillar         Swap left- and right pillar cameras in output. (default: False)
  --background BACKGROUND
                        Background color for video. Can be a color string or RGB value. Also see --fontcolor. (default: black)
  --title_screen_map    Show a map of the event location for the first 3 seconds of the event movie, when merging events it will also create map with lines linking the events (default: False)

Camera Exclusion:
  Exclude one or more cameras:

  --no-front            Exclude front camera from video. (default: False)
  --no-left             Exclude left camera from video. (default: False)
  --no-right            Exclude right camera from video. (default: False)
  --no-rear             Exclude rear camera from video. (default: False)
  --no-left-pillar      Exclude left pillar camera from video. (default: False)
  --no-right-pillar     Exclude right pillar camera from video. (default: False)

Text Overlay:
  Options on how to show text in resulting video:

  --no-timestamp        Do not show timestamp in video (default: False)
  --halign {LEFT,CENTER,RIGHT}
                        Horizontal alignment for timestamp (default: None)
  --valign {TOP,MIDDLE,BOTTOM}
                        Vertical Alignment for timestamp (default: None)
  --font FONT           Fully qualified filename (.ttf) to the font to be chosen for timestamp. (default: /Library/Fonts/Arial Unicode.ttf)
  --fontsize FONTSIZE   Font size for timestamp. Default is scaled based on resulting video size. (default: None)
  --fontcolor FONTCOLOR
                        Font color for timestamp. Any color is accepted as a color string or RGB value.
                        Some potential values are:
                            white
                            yellowgreen
                            yellowgreen@0.9
                            Red
                        :    0x2E8B57
                        For more information on this see ffmpeg documentation for color: https://ffmpeg.org/ffmpeg-utils.html#Color (default: white)
  --text_overlay_fmt TEXT_OVERLAY_FMT
                        Format string for text overlay.
                        Valid format variables:
                            {clip_start_timestamp} - Local time the clip starts at
                            {clip_end_timestamp} - Local time the clip ends at
                            {local_timestamp_rolling} - Local time which continuously updates (shorthand for '%{{pts:localtime:{local_timestamp}:%x %X}}'), string
                            {event_timestamp} - Timestamp from events.json (if provided), string
                            {event_timestamp_countdown_rolling} - Local time which continuously updates (shorthand for '%{{hms:localtime:{event_timestamp}}}'), string
                            {event_city} - City name from events.json (if provided), string
                            {event_street} - Street name from events.json (if provided), string
                            {event_reason} - Recording reason from events.json (if provided), string
                            {event_latitude} - Estimated latitude from events.json (if provided), float
                            {event_longitude} - Estimated longitude from events.json (if provided), float

                            All valid ffmpeg 'text expansion' syntax is accepted here.
                            More info: http://ffmpeg.org/ffmpeg-filters.html#Text-expansion
                        (default: {local_timestamp_rolling})
  --timestamp_format TIMESTAMP_FORMAT
                        Format for timestamps.
                        Determines how timestamps should be represented. Any valid value from strftime is accepted.Default is set '%x %X' which is locale's appropriate date and time representationMore info: https://strftime.org (default: %x %X)

Timestamp Restriction:
  Restrict video to be between start and/or end timestamps. Timestamp to be provided in a ISO-8601 format (see https://fits.gsfc.nasa.gov/iso-time.html for examples)

  --start_timestamp START_TIMESTAMP
                        Starting timestamp (default: None)
  --end_timestamp END_TIMESTAMP
                        Ending timestamp (default: None)

Event offsets:
  Start and/or end offsets for events

  --start_offset START_OFFSET
                        Set starting time for resulting video. Default is 0 seconds, 60 seconds if --sentry_offset is provided. (default: None)
  --end_offset END_OFFSET
                        Set ending time for resulting video. Default is 0 seconds, 30 seconds if --sentry_offset is provided. (default: None)
  --sentry_offset       start_offset and end_offset will be based on when timestamp of object detection occurred for Sentryevents instead of start/end of event. (default: False)
                        Legacy setting, will be removed in future.
  --sentry_start_offset START_OFFSET
                        Set starting time for resulting video of Sentry events only based on object detected for Sentryevents. (default: None)
  --sentry_end_offset END_OFFSET
                        Set ending time for resulting video of Sentry events only based on object detected for Sentryevents. (default: None)

Video Output:
  Options related to resulting video creation.

  --output OUTPUT       Path/Filename for the new movie file. Event files will be stored in same folder.
                        (default: /Users/ehendrix/Movies/Tesla_Dashcam/)
  --motion_only         Fast-forward through video when there is no motion. (default: False)
  --slowdown SLOW_DOWN  Slow down video output. Accepts a number that is then used as multiplier, providing 2 means half the speed.
  --speedup SPEED_UP    Speed up the video. Accepts a number that is then used as a multiplier, providing 2 means twice the speed.
  --chapter_offset CHAPTER_OFFSET
                        Offset in seconds for chapters in merged video. Negative offset is # of seconds before the end of the subdir video, positive offset if # of seconds after the
                        start of the subdir video. (default: 0)
  --merge [MERGE_GROUP_TEMPLATE]
                        Merge the video files from different folders (events) into 1 big video file.
                        Optionally add a template string to group events in different video files based on the template.
                        Valid format variables:
                            {layout} - Layout of the created movie (see --layout)
                            {start_timestamp} - Local time the event started at
                            {end_timestamp} - Local time the event ends at        
                            {event_timestamp} - Timestamp from events.json (if provided), string
                            {event_city} - City name from events.json (if provided), string
                            {event_street} - Street name from events.json (if provided), string
                            {event_reason} - Recording reason from events.json (if provided), string
                            {event_latitude} - Latitude from events.json (if provided), float
                            {event_longitude} - Longitude from events.json (if provided), float        
  --merge_timestamp_format MERGE_TIMESTAMP_FORMAT
                        Format for timestamps in merge_template.
                        Determines how timestamps should be represented within merge_template. Any valid value from strftime is accepted.Default is set '%Y-%m-%d_%H_%M'More info: https://strftime.org (default: %Y-%m-%d_%H_%M)
  --keep-intermediate   Do not remove the clip video files that are created (default: False)
  --keep-events         Do not remove the event video files that are created when merging events into a video file (see --merge) (default: False)
  --set_moviefile_timestamp {START,STOP,SENTRY,RENDER}
                        Match modification timestamp of resulting video files to event timestamp. Use START to match with when the event started, STOP for end time of the event,
                        SENTRY for Sentry event timestamp, or RENDER to not change it. (default: START)

Advanced encoding settings:
  Advanced options for encoding

  --no-gpu              Disable use of GPU acceleration. Default on Non-MACs.
  --gpu                 Use GPU acceleration. Default on Macs.                            
                        --gpu_type has to be provided as well on Non-Macs when enabling this parameter (default: False)
  --gpu_type {nvidia,intel,qsv,rpi,vaapi}
                        Type of graphics card (GPU) in the system. This determines the encoder that will be used.This parameter is mandatory if --gpu is provided on Non-Macs. (default: None)
  --no-faststart        Do not enable flag faststart on the resulting video files. Use this when using a network share and errors occur during encoding. (default: False)
  --quality {LOWEST,LOWER,LOW,MEDIUM,HIGH}
                        Define the quality setting for the video, higher quality means bigger file size but might not be noticeable. (default: LOWER)
  --compression {ultrafast,superfast,veryfast,faster,fast,medium,slow,slower,veryslow}
                        Speed to optimize video. Faster speed results in a bigger file. This does not impact the quality of the video, just how much time is used to compress it.
                        (default: medium)
  --fps FPS             Frames per second for resulting video. Tesla records at about 33fps hence going higher wouldn't do much as frames would just be duplicated. Default is 24fps
                        which is the standard for movies and TV shows (default: 24)
  --ffmpeg FFMPEG       Path and filename for ffmpeg. Specify if ffmpeg is not within path. (default: /Users/ehendrix-
                        personal/Documents_local/GitHub/tesla_dashcam/tesla_dashcam/ffmpeg)
  --encoding {x264,x265}
                        Encoding to use for video creation.
                            x264: standard encoding, can be viewed on most devices but results in bigger file.
                            x265: newer encoding standard but not all devices support this yet.
  --enc ENC             Provide a custom encoder for video creation. Cannot be used in combination with --encoding.
                        Note: when using this option the --gpu option is ignored. To use GPU hardware acceleration specify an encoding that provides this.

Update Check:
  Check for updates

  --check_for_update    Check for update and exit. (default: False)
  --no-check_for_update
                        A check for new updates is performed every time. With this parameter that can be disabled (default: False)
  --include_test        Include test (beta) releases when checking for updates. (default: False)
```

## Positional Argument

Source does not have a specific parameter. Just provide the folder(s) to
be scanned and processed. One can provide folder(s) and/or file(s) here.
Source is not mandatory, if not provided then the default will be
SavedClips and SentryClips. The path searches for SavedClips and
SentryClips will depend if there was a Trigger Monitor parameter
provided or not. If source is not provided and no Trigger Monitor
provided then \--monitor_once will be enabled with SavedClips and
SentryClips.

## Optional Arguments

These are some other optional arguments that don\'t change in what will
be processed, how, layout, resulting video file or so.

*-h or \--help*

 Show the help message and exit.

*\--version*

 Show the version number of the program and exit.

*\--loglevel \<level\>*

 Log level for additional output. Currently only used for DEBUG,
 providing any other value will not change anything.

*\--ffmpeg_debug*

 Include ffmpeg output when log level is set to DEBUG, otherwise has no
 effect.

*\--temp_dir \<path\>*

 Temporary path to store the temporary (intermediate) clip video files.
 When processing a temporary video file is created for each minute
 within an event folder combining the different cameras together. Then
 these temporary video files are merged together to produce the
 resulting event video file. By default the temporary clip video files
 will be stored in the same folder as specified where the resulting
 video file will be stored. Using this parameter one can thus specify
 another folder instead. Can be especially helpful when the resulting
 videos are being stored on a network share as one can then specify a
 local drive that would be faster for the temporary files.

*\--no-notification*

 Upon completion a notification is provided on the screen that
 processing is completed. Use this parameter to disable this
 notification.

*\--display_ts*

 Add timestamp to the text output procuded.

## Video Input

Following options are to manage what should be processed and what to do
once processed.

*\--skip_existing*

 Default: False

 By default if a resulting video files already exist then it will be
 overwritten (except with \--monitor). By providing this parameter if
 the resulting video file already exist then it will not be recreated.
 Note that this only checks for existence of the video file and not if
 the layout etc. of that video file matches current selection.

*\--delete_source*

 Default: False

 Delete the clips (files) and events (folders) on the source once
 processing has been completed.

*\--exclude_subdirs*

 Default: False

 Do not scan any subfolders within the source provided for valid clips.

## Trigger Monitor

When the program is executed the provide source folders are being
scanned for events and clip files, processed, and then the program
exits. Using these parameters it is possible however to start the
program before the SD or USB has been inserted and have it wait. It can
then be set to wait again after first time processing or to stop.

*\--monitor*

 Default: False

 Monitor for drive to be attached that has the TeslaCam folder in its
 root. If not already one attached then wait till one is attached. Once
 a drive with the TeslaCam folder is attached processing will start
 based on the source provided. If no source was provided then all
 events within SavedClips and SentryClips will be processed instead. To
 have it process all 3 folders then provide the following for source:

 SavedClips SentryClips RecentClips

 After processing the program will wait until the drive has been
 ejected from the system. Once ejected it will start monitoring again
 for a drive to be attached. This loop will continue until stopped with
 CTRL-C.

*\--monitor_once*

 Default: False

 This is the same as \--monitor however instead of waiting for the
 drive to be ejected after processing the program will stop.

*\--monitor_trigger \<File or folder\>*

 Monitor for existence of a folder (or file) instead of a drive with
 TeslaCam folder. Once the file (or folder) exist then processing will
 start. If source is provided then that will be used for scanning for
 events and clips. If no source was provided then the path provided for
 this parameter will be used as source instead. If the provided source
 is a relative path (i.e. Tesla/MyVideos) then it will be relative
 based on the location of the trigger file/path.

 Upon completion, if a trigger file was provided then that file will be
 deleted and the program will wait again until the trigger file exist
 again. If a trigger folder was provided then the program will wait
 until this folder has been removed. Then it will start monitoring
 again for existence for this folder.

## Video Layout

The layout of the resulting video can be adjusted in many ways through
multiple parameters. Parameter \--layout specifies where each camera
clip should be placed within the resulting video. (see above for
examples).

*\--layout*

 Default: FULLSCREEN

-   FULLSCREEN: Resolution: 1920x960
```
    +---------------+----------------+----------------+
    |               | Front Camera   |                |
    +---------------+----------------+----------------+
    | Left Camera   |  Rear Camera   |  Right Camera  |
    +---------------+----------------+----------------+
```
-   MOSAIC: Resolution: 2496x1824

    Shows all 6 cameras with front and rear cameras having larger
    dimensions (1.3x boost) to provide better detail. Replaces the
    legacy WIDESCREEN layout.
```
    +-------------+-------------------------+--------------+
    +-------------+                         +--------------+
    | Left Pillar |       Front Camera      | Right Pillar |
    +-------------+                         +--------------+
    +-------------+-------------------------+--------------+
    +-------------+                         +--------------+
    | Left Camera |       Rear Camera       | Right Camera |
    +-------------+                         +--------------+
    +-------------+-------------------------+--------------+
```
-   CROSS: Resolution: 1280x1920
```
    +---------------+----------------+----------------+
    |               | Front Camera   |                |
    +---------------+----------------+----------------+
    |     Left Pillar      |       Right Pillar       |
    +---------------+----------------+----------------+
    |     Left Camera      |       Right Camera       |
    +---------------+----------------+----------------+
    |               | Rear Camera    |                |
    +---------------+----------------+----------------+
```
-   DIAMOND: Resolution: 2560x1920

```
    +---------------+----------------+----------------+
    |               |                |                |
    +---------------+  Front Camera  +----------------+
    |   Left Pillar |                |  Right Pillar  |
    +---------------+----------------|----------------+
    +   Left Camera +  Rear Camera   |  Right Camera  |
    |---------------|                |----------------|
    +---------------+----------------+----------------+
```
-   HORIZONTAL: Resolution: 3840x480
```
    +----------+-----------+-----------+-----------+-----------+----------+
    |   Left   |   Left    |   Front   |   Rear    |   Right   |  Right   |
    |  Camera  |  Pillar   |  Camera   |  Camera   |  Pillar   |  Camera  |
    +----------+-----------+-----------+-----------+-----------+----------+
```
*\--camera_position*

 Default: None

 This allows one to specify the position of each camera clip within the
 resulting video. This will override the layout selected with
 \--layout. The default position is based on the layout selected, but
 can be changed to any position desired. The scale of the camera clips
 will be set to 1280x960, use \--scale to adjust accordingly.

 For example, to have the pillar, repeater, and rear cameras to overlap
 with the front camera, with left pillar upper left, right pillar upper
 right, left lower left, rear camera lower center (widescreen), and
 right lower right. Note: scale is used as well to adjust the camera
 clips to the desired size.

 \--scale 320x240 \--camera_position camera=front 0x0 \--scale
 camera=front 1280x960 \--camera_position camera=rear 320x720 \--scale
 camera=rear 640x240 \--camera_position camera=left_pillar 0x0
 \--camera_position camera=right_pillar 960x0 \--camera_position
 camera=left 0x720 \--camera_position camera=right 960x720

 This will then result in the following layout: Resolution: 1280x1440 :

>     +-------------+--------------------+--------------+
>     | Left Pillar |                    | Right Pillar |
>     +-------------+                    +--------------+
>     |                  Front Camera                   |
>     +-------------+--------------------+--------------+
>     | Left Camera |    Rear Camera     | Right Camera |
>     +-------------+--------------------+--------------+

*\--camera_order*

 Default: front,rear,left,right,left_pillar,right_pillar

 This allows one to specify the order of the camera clips within the
 resulting video. This is especially useful when using
 \--camera_position to overlap camera clips. If not all cameras are
 specified then the default order will be followed for those not
 specified.

 For example:

 \--camera_order front,rear,left,right,left_pillar,right_pillar

 This will result in the front camera being on top, then rear, then
 left, then right, then left pillar, and finally right pillar.

*\--perspective*

 Default: False

 Show the side cameras in perspective mode.

*\--scale*

 This can then be further adjusted by changing the scale for all
 cameras or changing the scale for one or more making them smaller or
 bigger then the others. This is done with the \--scal