Dashcam video script

  • Our merch store is back! Check out our line of quality apparel and accessories featuring the TOO logo. Let us know if you'd like something specific you don't see 👍https://teespring.com/stores/tesla-owners-online-store
  • 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
112
Location
Colorado
Tesla Owner
Model 3
Country
Country
#1
All,

Just wanted to share that I created a Python script that combines the footage from the Tesla dash cam cameras and puts it into 1 video.

Perspective video (all 3 cameras next to each other):


Widescreen video (all 3 cameras next to each other):


Fullscreen video (front top center, left and right under front):


Further information is available in the description.

New releases (including binary for Windows and MacOS) can be found here: https://github.com/ehendrix23/tesla_dashcam/releases
Readme: https://github.com/ehendrix23/tesla_dashcam/blob/master/README.rst

Python Package can be found: https://pypi.org/project/tesla-dashcam/
Source: https://github.com/ehendrix23/tesla_dashcam

Enjoy.
 
Last edited:

JWardell

Legendary Member
Joined
May 9, 2016
Messages
3,458
Location
Boston
Tesla Owner
Model 3
Country
Country
#3
Awesome! Joining clips can be done easily in a video editor but combining the multiple cameras would be a lot more work.
Would love to see this compiled into a drag and drop app of some sort.
 

ehendrix23

Active Member
TOO Supporting Member
Joined
Jan 30, 2019
Messages
112
Location
Colorado
Tesla Owner
Model 3
Country
Country
#5
Awesome! Joining clips can be done easily in a video editor but combining the multiple cameras would be a lot more work.
Would love to see this compiled into a drag and drop app of some sort.
Relying on ffmpeg to do all the video work. Script is just taking all the files and creating the ffmpeg options. Can see to make it somewhat drag&drop in the future. :)
 

TheHairyOne

Well-Known Member
Joined
Nov 28, 2018
Messages
215
Location
Riverside CA
Tesla Owner
Model 3
Country
Country
#9
Read the description which stated 3 angles are stored via dash cam. But when I look in my folder Inonly see forward angle, does this change in a newer fw that I don’t yet have?
 

Artdept

Active Member
TOO Supporting Member
Joined
Nov 5, 2017
Messages
96
Location
California
Tesla Owner
No
Country
Country
#11
This is aweso
All,

Just wanted to share that I created a Python script that combines the footage from the Tesla dash cam cameras and puts it into 1 video.

Widescreen video (all 3 cameras next to each other):


Fullscreen video (front top center, left and right under front):


Further information is available in the description.

Package can be found: https://pypi.org/project/tesla-dashcam/
Source: https://github.com/ehendrix23/tesla_dashcam

Enjoy.
This is awesome! Maybe to awesome for most of us here on this forum to comprehend. I commend your efforts.

Do you program Robots by chance?
 

ehendrix23

Active Member
TOO Supporting Member
Joined
Jan 30, 2019
Messages
112
Location
Colorado
Tesla Owner
Model 3
Country
Country
#12
This is aweso


This is awesome! Maybe to awesome for most of us here on this forum to comprehend. I commend your efforts.

Do you program Robots by chance?
No, IT architect by trade ... developing some stuff as a hobby. :)
 
Joined
Dec 2, 2018
Messages
17
Location
Austin, TX
Tesla Owner
Model 3
Country
Country
#13
Just wanted to share that I created a Python script that combines the footage from the Tesla dash cam cameras and puts it into 1 video.
This is great! Thanks, @ehendrix23.

Joining clips can be done easily in a video editor but combining the multiple cameras would be a lot more work.
@JWardell While not as streamlined as the Python script, I find it's much easier to sync and display this type of multi-stream video in something like Camtasia or Screenflow. Different workflows than, say, Final Cut Pro, iMovie, etc.
 

lairdb

Active Member
Joined
May 24, 2018
Messages
184
Location
Earth
Country
Country
#14
I've been working on the same thing using Powershell (and ffmpeg) and am at about the 90% 70% (revised progress mark after seeing all of @ehendrix23's nice options.)

Unfortunately, I'm still on 2018.50 so I don't really have good video with which to test.
 
Joined
Jun 8, 2018
Messages
8
Location
Santa Ana, CA
Tesla Owner
Model 3
Country
Country
#16
I'm gonna put together a Windows App tonight. I'll get Drag and Drop in there
QUICK UPDATE: This has actually been don'e since last monday. I'm just waiting to get through the Microsoft certification process so it can be in the app store.

Sorry @ehendrix23 for hijacking your thread. I'll move to my own once the app is live!
 
Joined
Dec 7, 2016
Messages
5
Location
Oakville
#17
Cool, @ehendrix23, I was just going to create a script to combine the footage when I bumped into your script. :)
I did some experiment with ffmpeg myself and had come up with the following to combine the 2 side cameras:
Code:
 ffmpeg -i 2019-03-12_18-57-right_repeater.mp4 -vf "[in] pad=2*iw:ih [left]; movie=2019-03-12_18-57-left_repeater.mp4 [right]; [left][right] overlay=main_w/2:0 [out]" -b:v 3000k Combined.mp4
BTW, I noticed that if you put the rigth camera on the left side and the left camera on the right side, you have a complete view of the sides and the back.

Thanks
 
Last edited:

lairdb

Active Member
Joined
May 24, 2018
Messages
184
Location
Earth
Country
Country
#20
Try this (Windows command line, though the ffmpeg syntax should work crossplatform):

Code:
set stem=2019-03-11_08-28

ffmpeg.exe -y -i %stem%-left_repeater.mp4 -i %stem%-front.mp4 -i %stem%-right_repeater.mp4  -filter_complex "color=size=980x250:color=Gray@1.0 [base];[0:v] setpts=PTS-STARTPTS, scale=320x240, hflip [LLL];[1:v] setpts=PTS-STARTPTS, scale=320x240 [CCC];[2:v] setpts=PTS-STARTPTS, scale=320x240, hflip [RRR]; [base][LLL] overlay=shortest=1::x=5:y=5 [tmp1]; [tmp1][CCC] overlay=shortest=1:x=330:y=5 [tmp2]; [tmp2][RRR] overlay=shortest=1:x=655:y=5" -c:v libx264 -map_metadata 1 %stem%-combined.mp4
ffplay %stem%-combined.mp4 -autoexit

(Note that this does not presently copy the timestamp metadata into the combined file.) Fixed; copies metadata from the -front file.
 
Last edited: