Dashcam video script

  • SUPPORT THE SITE AND ENJOY A PREMIUM EXPERIENCE!
    Welcome to Tesla Owners Online, four years young! For a low subscription fee, you will receive access to an ad-free version of TOO. We now offer yearly memberships! You can subscribe via this direct link:
    https://teslaownersonline.com/account/upgrades

    SUBSCRIBE TO OUR YOUTUBE CHANNEL!
    Did you know we have a YouTube channel that's all about Tesla? Lots of Tesla information, fun, vlogs, product reviews, and a weekly Tesla Owners Online Podcast as well!

  • It's OK to discuss software issues here but please report bugs to Tesla directly at servicehelpna@teslamotors.com if you want things fixed.

japhule

Active member
Joined
Apr 14, 2018
Messages
57
Location
Dallas, TX
Country
Country
New release available: Release v0.1.10

Following are the updates:

Fixed:
- Issue where sometimes encoding with GPU would fail by also allowing software based encoding
- Traceback when unable to retrieve latest release from GitHub
- Running tesla_dashcam when installed using pip. Issue #23 and Issue #31
- Folder clip would be removed if only 1 set in folder with same name as folder name if keep_intermediate not specified
- Font issue in Windows (hopefully final fix) Issue #29
- Python version has to be 3.7 or higher due to use of capture_output Issue #19

New:
- Added scale option to set the scale of the clips and thus resulting video. (--scale)
- Added option to specify a parameter file using @<filename> where parameters can be located in. (@<filename>)
- One can now specify multiple sources instead of just 1.
- Individual file(s) can now be provided as a source as well (only 1 camera filename has to be provided to get all 3)
- Source is now optional, if not provided then it will be same as --monitor_once with as source SavedClips.

Changed:
- Timestamp within video will now be used for concatenation of the clips at folder level and all (--merge option) instead of filename. This will ensure that even when crossing timezones the order of the video is still accurate.
- --delete_source will delete source files when specified even when --monitor or --monitor_once is not specified Issue #28
- Output will default to Videos\Tesla_Dashcam (Windows) Movies/Tesla_Dashcam (MacOS), or Videos\Tesla_Dashcam (Linux) if not output folder specified.
- Filename for the folder video files will not have start and end timestamp in local timezone instead of just folder name. Issue #30 and Issue #33
- Updated release notes for each release better identifying what is new, changed, and fixed.
The Windows application from your link appears to be v0.1.10b0 so I keep getting notifications that a newer release is available.
 

MelindaV

☰ > 3
Moderator
Joined
Apr 2, 2016
Messages
10,019
Location
Vancouver, WA
Tesla Owner
Model 3
Country
Country
@ehendrix23 - since the 5/30 release, I've been getting the alert that it is not running the latest update (after downloading and running the latest)
Code:
New release v0.1.10 is available for download (https://github.com/ehendrix23/tesla_dashcam/releases/tag/v0.1.10). You are currently on v0.1.10b0. Use --check-for-update to get latest release notes.
and a lengthly error with each video clip
Code:
    Processing 10 clips in folder /Volumes/TESLACAM/TeslaCam/SavedClips/2019-06-17_19-22-56 (15/27)
        Processing clip 1/10 from 06/17/19 19:12:54 and 59 seconds long.
            Error trying to create clip for /Volumes/TESLACAM/TeslaCam/SavedClips/2019-06-17_19-22-56/2019-06-17_19-13-55. RC: 1
            Command: ['/var/folders/cd/ss342dfs6h103gqy1tv5q9280000gp/T/_MEIBvklCR/ffmpeg', '-i', '/Volumes/TESLACAM/TeslaCam/SavedClips/2019-06-17_19-22-56/2019-06-17_19-13-55-left_repeater.mp4', '-i', '/Volumes/TESLACAM/TeslaCam/SavedClips/2019-06-17_19-22-56/2019-06-17_19-13-55-front.mp4', '-i', '/Volumes/TESLACAM/TeslaCam/SavedClips/2019-06-17_19-22-56/2019-06-17_19-13-55-right_repeater.mp4', '-filter_complex', "color=duration=59.8:s=1280x960:c=black [base];[0:v] setpts=PTS-STARTPTS, scale=640x480 , hflip [left];[1:v] setpts=PTS-STARTPTS, scale=640x480  [front];[2:v] setpts=PTS-STARTPTS, scale=640x480 , hflip [right];[base][left] overlay=eof_action=pass:repeatlast=0:x=0:y=480 [left1];[left1][front] overlay=eof_action=pass:repeatlast=0:x=320:y=0 [front1];[front1][right] overlay=eof_action=pass:repeatlast=0:x=640:y=480[tmp0];[tmp0] drawtext=fontfile=/Library/Fonts/Arial.ttf:fontcolor=white:fontsize=16.0:borderw=2:bordercolor=black@1.0:x=(w/2-text_w/2):y=(h-(text_h*2)):text='%{pts\\:localtime\\:1560823974\\:%x %X}'[tmp1];[tmp1]  setpts=0.2*PTS", '-preset', 'medium', '-crf', '28', '-allow_sw', '1', '-b:v', '5000K', '-c:v', 'h264_videotoolbox', '-y', '/volumes/2019-06-17_19-13-55.mp4']
            Error: b"ffmpeg version N-93225-g37e4c226c0-tessus  https://evermeet.cx/ffmpeg/  Copyright (c) 2000-2019 the FFmpeg developers\n  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)\n  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay\n  libavutil      56. 26.100 / 56. 26.100\n  libavcodec     58. 47.102 / 58. 47.102\n  libavformat    58. 26.101 / 58. 26.101\n  libavdevice    58.  6.101 / 58.  6.101\n  libavfilter     7. 48.100 /  7. 48.100\n  libswscale      5.  4.100 /  5.  4.100\n  libswresample   3.  4.100 /  3.  4.100\n  libpostproc    55.  4.100 / 55.  4.100\nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Volumes/TESLACAM/TeslaCam/SavedClips/2019-06-17_19-22-56/2019-06-17_19-13-55-left_repeater.mp4':\n  Metadata:\n    major_brand     : mp42\n    minor_version   : 0\n    compatible_brands: mp42mp41isomiso2\n    creation_time   : 2019-06-18T02:12:54.000000Z\n  Duration: 00:00:59.77, start: 0.000000, bitrate: 4025 kb/s\n    Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x960, 4022 kb/s, SAR 1:1 DAR 4:3, 36.02 fps, 36 tbr, 10k tbn, 20k tbc (default)\n    Metadata:\n      creation_time   : 2019-06-18T02:12:54.000000Z\n      handler_name    : VideoHandler\nInput #1, mov,mp4,m4a,3gp,3g2,mj2, from '/Volumes/TESLACAM/TeslaCam/SavedClips/2019-06-17_19-22-56/2019-06-17_19-13-55-front.mp4':\n  Metadata:\n    major_brand     : mp42\n    minor_version   : 0\n    compatible_brands: mp42mp41isomiso2\n    creation_time   : 2019-06-18T02:12:54.000000Z\n  Duration: 00:00:59.80, start: 0.000000, bitrate: 4043 kb/s\n    Stream #1:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x960, 4039 kb/s, SAR 1:1 DAR 4:3, 36.02 fps, 36 tbr, 10k tbn, 20k tbc (default)\n    Metadata:\n      creation_time   : 2019-06-18T02:12:54.000000Z\n      handler_name    : VideoHandler\nInput #2, mov,mp4,m4a,3gp,3g2,mj2, from '/Volumes/TESLACAM/TeslaCam/SavedClips/2019-06-17_19-22-56/2019-06-17_19-13-55-right_repeater.mp4':\n  Metadata:\n    major_brand     : mp42\n    minor_version   : 0\n    compatible_brands: mp42mp41isomiso2\n    creation_time   : 2019-06-18T02:12:54.000000Z\n  Duration: 00:00:59.77, start: 0.000000, bitrate: 4031 kb/s\n    Stream #2:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x960, 4027 kb/s, SAR 1:1 DAR 4:3, 36.02 fps, 36 tbr, 10k tbn, 20k tbc (default)\n    Metadata:\n      creation_time   : 2019-06-18T02:12:54.000000Z\n      handler_name    : VideoHandler\nCodec AVOption preset (Configuration preset) specified for output file #0 (/volumes/2019-06-17_19-13-55.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.\nCodec AVOption crf (Select the quality for constant quality mode) specified for output file #0 (/volumes/2019-06-17_19-13-55.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.\n/volumes/2019-06-17_19-13-55.mp4: Operation not permitted\n"
are you able to see what the issue is from this? because prior to this breaking, it has totally spoiled me in looking at the Sentry clips :)
 
Joined
Jan 24, 2019
Messages
1
Location
Lewes, DE
Tesla Owner
Model 3
Country
Country
I have been trying out your script and think it's FANTASTIC. So far my favorite "view" is --quality HIGH --layout WIDESCREEN --rear.

I have found that if I edit my commands in a textfile, then copy and paste them onto the CMD line, it's a whole lot easier to manage. I am not the first to figure THAT out I guess (!)

I have a request: Is it possible to set a parameter for a full-res (4k) version of the video? This would allow the three images to stay at their native resolution and will maintain all the detail. Each video is 1280 wide by 960 high - all three in a widescreen mode would be 3840 wide - exactly a 4k video width. I don't know how this will impact the rendering time... The video is bigger but the elements don't need to be resized. In my example the side screens still need to be flipped though.
 

ehendrix23

Active member
TOO Supporting Member
Joined
Jan 30, 2019
Messages
131
Location
Colorado
Tesla Owner
Model 3
Country
Country
I have been trying out your script and think it's FANTASTIC. So far my favorite "view" is --quality HIGH --layout WIDESCREEN --rear.

I have found that if I edit my commands in a textfile, then copy and paste them onto the CMD line, it's a whole lot easier to manage. I am not the first to figure THAT out I guess (!)

I have a request: Is it possible to set a parameter for a full-res (4k) version of the video? This would allow the three images to stay at their native resolution and will maintain all the detail. Each video is 1280 wide by 960 high - all three in a widescreen mode would be 3840 wide - exactly a 4k video width. I don't know how this will impact the rendering time... The video is bigger but the elements don't need to be resized. In my example the side screens still need to be flipped though.
See the --scale option which I if I understand your request should do exactly what you ask. :)
 

ehendrix23

Active member
TOO Supporting Member
Joined
Jan 30, 2019
Messages
131
Location
Colorado
Tesla Owner
Model 3
Country
Country
@ehendrix23 - since the 5/30 release, I've been getting the alert that it is not running the latest update (after downloading and running the latest)
Code:
New release v0.1.10 is available for download (https://github.com/ehendrix23/tesla_dashcam/releases/tag/v0.1.10). You are currently on v0.1.10b0. Use --check-for-update to get latest release notes.
and a lengthly error with each video clip
Code:
    Processing 10 clips in folder /Volumes/TESLACAM/TeslaCam/SavedClips/2019-06-17_19-22-56 (15/27)
        Processing clip 1/10 from 06/17/19 19:12:54 and 59 seconds long.
            Error trying to create clip for /Volumes/TESLACAM/TeslaCam/SavedClips/2019-06-17_19-22-56/2019-06-17_19-13-55. RC: 1
            Command: ['/var/folders/cd/ss342dfs6h103gqy1tv5q9280000gp/T/_MEIBvklCR/ffmpeg', '-i', '/Volumes/TESLACAM/TeslaCam/SavedClips/2019-06-17_19-22-56/2019-06-17_19-13-55-left_repeater.mp4', '-i', '/Volumes/TESLACAM/TeslaCam/SavedClips/2019-06-17_19-22-56/2019-06-17_19-13-55-front.mp4', '-i', '/Volumes/TESLACAM/TeslaCam/SavedClips/2019-06-17_19-22-56/2019-06-17_19-13-55-right_repeater.mp4', '-filter_complex', "color=duration=59.8:s=1280x960:c=black [base];[0:v] setpts=PTS-STARTPTS, scale=640x480 , hflip [left];[1:v] setpts=PTS-STARTPTS, scale=640x480  [front];[2:v] setpts=PTS-STARTPTS, scale=640x480 , hflip [right];[base][left] overlay=eof_action=pass:repeatlast=0:x=0:y=480 [left1];[left1][front] overlay=eof_action=pass:repeatlast=0:x=320:y=0 [front1];[front1][right] overlay=eof_action=pass:repeatlast=0:x=640:y=480[tmp0];[tmp0] drawtext=fontfile=/Library/Fonts/Arial.ttf:fontcolor=white:fontsize=16.0:borderw=2:bordercolor=black@1.0:x=(w/2-text_w/2):y=(h-(text_h*2)):text='%{pts\\:localtime\\:1560823974\\:%x %X}'[tmp1];[tmp1]  setpts=0.2*PTS", '-preset', 'medium', '-crf', '28', '-allow_sw', '1', '-b:v', '5000K', '-c:v', 'h264_videotoolbox', '-y', '/volumes/2019-06-17_19-13-55.mp4']
            Error: b"ffmpeg version N-93225-g37e4c226c0-tessus  https://evermeet.cx/ffmpeg/  Copyright (c) 2000-2019 the FFmpeg developers\n  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)\n  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay\n  libavutil      56. 26.100 / 56. 26.100\n  libavcodec     58. 47.102 / 58. 47.102\n  libavformat    58. 26.101 / 58. 26.101\n  libavdevice    58.  6.101 / 58.  6.101\n  libavfilter     7. 48.100 /  7. 48.100\n  libswscale      5.  4.100 /  5.  4.100\n  libswresample   3.  4.100 /  3.  4.100\n  libpostproc    55.  4.100 / 55.  4.100\nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Volumes/TESLACAM/TeslaCam/SavedClips/2019-06-17_19-22-56/2019-06-17_19-13-55-left_repeater.mp4':\n  Metadata:\n    major_brand     : mp42\n    minor_version   : 0\n    compatible_brands: mp42mp41isomiso2\n    creation_time   : 2019-06-18T02:12:54.000000Z\n  Duration: 00:00:59.77, start: 0.000000, bitrate: 4025 kb/s\n    Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x960, 4022 kb/s, SAR 1:1 DAR 4:3, 36.02 fps, 36 tbr, 10k tbn, 20k tbc (default)\n    Metadata:\n      creation_time   : 2019-06-18T02:12:54.000000Z\n      handler_name    : VideoHandler\nInput #1, mov,mp4,m4a,3gp,3g2,mj2, from '/Volumes/TESLACAM/TeslaCam/SavedClips/2019-06-17_19-22-56/2019-06-17_19-13-55-front.mp4':\n  Metadata:\n    major_brand     : mp42\n    minor_version   : 0\n    compatible_brands: mp42mp41isomiso2\n    creation_time   : 2019-06-18T02:12:54.000000Z\n  Duration: 00:00:59.80, start: 0.000000, bitrate: 4043 kb/s\n    Stream #1:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x960, 4039 kb/s, SAR 1:1 DAR 4:3, 36.02 fps, 36 tbr, 10k tbn, 20k tbc (default)\n    Metadata:\n      creation_time   : 2019-06-18T02:12:54.000000Z\n      handler_name    : VideoHandler\nInput #2, mov,mp4,m4a,3gp,3g2,mj2, from '/Volumes/TESLACAM/TeslaCam/SavedClips/2019-06-17_19-22-56/2019-06-17_19-13-55-right_repeater.mp4':\n  Metadata:\n    major_brand     : mp42\n    minor_version   : 0\n    compatible_brands: mp42mp41isomiso2\n    creation_time   : 2019-06-18T02:12:54.000000Z\n  Duration: 00:00:59.77, start: 0.000000, bitrate: 4031 kb/s\n    Stream #2:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x960, 4027 kb/s, SAR 1:1 DAR 4:3, 36.02 fps, 36 tbr, 10k tbn, 20k tbc (default)\n    Metadata:\n      creation_time   : 2019-06-18T02:12:54.000000Z\n      handler_name    : VideoHandler\nCodec AVOption preset (Configuration preset) specified for output file #0 (/volumes/2019-06-17_19-13-55.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.\nCodec AVOption crf (Select the quality for constant quality mode) specified for output file #0 (/volumes/2019-06-17_19-13-55.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.\n/volumes/2019-06-17_19-13-55.mp4: Operation not permitted\n"
are you able to see what the issue is from this? because prior to this breaking, it has totally spoiled me in looking at the Sentry clips :)
Can you provide me the complete command you use? From what I can see it is trying to put the resulting video clip in folder /volumes. Do you indeed have a folder /volumes? I might be wrong but right now my 1st impression is that you might have provided the wrong --output value?
Check that and if not provide me the parameters you use so that hopefully I can replicate the issue. :)
 

MelindaV

☰ > 3
Moderator
Joined
Apr 2, 2016
Messages
10,019
Location
Vancouver, WA
Tesla Owner
Model 3
Country
Country
Can you provide me the complete command you use? From what I can see it is trying to put the resulting video clip in folder /volumes. Do you indeed have a folder /volumes? I might be wrong but right now my 1st impression is that you might have provided the wrong --output value?
Check that and if not provide me the parameters you use so that hopefully I can replicate the issue. :)
I have a couple different ones, but this is the one I use most, and yes, have an 'etc' volume.
/Applications/tesla_dashcam --monitor_once --speedup 2 --output /volumes/etc SavedClips

I was using this before the problem started showing up though too
 

ehendrix23

Active member
TOO Supporting Member
Joined
Jan 30, 2019
Messages
131
Location
Colorado
Tesla Owner
Model 3
Country
Country
I have a couple different ones, but this is the one I use most, and yes, have an 'etc' volume.
/Applications/tesla_dashcam --monitor_once --speedup 2 --output /volumes/etc SavedClips

I was using this before the problem started showing up though too
K, I believe I found the issue.

Will be releasing 0.1.11 shortly (should be this weekend) just with a few fixes in it as 0.1.10 was not as clean as I had hoped. Had tried to push it before going on vacation as it contained some other fixes for people but resulting clearly having done it a bit too fast.
 

James M

Active member
Joined
May 31, 2018
Messages
29
Location
Seattle
Country
Country
Love the merge feature, thank you! Dumb question: Is there a way to add a datetime stamp to the output filename (either the earliest/latest from the merged video, or simply the current datetime). Right now it appears the merged video filename will be named the same as the folder it is saved in unless the name is explicitly defined in the command.
 

ehendrix23

Active member
TOO Supporting Member
Joined
Jan 30, 2019
Messages
131
Location
Colorado
Tesla Owner
Model 3
Country
Country
New release available: Release v0.1.11

Following are the updates:

Fixed:
  • Traceback when getting ffmpeg path in Linux Issue #39
  • Running tesla_dashcam when installed using pip. Issue #38
  • Just providing a filename for output would result in traceback.
  • When providing a folder as output it would be possible that the last folder name was stripped potentially resulting in error

Apologies for duration. Been busy with vacation, summer, business trips, enjoying sunshine and putting some miles on the car. :)
 

dburkland

Active member
Joined
Nov 11, 2018
Messages
182
Location
Minneapolis
Tesla Owner
Model 3
Country
Country
New release available: Release v0.1.11

Following are the updates:

Fixed:
  • Traceback when getting ffmpeg path in Linux Issue #39
  • Running tesla_dashcam when installed using pip. Issue #38
  • Just providing a filename for output would result in traceback.
  • When providing a folder as output it would be possible that the last folder name was stripped potentially resulting in error

Apologies for duration. Been busy with vacation, summer, business trips, enjoying sunshine and putting some miles on the car. :)
Excellent, thanks for fixing the pip on MacOS bug (aka #38)
 

ehendrix23

Active member
TOO Supporting Member
Joined
Jan 30, 2019
Messages
131
Location
Colorado
Tesla Owner
Model 3
Country
Country
New release available: Release v0.1.12

Following are the updates:

Fixed:
  • Folders will now be deleted if there are 0-byte or corrupt video files within the folder Issue #40
  • Providing a filename for --output would create a folder instead and not setting resulting file to filename provided Issue #52
  • Thread exception in Windows that ToastNotifier does not have an attribute classAtom (potential fix). Issue #54
  • Traceback when invalid output path (none-existing) is provided or when unable to create target folder in given path.
  • Including sub dirs did not work correctly, it would only grab the 1st folder.
  • When using monitor, if . was provided as source then nothing would be processed. Now it will process everything as intended.
  • File created when providing a filename with --output and --monitor option did not put timestamp in filename to ensure unique filenames
  • Argument to get release notes was provided incorrectly when checking for updates. Thank you to demonbane for fixing.
New:
  • Added chapter markers in the concatenated movies. Folder ones will have a chapter marker for each intermediate clip, merged one has a chapter marker for each folder.
  • Option --chapter_offset for use with --merge to offset the chapter marker in relation to the folder clip
  • Added flags -movstart and +faststart for video files better suited with browsers etc. (i.e. YouTube). Thanks to sf302 for suggestion.
  • Option to add trigger (--monitor_trigger_file) to use existence of a file/folder/link for starting processing instead of USB/SD being inserted.
Changed:
  • Method for concatenating the clips together has been changed resulting in massive performance improvement (less then 1 second to do concatenation). Big thanks to sf302!
 

MelindaV

☰ > 3
Moderator
Joined
Apr 2, 2016
Messages
10,019
Location
Vancouver, WA
Tesla Owner
Model 3
Country
Country
New release available: Release v0.1.12

Following are the updates:

Fixed:
  • Folders will now be deleted if there are 0-byte or corrupt video files within the folder Issue #40
  • Providing a filename for --output would create a folder instead and not setting resulting file to filename provided Issue #52
  • Thread exception in Windows that ToastNotifier does not have an attribute classAtom (potential fix). Issue #54
  • Traceback when invalid output path (none-existing) is provided or when unable to create target folder in given path.
  • Including sub dirs did not work correctly, it would only grab the 1st folder.
  • When using monitor, if . was provided as source then nothing would be processed. Now it will process everything as intended.
  • File created when providing a filename with --output and --monitor option did not put timestamp in filename to ensure unique filenames
  • Argument to get release notes was provided incorrectly when checking for updates. Thank you to demonbane for fixing.
New:
  • Added chapter markers in the concatenated movies. Folder ones will have a chapter marker for each intermediate clip, merged one has a chapter marker for each folder.
  • Option --chapter_offset for use with --merge to offset the chapter marker in relation to the folder clip
  • Added flags -movstart and +faststart for video files better suited with browsers etc. (i.e. YouTube). Thanks to sf302 for suggestion.
  • Option to add trigger (--monitor_trigger_file) to use existence of a file/folder/link for starting processing instead of USB/SD being inserted.
Changed:
  • Method for concatenating the clips together has been changed resulting in massive performance improvement (less then 1 second to do concatenation). Big thanks to sf302!
so the --merge will work now? I've never been able to get it as a recognized command.
 

ehendrix23

Active member
TOO Supporting Member
Joined
Jan 30, 2019
Messages
131
Location
Colorado
Tesla Owner
Model 3
Country
Country
so the --merge will work now? I've never been able to get it as a recognized command.
Yes. Make sure you get the latest version (0.1.12). You can use --version to check. If it does not work then let me know and provide command you use together with output/result.
I've used it here multiple times combining the videos from multiple folders (and testing chapter markers).
 

japhule

Active member
Joined
Apr 14, 2018
Messages
57
Location
Dallas, TX
Country
Country
Working great so far. A few notes...

How about an option for a focused chapter mark that jumps straight to the trigger event? Trigger events for me all happen at the either the 60 second mark from the end of the video (ie, for a 10m32s video, I find the trigger event at 9m32s) or within the last few seconds of the video (when I approach and open/unlock the car). Would be great if the only chapter mark is right before the trigger event (at -63s from end and/or -10s from end) so we can just jump right to it.

Also noticing that when merging videos, the merged video is named after the output folder in this version. Could we get these merged files a distinct name? Maybe named after the first and last files?

With merging files, I can at least set the chapter marks at -63s to help me jump to the trigger events, but this does require me to merge all the videos to do so.
 

MelindaV

☰ > 3
Moderator
Joined
Apr 2, 2016
Messages
10,019
Location
Vancouver, WA
Tesla Owner
Model 3
Country
Country
@ehendrix23 - not sure if this is cause by a change in how the car records videos or something in the OSX 10.15 Catalina beta...
Code:
ValueError: time data '._2019-09-05_17-33-54' does not match format '%Y-%m-%d_%H-%M-%S'
[26520] Failed to execute script tesla_dashcam
and FYI, the file folder and file naming all look to match the expected naming:

screen-shot-2019-09-05-at-7-40-38-pm-png.28947


and the 2019-09-05_17-33-54 was the 29th of 29 folders from today's 'RecentClips' folder. Removing that folder from the RecentClips folder, and rerunning gives a similar error with another clip set listed.

and running it for the RecentClips does this (error from the first of the 60 clips):
Code:
TeslaCam folder found on /Volumes/TESLACAM.
Retrieving all files from /Volumes/TESLACAM/TeslaCam/RecentClips
Discovered 1 folders containing total of 180 files, retrieving clip data.
There are 1 folders with 60 clips to process.
    Processing 60 clips in folder /Volumes/TESLACAM/TeslaCam/RecentClips (1/1)
        Processing clip 1/60 from 09/05/19 17:53:21 and 59 seconds long.
            Error trying to create clip for /Volumes/TESLACAM/TeslaCam/RecentClips/2019-09-05_17-53-21. RC: 1
            Command: ['/var/folders/fv/hd81md156y1bxjpk8ntm06hr0000gn/T/_MEIbZUvMp/ffmpeg', '-i', '/Volumes/TESLACAM/TeslaCam/RecentClips/2019-09-05_17-53-21-left_repeater.mp4', '-i', '/Volumes/TESLACAM/TeslaCam/RecentClips/2019-09-05_17-53-21-front.mp4', '-i', '/Volumes/TESLACAM/TeslaCam/RecentClips/2019-09-05_17-53-21-right_repeater.mp4', '-filter_complex', "color=duration=59.29:s=1280x960:c=black [base];[0:v] setpts=PTS-STARTPTS, scale=640x480 , hflip [left];[1:v] setpts=PTS-STARTPTS, scale=640x480  [front];[2:v] setpts=PTS-STARTPTS, scale=640x480 , hflip [right];[base][left] overlay=eof_action=pass:repeatlast=0:x=0:y=480 [left1];[left1][front] overlay=eof_action=pass:repeatlast=0:x=320:y=0 [front1];[front1][right] overlay=eof_action=pass:repeatlast=0:x=640:y=480[tmp0];[tmp0] drawtext=fontfile=/Library/Fonts/Arial.ttf:fontcolor=white:fontsize=16.0:borderw=2:bordercolor=black@1.0:x=(w/2-text_w/2):y=(h-(text_h*2)):text='%{pts\\:localtime\\:1567731201\\:%x %X}'[tmp1];[tmp1]  setpts=0.5*PTS", '-preset', 'medium', '-crf', '28', '-allow_sw', '1', '-b:v', '5000K', '-c:v', 'h264_videotoolbox', '-y', '/volumes/etc/2019-09-05_17-53-21.mp4']
            Error: b"ffmpeg version N-93225-g37e4c226c0-tessus  https://evermeet.cx/ffmpeg/  Copyright (c) 2000-2019 the FFmpeg developers\n  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)\n  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay\n  libavutil      56. 26.100 / 56. 26.100\n  libavcodec     58. 47.102 / 58. 47.102\n  libavformat    58. 26.101 / 58. 26.101\n  libavdevice    58.  6.101 / 58.  6.101\n  libavfilter     7. 48.100 /  7. 48.100\n  libswscale      5.  4.100 /  5.  4.100\n  libswresample   3.  4.100 /  3.  4.100\n  libpostproc    55.  4.100 / 55.  4.100\nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Volumes/TESLACAM/TeslaCam/RecentClips/2019-09-05_17-53-21-left_repeater.mp4':\n  Metadata:\n    major_brand     : mp42\n    minor_version   : 0\n    compatible_brands: mp42mp41isomiso2\n    creation_time   : 2019-09-06T00:53:21.000000Z\n  Duration: 00:00:59.29, start: 0.000000, bitrate: 4016 kb/s\n    Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x960, 4010 kb/s, SAR 1:1 DAR 4:3, 36.02 fps, 36 tbr, 10k tbn, 20k tbc (default)\n    Metadata:\n      creation_time   : 2019-09-06T00:53:21.000000Z\n      handler_name    : VideoHandler\nInput #1, mov,mp4,m4a,3gp,3g2,mj2, from '/Volumes/TESLACAM/TeslaCam/RecentClips/2019-09-05_17-53-21-front.mp4':\n  Metadata:\n    major_brand     : mp42\n    minor_version   : 0\n    compatible_brands: mp42mp41isomiso2\n    creation_time   : 2019-09-06T00:53:21.000000Z\n  Duration: 00:00:59.25, start: 0.000000, bitrate: 4016 kb/s\n    Stream #1:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x960, 4011 kb/s, SAR 1:1 DAR 4:3, 36.02 fps, 36 tbr, 10k tbn, 20k tbc (default)\n    Metadata:\n      creation_time   : 2019-09-06T00:53:21.000000Z\n      handler_name    : VideoHandler\nInput #2, mov,mp4,m4a,3gp,3g2,mj2, from '/Volumes/TESLACAM/TeslaCam/RecentClips/2019-09-05_17-53-21-right_repeater.mp4':\n  Metadata:\n    major_brand     : mp42\n    minor_version   : 0\n    compatible_brands: mp42mp41isomiso2\n    creation_time   : 2019-09-06T00:53:21.000000Z\n  Duration: 00:00:59.00, start: 0.000000, bitrate: 4015 kb/s\n    Stream #2:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x960, 4010 kb/s, SAR 1:1 DAR 4:3, 36.02 fps, 36 tbr, 10k tbn, 20k tbc (default)\n    Metadata:\n      creation_time   : 2019-09-06T00:53:21.000000Z\n      handler_name    : VideoHandler\nFontconfig error: Cannot load default config file\n[Parsed_drawtext_12 @ 0x7fafc0e03480] Cannot find a valid font for the family Sans\n[AVFilterGraph @ 0x7fafc0e01600] Error initializing filter 'drawtext' with args 'fontfile=/Library/Fonts/Arial.ttf:fontcolor=white:fontsize=16.0:borderw=2:bordercolor=black@1.0:x=(w/2-text_w/2):y=(h-(text_h*2)):text=%{pts\\:localtime\\:1567731201\\:%x %X}'\nError initializing complex filters.\nNo such file or directory\n"
 

ehendrix23

Active member
TOO Supporting Member
Joined
Jan 30, 2019
Messages
131
Location
Colorado
Tesla Owner
Model 3
Country
Country
Anyway you can provide me 1 of those video files so I can have a look at it? It looks like the metadata in them does not include the creation time and normally it should. This then results in it trying to get the timestamp from the filename and that is failing then. Not sure why the fallback is failing as the filename indeed looks normal. Can you provide me the complete command you use as well? I just did a test here local and even if creation time is not in the video metadata then the fallback to using the filename is working fine here.

For the 2nd issue, can you check if file /Library/Fonts/Arial.ttf exist? If not, check path /system/library/fonts/Supplemental/. Someone else had similar issue not too long ago and now I'm wondering if in Catalina they changed the location of this font file.
 
Last edited:

MelindaV

☰ > 3
Moderator
Joined
Apr 2, 2016
Messages
10,019
Location
Vancouver, WA
Tesla Owner
Model 3
Country
Country
Anyway you can provide me 1 of those video files so I can have a look at it? It looks like the metadata in them does not include the creation time and normally it should. This then results in it trying to get the timestamp from the filename and that is failing then. Not sure why the fallback is failing as the filename indeed looks normal. Can you provide me the complete command you use as well? I just did a test here local and even if creation time is not in the video metadata then the fallback to using the filename is working fine here.

For the 2nd issue, can you check if file /Library/Fonts/Arial.ttf exist? If not, check path /system/library/fonts/Supplemental/. Someone else had similar issue not too long ago and now I'm wondering if in Catalina they changed the location of this font file.
will PM you a link to one of the videos to download...
I do have arial (and all its various versions) in the Supplemental directory, but not the main.
 

ehendrix23

Active member
TOO Supporting Member
Joined
Jan 30, 2019
Messages
131
Location
Colorado
Tesla Owner
Model 3
Country
Country
I do have arial (and all its various versions) in the Supplemental directory, but not the main.
That is then the issue with the font and must be a change in Catalina. If you copy Arial.ttf to /Library/Fonts/Arial.ttf then that will fix it. Or you can provide the parameter --font with the full path to the Arial font file in that Supplemental directory.
I'll put this in the next version to try the Supplemental folder if not exist in the original one. :)
 

ehendrix23

Active member
TOO Supporting Member
Joined
Jan 30, 2019
Messages
131
Location
Colorado
Tesla Owner
Model 3
Country
Country
I believe V10 will add the rear view camera. Have you started looking into getting that added to the script?
Been thinking about it once Elon stated he would see to get it included but that's it. Need to figure out best position to put it for the different layouts.

Open to suggestions. :)