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.

ehendrix23

Active member
TOO Supporting Member
Joined
Jan 30, 2019
Messages
131
Location
Colorado
Tesla Owner
Model 3
Country
Country
Should someone who has no idea what you all are talking about be able to somehow open something that would show the videos that you describe?

All I can get is a .dmg that contains 'tesla_dashcam' (exec), ffmpeg (exec), filmpeg_LICENSE.txt, LICENSE.txt and README.html.

The first two just open Terminal. Should I be able to run something from this?

Sorry to be so dense. thanks.
Based on contents of DMG file looks like you have a bit older version. So get the latest version here: https://github.com/ehendrix23/tesla_dashcam/releases/download/v0.1.9/tesla_dashcam.dmg

Open the README.html file in a browser as it has a bunch of examples.

On a Mac:
1. Drag&Drop tesla_dashcam to /Applications folder
2. Open Terminal (Type in Terminal in Spotlight to open it).
3. Absolute easiest to run it right now, type in following command (or just copy&paste) in Terminal: /Applications/tesla_dashcam --monitor_once --output ~/Movies SavedClips
4. Insert USB fob (or SD card).

This will take the default layout etc. (see README for other layouts). What this will do is that it will sit there waiting for a disk to be inserted (your USB fob or SD card) that has the TeslaCam folder. Once it detects it, processing will start automatically. It will create a video file for each folder within the SavedClips on your TeslaCam drive, the resulting video will be stored in your Movies folder on your Mac with the name same as the original folder (hence timestamp). Once it has completed processing all the program will quit.

If you are comfortable, you can have it delete the files and folder from your USB drive as well once it has processed them. Use the following command in Terminal for that:
/Applications/tesla_dashcam --monitor_once --delete_source --output ~/Movies SavedClips

You can also make it so that after processing it will just sit there waiting till you eject it and then insert it again later (like after your next drive). That way after entering the command you can just minimize that Terminal window and not have to enter the command each time (at least until you reboot or so). Following is what to type then instead:
/Applications/tesla_dashcam --monitor --delete_source --output ~/Movies SavedClips

The README file has a number of other examples. Putting together a GUI is in plan as well (together with a number of other features).

Feel free to ask for help as you did. :)
 

japhule

Active member
Joined
Apr 14, 2018
Messages
57
Location
Dallas, TX
Country
Country
This has been working great for me. I usually move several savedclips folders into a path and then execute this over that path. In situations when there's only one savedclips folder in the path that gets scanned, it will name the video file after the root folder instead of the actual folder name where the video files were from. Can you update this to name it the proper folder name?
 

ehendrix23

Active member
TOO Supporting Member
Joined
Jan 30, 2019
Messages
131
Location
Colorado
Tesla Owner
Model 3
Country
Country
This has been working great for me. I usually move several savedclips folders into a path and then execute this over that path. In situations when there's only one savedclips folder in the path that gets scanned, it will name the video file after the root folder instead of the actual folder name where the video files were from. Can you update this to name it the proper folder name?
Making sure I have it right. You run it over multiple folders, and each created movie is based on the name of the folder. But if there happens to be only 1 folder then the name is based on the root folder and not the folder name. Got this right?

If so, yeah. Makes sense as now the behavior is a bit weird depending if there is 1 or multiple folders. :).
Will get that changed in next release.


Sent from my iPhone using Tapatalk
 

ATechGuy

Active member
Joined
Sep 17, 2018
Messages
52
Location
Cape Elizabeth, ME
Tesla Owner
Model 3
Country
Country
Thank you. :)

Bunch of features and options in it are based on feedback being provided, so keep it coming. :). Just today someone asked for option to be able to provide multiple individual files instead of a folder. Got it in there for next release (with also option for multiple folders). Earlier someone asked for option to scale (as currently I scale the clips down but they wanted full resolution), next release has it. Someone asked for ability to have it only grab certain cameras (i.e. only left and front), next release will have it. :)

I did a quick check and it looks to be possible to add chapter markers. Here is a question though. At what points should the chapter markers be?
If processing a single folder then it could be for each "minute". But what when processing multiple folders (i.e. everything under SavedClips)? Still every minute? Or a chapter marker for each folder then?

Would appreciate your input in this.
I was on ly asking for a marker at the beginning of each clip. So, if, say a folder had a full hour of clips (I think they're ten minutes each, right?) then you would have five markers (if you don't include the marker for the first one) I put my thumb drive back into the car last night, so I don't have a folder to look in, but just think marker at the begnning of each "set" of clips. No need to do minute math, I'd say. Just drop a marker at the beginning of each clip group. Thanks. Can't wait to try some of the other new features!
 

ATechGuy

Active member
Joined
Sep 17, 2018
Messages
52
Location
Cape Elizabeth, ME
Tesla Owner
Model 3
Country
Country
Should someone who has no idea what you all are talking about be able to somehow open something that would show the videos that you describe?

All I can get is a .dmg that contains 'tesla_dashcam' (exec), ffmpeg (exec), filmpeg_LICENSE.txt, LICENSE.txt and README.html.

The first two just open Terminal. Should I be able to run something from this?

Sorry to be so dense. thanks.
I usually skip the part of copying the clips from my thumb drive to my hard drive. I have plenty of space on my thumbdrive, so I generate the merge video there.

If you can't recall any syntax, here's what I suggest. Of course, you'll first need to drag the program (tesla_dashcam) to the applications folder.

1) Use Finder to open the Applications folder and then double-click the tesla_dashcam program. It will open a terminal window and spit out all the syntax and STAY OPEN, so you can use this as a reference. No need to keep checking back here.

2) From Spotlight, look for "Terminal" and open it. It usually starts in your HOME folder, but that really makes no difference.

3) look back at Finder, you should see your thumbdrive mounted. It will have a NAME. Mine (and in unix, case counts!) happens to be called TESLACAM (all upper). So, to access the thumbdrive, it's located at \Volumes\TESLACAM . If you want a list of all mounted volumes, type the command ' mount ' and it will list them. You'll see yours there. This is when you may realize putting a space into a volume name is a P.I.T.A. If you have one, you might want to rename the volume! Unix also is pretty friendly with completing a command line. We'll see how that works next.

4) Assuming you now know how to start the program, and know where to find your drive, it's a snap to start the program with its defaults. Again, with using my thumb drive as my source (and the program puts the resulting clip into the source directory) I start typing:

\Applications\tesla_dashcam \Volumes\TESLACAM\TeslaCam\SavedClips\2019-05-04_ And then I start hitting TAB. You can do this anywhere along the way, and the command line parser will try to complete the command until it hits a point where it's ambiguous. So for example, I will type \Vol and then hit TAB and it will complete it to read \Volumes\ And then I type TE and TAB again. and it fills it out for the drive. I happen to have two partitions on my thumbdrive, one for the cam, the other for my music. You'll then find two folders, RecentClips and SavedClips, so you'll want to drop into one of those folders. For my initial testing, I wanted ALL of RecentClips. that's an hour (I earlier said ten minutes per clip, but I think it's one minute per clip) so there were 61 clips in there. So, if you want to start like I did, just start typing \Appl and hit TAB, then add tesla_dashcam and then \Vol and TAB and just drill down to the name of the folder you want. What's next? Press Enter! And watch it do the magic. It's wonderfully verbose (not too much, just right) and depending on the speed of your Mac, it will chug right through the clips one by one and combine each set of three into one clip. And then in the end, each of those combined clips get merged into one.

5) If you can't figure out the name of the combined clip, just look in finder for the most recent file in the folder where you asked the clips to be combined. There you will find a new file with the name of the folder. that's your video. (It will also be the largest!)
 
Last edited:

afgoody

New Member
Joined
May 11, 2019
Messages
2
Location
Lancaster, CA
Tesla Owner
Model 3
Country
Country
On a PC, I downloaded the .zip and extracted it. When I double-clicked the .exe a window opened, appeared to run a short script, then the window closed. Upon further reading, it appears there is not a GUI yet, so I tried to run from a cmd prompt in the folder where the .exe is located using "tesla_dashcam.exe -h" and "tesla_dashcam -h", but both return "...not recognized as an internal or external command, operable program or batch file. What am I missing to get started here? Thank you.
 

rsf

Member
Joined
Jul 22, 2018
Messages
10
Location
oregon
Tesla Owner
Model 3
Country
Country
From your command prompt just use 'tesla_dashcam.exe' by itself and it will show you the options.
Here is an example command to process videos : tesla_dashcam c:\putvidshere --output c:\putvidshere --no-timestamp --quality HIGH --layout WIDESCREEN --mirror
 

MelindaV

☰ > 3
Moderator
Joined
Apr 2, 2016
Messages
10,019
Location
Vancouver, WA
Tesla Owner
Model 3
Country
Country
@ehendrix23 - I've been getting something odd a few times (on a mac via terminal, saving clips to the thumb drive 'volumes/TESLACAM/TeslaCam')

often after running the command, 0kb files will begin populating, followed by the popup saying processing has been completed. First I thought it was doing this when a folder does not have front cam clips (something mine has been doing recently). But today, the files within the saved folder had all three cameras, and all were (mostly) the full 1min length without too much distortion in the repeater cameras.

I'll delete the new 0kb files the script created, and run the command again and it proceeds to work correctly.
 

ehendrix23

Active member
TOO Supporting Member
Joined
Jan 30, 2019
Messages
131
Location
Colorado
Tesla Owner
Model 3
Country
Country
@ehendrix23 - I've been getting something odd a few times (on a mac via terminal, saving clips to the thumb drive 'volumes/TESLACAM/TeslaCam')

often after running the command, 0kb files will begin populating, followed by the popup saying processing has been completed. First I thought it was doing this when a folder does not have front cam clips (something mine has been doing recently). But today, the files within the saved folder had all three cameras, and all were (mostly) the full 1min length without too much distortion in the repeater cameras.

I'll delete the new 0kb files the script created, and run the command again and it proceeds to work correctly.
Can you try saving to your local disk instead? Wondering if the thumb drive is having issues when both reading and writing from same drive.

Also, try without GPU acceleration using the --no-gpu parameter maybe it has something to do with that.
 

ATechGuy

Active member
Joined
Sep 17, 2018
Messages
52
Location
Cape Elizabeth, ME
Tesla Owner
Model 3
Country
Country
I thought I saw the same behavior using the Android app. But I think the folder with the clip I was view was really marginal in quality. I wonder why. It seemed the right video was always showing a lot of noise or it wouldn't show anything at all. I don't see that very often when using the laptop to view the clips, so I can't help, but I know I've seen the same when the clip for a certain camera didn't exist, it seemed the app was generating a stub for the camera, and the stub file was 0Kb in size (empty).
 

James M

Active member
Joined
May 31, 2018
Messages
29
Location
Seattle
Country
Country
Dumb question, I know the script will combine Left/Front/Right videos, but would it also be possible to concatenate videos where the timestamps are sequential when compared to the length of the videos (ie video A is timestamped "12:00:00" and is ten minutes long and video B is timestamped "12:10:00" -- it would be nice to have this combined into a single video).
 

ehendrix23

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

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.
 

ehendrix23

Active member
TOO Supporting Member
Joined
Jan 30, 2019
Messages
131
Location
Colorado
Tesla Owner
Model 3
Country
Country
Dumb question, I know the script will combine Left/Front/Right videos, but would it also be possible to concatenate videos where the timestamps are sequential when compared to the length of the videos (ie video A is timestamped "12:00:00" and is ten minutes long and video B is timestamped "12:10:00" -- it would be nice to have this combined into a single video).
Yes, option --merge does exactly that.

Following is what it does:
1. Merge the 3 camera clips into 1 video clip with a layout based on --LAYOUT parameter
2. Merge all the video clips from a folder created in step 1 into 1 video clip. This is then your 10 minute video
3. If using --merge option, then all the video clips from step 2 will be further concatenated into 1 large video clip. I believe this is what you're thus looking for.
 

SR22pilot

Top-Contributor
Joined
Aug 15, 2018
Messages
540
Location
Alpharetta, GA
Tesla Owner
Model 3
Country
Country
I have a minor request. Please change the name of the README file to Tesla_Dashcam - README. That way I can copy it to Applications and it will reside next to the executable and not get confused with any other README. On a grander scleras, I would love it if the executable had a UI so options could be easily selected rather than using command lines. Yeah, I'm being lazy.
 

ehendrix23

Active member
TOO Supporting Member
Joined
Jan 30, 2019
Messages
131
Location
Colorado
Tesla Owner
Model 3
Country
Country
I have a minor request. Please change the name of the README file to Tesla_Dashcam - README. That way I can copy it to Applications and it will reside next to the executable and not get confused with any other README. On a grander scleras, I would love it if the executable had a UI so options could be easily selected rather than using command lines. Yeah, I'm being lazy.
README filename changed for 0.1.10. :)

Yes, agree on UI. :) With 0.1.10 you will be able to put your parameters in a text file and then use the text file with @<filename> as a parameter. Should make it somewhat easier with not having to provide the same parameters over and over. :)
 

SR22pilot

Top-Contributor
Joined
Aug 15, 2018
Messages
540
Location
Alpharetta, GA
Tesla Owner
Model 3
Country
Country
README filename changed for 0.1.10. :)

Yes, agree on UI. :) With 0.1.10 you will be able to put your parameters in a text file and then use the text file with @<filename> as a parameter. Should make it somewhat easier with not having to provide the same parameters over and over. :)
Thank you. I guess the text file is at least a small step towards a UI.
 

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.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.
 

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.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.
is there a trick to updating to the newest version (OSX)? I downloaded the latest .dmg and had it replace the earlier app, but was not able to use the newer commands, specifically --merge, returned an error that it was not recognized.