Skip to content

Commit

Permalink
Release 0.1.17 (#164)
Browse files Browse the repository at this point in the history
Release 0.0.17

- New: 
    - Option --text_overlay_fmt to set the overlay text for the video. Contributed by JakeShirley
    - Option --timestamp_format for formatting timestamps.
    - Option --sentry_offset to set the start and end offset based on Sentry event timestamp.
    - Option --merge_template to allow merging of video files grouped based on this. Resulting movie filename will be based on this template.
    - Option --set_moviefile_timestamp to set the video file timestamp on the OS to start, end, or time of Sentry event.
    - Option --keep-events to keep event video files after they have been merged into a video.
    - Option --display_ts to show timestamps in the text output. This does not impact video output but is handy when using a monitor option. Contributed by croadfeldt
    - Option --title_screen_map, which generates a map of the event location and displays it for the first 3 seconds of the movie.
    - Added support for event information file and ability to display it in the overlay text. Contributed by JakeShirley
    - Support for FreeBSD 11. Contributed by busbyjon
    - Source can now include wildcards, shell variables, and will do user expansion (i.e. ~ on Unix, ~user on Windows).
    - Output and temp_dir can now include shell variables and will do user expansion (i.e. ~ on Unix, ~user on Windows).
    - Metadata tag title in video file is now set to reason for event (if exist) and timestamp or start/end timestamp
    - Metadata tag creation_time in video files created is now set to start timestamp of that particular video.
    - When scanning folders a message will be printed after every 10 folders scanned to show progress.
    - --gpu and --no-gpu are now valid arguments irrespective of platform.  
    - event and final movie files will now include GPS coordinates with the location for an event. For movies this will be for the 1st event within the movie.

- Changed:    
    - Improvement for Docker file size and stability. Contributed by magicalyak
    - Choice values for parameters (i.e. FULLSCREEN, intel, black) are now case-insensitive.
    - Updated supporting libraries to latest available.
    
- Fixed:
    - When providing an invalid start or end timestamp will now result in a error instead of a traceback.
    - Added x265 compatibility tag for QuickTime. Contributed by dburkland
    - Event file will now be removed when providing an output file and only 1 event is processed, leaving only 1 movie file.
    - Providing a mount as a source resulted in it no files found. Now when a mount is provided it will be handled same as folders.
  • Loading branch information
ehendrix23 authored Aug 21, 2021
1 parent 6d58719 commit e0a4d9d
Show file tree
Hide file tree
Showing 28 changed files with 6,673 additions and 982 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ dev, Master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ dev ]
schedule:
- cron: '28 17 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
20 changes: 14 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ __pycache__/
# Distribution / packaging
.Python
build/
.build/
_build/
develop-eggs/
dist/
downloads/
Expand All @@ -24,7 +26,6 @@ wheels/
.installed.cfg
*.egg
MANIFEST
bundles/

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down Expand Up @@ -87,7 +88,7 @@ celerybeat-schedule
.venv
env/
venv/
venv3.7/
venv*/
.idea/
ENV/
env.bak/
Expand All @@ -103,8 +104,15 @@ venv.bak/
# mkdocs documentation
/site

# mypy
.mypy_cache/
# tesla_dashcam
.DS_Store
tesla_dashcam/ffmpeg
tesla_dashcam/ffmpeg.exe
ffmpeg
ffmpeg_x64
ffmpeg_arm
ffmpeg.exe
tesla_dashcam.exe
bundles/MacOS/tesla_dashcam/tesla_dashcam
tesla_dashcam*.dmg
*.zip
bundles/MacOS/tesla_dashcam/Tesla_Dashcam - README.html
bundles/Windows/tesla_dashcam/Tesla_Dashcam - README.html
26 changes: 19 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
FROM python:3

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y ffmpeg tzdata fonts-freefont-ttf && apt-get autoremove && apt-get clean
FROM ehendrix23/ffmpeg-alpine:4.0-buildstage as build-stage
FROM python:3-alpine

COPY --from=build-stage /tmp/fakeroot/bin /usr/local/bin
COPY --from=build-stage /tmp/fakeroot/share /usr/local/share
COPY --from=build-stage /tmp/fakeroot/include /usr/local/include
COPY --from=build-stage /tmp/fakeroot/lib /usr/local/lib

WORKDIR /usr/src/app/tesla_dashcam
ADD . .

RUN apk add --no-cache --update gcc libc-dev linux-headers \
&& apk add --no-cache --update tzdata ttf-freefont libnotify \
&& mkdir /usr/share/fonts/truetype \
&& ln -s /usr/share/fonts/TTF /usr/share/fonts/truetype/freefont

COPY . /usr/src/app/tesla_dashcam
RUN pip install -r requirements.txt
ENV PYTHONUNBUFFERED=true

ENTRYPOINT [ "python", "tesla_dashcam/tesla_dashcam.py" ]
# Enable Logs to show on run
ENV PYTHONUNBUFFERED=true
# Provide a default timezone
ENV TZ=America/New_York

ENTRYPOINT [ "python3", "tesla_dashcam/tesla_dashcam.py" ]
45 changes: 45 additions & 0 deletions Preference_Files/CROSS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Execute using:
# tesla_dashcam <Location of video files> --output <Location to store encoded video files> @CROSS.txt

# Skip if encoded file already exist.
# --skip_existing

# Delete processed files when video file is encoded.
# --delete_source

# CROSS Layout
--layout CROSS

# Put clip info bottom left
--halign LEFT --valign BOTTOM

# Output event reason, event date/time, event city, # seconds till event, and date/time
--text_overlay_fmt "Reason: {event_reason}\nEvent: {event_timestamp}\nCity: {event_city}\nCountdown: {event_timestamp_countdown_rolling}\nDate/Time: {local_timestamp_rolling}"


# Set timestamp format to: Weekday abbreviated, day (without leading zero) Month abbreviated Year at Hour:Minute:SecondAM(or PM)
--timestamp_format "%a, %d %b %Y at %I:%M:%S%p"

# Fast forward through portions where there is no motion detected
--motion_only

# Encode with x265
--encoding x265

# Set start offset to 60 seconds before the event
--start_offset -60

# Make it so that offset is only for Sentry and based on when the sentry event occurred.
--sentry_offset

# Set the movie timestamp to SENTRY event
--set_moviefile_timestamp SENTRY

# Merge files together
--merge "{layout} {start_timestamp} - {event_reason} - {event_city}"

# --merge_timestamp_format "%Y-%m-%d"
--merge_timestamp_format "%Y-%m"

# Create map
--title_screen_map
45 changes: 45 additions & 0 deletions Preference_Files/CROSS_PERSPECTIVE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Execute using:
# tesla_dashcam <Location of video files> --output <Location to store encoded video files> @CROSS_PERSPECTIVE.txt

# Skip if encoded file already exist.
--skip_existing

# Delete processed files when video file is encoded.
# --delete_source

# CROSS Layout
--layout CROSS

# Left and Right cameras in perspective
--perspective

# Put clip info bottom left
--halign LEFT --valign BOTTOM

# Output city and rolling timestamp
--text_overlay_fmt "City: {event_city}\nDate/Time: {local_timestamp_rolling}"

# Fast forward through portions where there is no motion detected
--motion_only

# Encode with x265
--encoding x265

# Set start offset to 30 seconds before the event
--start_offset -30

# Set end offset to 60 seconds after event
--end_offset 60

# Make it so that offset is only for Sentry and based on when the sentry event occurred.
--sentry_offset

# Merge files together
--merge "{layout} {event_timestamp} - {event_reason} - {event_city}"

# Set timestamp to be year/month
--merge_timestamp_format "%Y-%m"

# Create map
--title_screen_map

35 changes: 35 additions & 0 deletions Preference_Files/DIAMOND.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Execute using:
# tesla_dashcam <Location of video files> --output <Location to store encoded video files> @DIAMOND.txt

# Skip if encoded file already exist.
--skip_existing

# Delete processed files when video file is encoded.
# --delete_source

# DIAMOND Layout
--layout DIAMOND

# Put clip info top right
--halign RIGHT --valign TOP

# Output city and timestamp
--text_overlay_fmt "City: {event_city}\nDate/Time: {local_timestamp_rolling}"

# Fast forward through portions where there is no motion detected
--motion_only

# Encode with x265
--encoding x265

# Set start offset to 120 seconds
--start_offset 120

# Merge files together
--merge

# Merge files together
--merge_timestamp_format "%Y-%m"

# Create map
--title_screen_map
32 changes: 32 additions & 0 deletions Preference_Files/DIAMOND_PERSPECTIVE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Execute using:
# tesla_dashcam <Location of video files> --output <Location to store encoded video files> @DIAMOND_PERSPECTIVE.txt

# Skip if encoded file already exist.
--skip_existing

# Delete processed files when video file is encoded.
# --delete_source

# DIAMOND Layout
--layout DIAMOND

# Left and Right cameras in perspective
--perspective

# Put clip info top right
--halign RIGHT --valign TOP

# Output city and timestamp
--text_overlay_fmt "City: {event_city}\nDate/Time: {local_timestamp_rolling}"

# Fast forward through portions where there is no motion detected
--motion_only

# Encode with x265
--encoding x265

# Set end offset to 120 seconds
--end_offset -120

# Merge files together
--merge
29 changes: 29 additions & 0 deletions Preference_Files/FULLSCREEN.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Execute using:
# tesla_dashcam <Location of video files> --output <Location to store encoded video files> @FULLSCREEN.txt

# Skip if encoded file already exist.
--skip_existing

# Delete processed files when video file is encoded.
# --delete_source

# FULLSCREEN Layout
--layout FULLSCREEN

# Put clip info in upper left
--halign LEFT --valign TOP

# Output reason for save, city, and rolling timestamp (each on new line)
--text_overlay_fmt "Saved Reason: {event_reason}\nCity: {event_city}\nDate/Time: {local_timestamp_rolling}"

# Fast forward through portions where there is no motion detected
--motion_only

# Encode with x265
--encoding x265

# Merge files together
--merge "{layout} {end_timestamp} - {event_reason} - {event_city}"

# Create map
--title_screen_map
30 changes: 30 additions & 0 deletions Preference_Files/FULLSCREEN_REAR.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Execute using:
# tesla_dashcam <Location of video files> --output <Location to store encoded video files> @FULLSCREEN_REAR.txt

# Skip if encoded file already exist.
--skip_existing

# Delete processed files when video file is encoded.
# --delete_source

# FULLSCREEN Layout
--layout FULLSCREEN

# Show left & right cameras as looking backwards instead of through a mirror
--rear

# Put clip info in upper left
--halign LEFT --valign TOP

# Output reason for save, city, and rolling timestamp (each on new line)
--text_overlay_fmt "Saved Reason: {event_reason}\nCity: {event_city}\nDate/Time: {local_timestamp_rolling}"

# Fast forward through portions where there is no motion detected
--motion_only

# Encode with x265
--encoding x265

# Merge files together
--merge "{layout} {event_timestamp} - {event_reason} - {event_city}"

Loading

0 comments on commit e0a4d9d

Please sign in to comment.