• Stars
    star
    107
  • Rank 321,746 (Top 7 %)
  • Language
    Python
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python script to help recover lost video from TeslaCam USB drives

teslacam-recovery

Currently Teslas only leave the last hour of recent footage on their thumbdrives. However, footage from farther back is easily accessible using basic data recovery techniques.

This repo contains a short script that will scan your entire FAT32 or exFAT USB drive for MP4s that have been deleted and copies them to a directory for viewing.

Warning: This is not meant to be a fool-proof guide. This is oriented towards the technically minded with some familiarity with Python and filesystems.

Basics

I've only used this on macOS. Linux instructions should be pretty identical. Windows should be pretty close.

  • Plug in your USB drive and unmount it.
  • Figure out the device node for your FAT32 or exFAT partition. On macOS, you can find this in Disk Utility when you click the "Info" button for your volume. It should be something like "disk2s1".
  • Create a directory for the output.
  • Run the script, providing the directory path and device node like so: sudo ./run.py /dev/disk2s1 myoutputdirectory

This will take a while. The script is not made for space or time efficiency. You'll need a lot of spare disk space (possibly up to twice as much as your drive's capacity).

Your directory should fill up with video files pretty quickly once the script is running.

Advanced

If you're impatient or low on spare disk space and feeling adventurous, the script includes code for navigating the filesystem, printing out detailed info, and exporting individual files. If you know basic Python, you can probably do a faster, more targeted search for the files you want. My car seems to do a good job at storing files contiguously and in order, so if you can find the cluster for an in-tact file near the time-frame of interest, you can probably get by with scanning a subset of clusters instead of the entire disk. See the comments in run.py.

Broken MP4s

If your output contains MP4s that don't play, the most likely cause is that the MP4 was fragmented across multiple cluster runs. This will happen if the car needs to write around a previously saved video. The script won't automatically extract those, but with some effort, you can do it yourself. The filename of the MP4 indicates the start cluster of the file. To extract the video, you should try reading all of the clusters starting with that one, skipping over clusters used by active filesystem entries. (This would be pretty easily scriptable; PRs are welcome.)

More Repositories

1

wasm-go-playground

Go compiler running entirely in your browser
JavaScript
249
star
2

needy

A C++ library dependency helper.
Python
53
star
3

api-fu

A collection of Go packages for creating robust GraphQL APIs
Go
52
star
4

neural-net

An educational neural net library in Rust
Rust
40
star
5

poe-go

A library and guide for creating PoE applications in Go
Go
28
star
6

gggtracker

Grinding Gear activity tracker for Path of Exile.
Go
24
star
7

go-immutable

A collection of fast, general-purpose immutable data structures for Go.
Go
18
star
8

xiv-sim

Simulator for Final Fantasy 14.
C++
11
star
9

razer-chroma-rs

Razer Chroma SDK for Rust
Rust
10
star
10

factorystatsd

This is a Factorio mod for next level reliability engineering. Build dashboards for your factory in Datadog or get woken up by PagerDuty when incidents occur!
Lua
10
star
11

serverless-bot

Demo for Mattermost dev talk on serverless bot building.
Python
5
star
12

poe-tree-json-generator

Generates the JSON for the POE skill tree using game files.
Python
5
star
13

mdx-viewer

Some code for viewing MDX models from Blizzard's MPQ files. Likely very out-of-date.
C++
5
star
14

aarch64-std

implementations of standard library components for bare-metal aarch64
Rust
4
star
15

codex

A light-weight programmer's text editor.
Objective-C
3
star
16

xiv-lua

Lua add-on platform for Final Fantasy 14.
C++
2
star
17

compiler

Hand-written compiler for a c++-like language.
C++
2
star
18

axi-lite-sv

SystemVerilog
2
star
19

lessdb

Rust
2
star
20

dotfiles

.dotfiles
Shell
1
star
21

imagenerics

An imaginary library for an imaginary Go feature
1
star
22

axi-lite-vhdl

axi4-lite implementation in vhdl
Verilog
1
star
23

gba-emu

An emulator for the Game Boy Advance.
C++
1
star
24

xiv-sim-web

Web front-end for xiv-sim.
JavaScript
1
star
25

gostd

Rewriting Go packages in C++ from scratch (-nostdlib)
C++
1
star
26

mfado

Like sudo, but for AWS+MFA.
Python
1
star