Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.1.16 #103

Merged
merged 42 commits into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
87ca2af
Release 0.1.13 (#72) (#73)
ehendrix23 Sep 26, 2019
2836135
Provide more clarity with font file and ffmpeg
ehendrix23 Sep 27, 2019
5ddad40
Merge branch 'dev' of https://github.com/ehendrix23/tesla_dashcam int…
ehendrix23 Sep 27, 2019
18d9d80
Cleanup
ehendrix23 Sep 27, 2019
03d2578
Release 0.1.13 (#72) (#75)
ehendrix23 Sep 27, 2019
431b5c7
Updates for fixing if font file exist
ehendrix23 Sep 30, 2019
64d4e86
rear cam filename fix (#76)
dantidote Sep 30, 2019
160ab86
Fix missing python-dateutil with PIP install
ehendrix23 Sep 30, 2019
02957df
Fix missing fonts in Docker image (#79)
moorecp Sep 30, 2019
3e2605d
Set version to 0.1.15
ehendrix23 Sep 30, 2019
58afb24
Merge branch 'dev' of https://github.com/ehendrix23/tesla_dashcam int…
ehendrix23 Sep 30, 2019
1599ff8
Fix for multiple source with MONITOR or MONITOR_ONCE
ehendrix23 Oct 1, 2019
0c29d49
Reduce motion sensitivity
ehendrix23 Oct 1, 2019
7f93458
Remove print
ehendrix23 Oct 1, 2019
308207f
Merge branch 'master' into dev
ehendrix23 Oct 1, 2019
a9cf240
Fix defaults for rear, mirror, swap
ehendrix23 Oct 3, 2019
0de8d8c
Merge branch 'dev' of https://github.com/ehendrix23/tesla_dashcam int…
ehendrix23 Oct 3, 2019
8b87da5
Change download link to latest
ehendrix23 Oct 5, 2019
f03698a
updating text since there are now 4 cameras (#83)
jamesmanning Oct 7, 2019
03e3539
fix for example value when setting marker (#84)
jamesmanning Oct 7, 2019
c8cc6ac
Layout improvements
ehendrix23 Oct 8, 2019
8028cd1
Merge branch 'dev' of https://github.com/ehendrix23/tesla_dashcam int…
ehendrix23 Oct 8, 2019
c6759d5
Fix issue swap left/rear; add swapp front/rear
ehendrix23 Oct 8, 2019
2409e41
Updated readme with new option --swap_frontrear
ehendrix23 Oct 9, 2019
f5df0f6
Fixes etc..
ehendrix23 Oct 14, 2019
781df22
Support spaces and comments in parameter file
ehendrix23 Oct 14, 2019
8222758
PEP cleanup
ehendrix23 Oct 15, 2019
e734a65
Add fps
ehendrix23 Oct 15, 2019
ae52ab2
Use --scale for all scaling
ehendrix23 Oct 16, 2019
2474467
Re-organized help, added optional debug logging
ehendrix23 Oct 17, 2019
83f25ec
Beta 0.1.16.1
ehendrix23 Oct 17, 2019
0cd391c
Fixes for grouping checks
ehendrix23 Oct 18, 2019
bce7ad8
Arial unicode for MacOS
ehendrix23 Oct 18, 2019
c6f9ef3
Improved message for missing font on Linux
ehendrix23 Oct 21, 2019
f9ba709
Only run if main
ehendrix23 Oct 22, 2019
8e9c8c6
Update README
ehendrix23 Oct 22, 2019
c9fec7a
Few more debug lines
ehendrix23 Oct 23, 2019
5e028d0
Fix H.265/HEVC encoding with Intel GPU (#98)
mbaileys Oct 24, 2019
6533597
Update README.rst
ehendrix23 Oct 24, 2019
3df89ea
Clean-up README
ehendrix23 Nov 15, 2019
1732eed
Release 0.1.16
ehendrix23 Nov 15, 2019
2f5ee67
Merge branch 'master' into dev
ehendrix23 Nov 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix defaults for rear, mirror, swap
Set defaults for mirror (when front is shown), rear (when front is not shown), and swap (swap when rear, not when mirror).
  • Loading branch information
ehendrix23 committed Oct 3, 2019
commit a9cf2406e2ab43ec33ae4ceb30913251d70d3a9a
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,10 @@ Release Notes
- Fixed: Missing python-dateutil package when installing from PIP `Issue #77 <https://github.com/ehendrix23/tesla_dashcam/issues/77>`_
- Fixed: Missing fonts in Docker Image (thanks to moorecp for providing fix)
- Fixed: Only the 1st source was processed When using MONITOR or MONITOR_ONCE, or with V10 only SavedClips was processed when not providing a source
0.1.16:
- Changed: View of rear camera will be mirrored as well if side cameras are shown as mirror
- Changed: For all layouts default is to show mirror for rear&side if front camera is shown, otherwise show as rear viewing.
- Changed: Default is to swap left&right cameras when showing rear&side as rear viewing, and not to swap them when showing rear&side as mirror view.

TODO
----
Expand Down
95 changes: 46 additions & 49 deletions tesla_dashcam/tesla_dashcam.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ def font_valign(self):
@font_valign.setter
def font_valign(self, alignment):
self._font_valign = VALIGN.get(alignment, self._font_valign)
print(self._font_valign)

@property
def front_width(self):
Expand Down Expand Up @@ -2441,37 +2440,37 @@ def main() -> None:
"--mirror",
dest="mirror",
action="store_true",
help="Video from side cameras as if being "
"viewed through the sidemirrors. Cannot "
default=argparse.SUPPRESS,
help="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.",
)
mirror_or_rear.add_argument(
"--rear",
dest="rear",
action="store_true",
help="Video from side cameras as if looking "
"backwards. Cannot be used in "
default=argparse.SUPPRESS,
help="Video from side and rear cameras as if looking "
"backwards. Default when providing parameter --no-front. Cannot be used in "
"combination with --mirror.",
)
parser.set_defaults(mirror=True)
parser.set_defaults(rear=False)

swap_cameras = parser.add_mutually_exclusive_group()
swap_cameras.add_argument(
"--swap",
dest="swap",
action="store_const",
const=1,
help="Swap left and right cameras, default when "
"layout FULLSCREEN with --rear option is "
"chosen.",
help="Swap left and right cameras in output, default when side and rear cameras are as if looking backwards. "
"See --rear parameter.",
)
swap_cameras.add_argument(
"--no-swap",
dest="swap",
action="store_const",
const=0,
help="Do not swap left and right cameras, " "default with all other options.",
help="Do not swap left and right cameras, default when side and rear cameras are as if looking through a "
"mirror. Also see --mirror parameter",
)

camera_group = parser.add_argument_group(
Expand Down Expand Up @@ -2850,18 +2849,6 @@ def main() -> None:
f"within PATH environment or provide full path using parameter --ffmpeg."
)

mirror_sides = ""
if args.rear:
side_camera_as_mirror = False
else:
side_camera_as_mirror = True

if side_camera_as_mirror:
mirror_sides = ", hflip"

black_base = "color=duration={duration}:"
black_size = "s={width}x{height}:c=black "

if args.layout == "PERSPECTIVE":
layout_settings = FullScreen()
layout_settings.perspective = True
Expand All @@ -2879,30 +2866,40 @@ def main() -> None:

layout_settings.perspective = args.perspective

if args.clip_scale is not None and args.clip_scale > 0:
layout_settings.scale = args.clip_scale

# Determine if left and right cameras should be swapped or not.
if args.swap is None:
# Default is set based on layout chosen.
if args.layout == "FULLSCREEN":
# FULLSCREEN is different, if doing mirror then default should
# not be swapping. If not doing mirror then default should be
# to swap making it seem more like a "rear" camera.
layout_settings.swap_left_right = not side_camera_as_mirror
else:
layout_settings.swap_left_right = args.swap

layout_settings.front = not args.no_front
layout_settings.left = not args.no_left
layout_settings.right = not args.no_right
layout_settings.rear = not args.no_rear

if args.halign is not None:
layout_settings.font_halign = args.halign
# Check if either rear or mirror argument has been provided.
# If front camera then default to mirror, if no front camera then default to rear.
side_camera_as_mirror = (
layout_settings.front
if not ("rear" in args or "mirror" in args)
else "mirror" in args
)
mirror_sides = ", hflip" if side_camera_as_mirror else ""

if args.valign is not None:
layout_settings.font_valign = args.valign
# Determine if left and right cameras should be swapped or not.
layout_settings.swap_left_right = (
not side_camera_as_mirror if args.swap is None else args.swap
)

layout_settings.scale = (
args.clip_scale
if args.clip_scale is not None and args.clip_scale > 0
else layout_settings.scale
)

layout_settings.font_halign = (
args.halign if args.halign is not None else layout_settings.font_halign
)
layout_settings.font_valign = (
args.valign if args.valign is not None else layout_settings.font_valign
)

black_base = "color=duration={duration}:"
black_size = "s={width}x{height}:c=black "

ffmpeg_base = (
black_base
Expand Down Expand Up @@ -2990,10 +2987,11 @@ def main() -> None:
if layout_settings.rear:
ffmpeg_rear_camera = (
"setpts=PTS-STARTPTS, "
"scale={clip_width}x{clip_height} {options}"
"scale={clip_width}x{clip_height} {mirror}{options}"
" [rear]".format(
clip_width=layout_settings.rear_width,
clip_height=layout_settings.rear_height,
mirror=mirror_sides,
options=layout_settings.rear_options,
)
)
Expand Down Expand Up @@ -3032,10 +3030,11 @@ def main() -> None:

# If fontsize is not provided then scale font size based on scaling
# of video clips, otherwise use fixed font size.
if args.fontsize is None or args.fontsize == 0:
fontsize = 16 * layout_settings.font_scale * layout_settings.scale
else:
fontsize = args.fontsize
fontsize = (
16 * layout_settings.font_scale * layout_settings.scale
if args.fontsize is None or args.fontsize == 0
else args.fontsize
)

ffmpeg_timestamp = (
ffmpeg_timestamp + "fontcolor={fontcolor}:fontsize={fontsize}:"
Expand Down Expand Up @@ -3084,9 +3083,7 @@ def main() -> None:

ffmpeg_params = ["-preset", args.compression, "-crf", MOVIE_QUALITY[args.quality]]

use_gpu = args.gpu
if sys.platform == "darwin":
use_gpu = not args.gpu
use_gpu = not args.gpu if sys.platform == "darwin" else args.gpu

video_encoding = []
if args.enc is None:
Expand Down