rufogongora / teslacamviewer

teslacamviewer is a docker utility to view your tesla clips more easily!
5 stars 1 forks source link

[FEATURE REQUEST] Merging sentry cam footage into four individual streams #3

Open edwardrossi opened 3 years ago

edwardrossi commented 3 years ago

Hi @rufogongora ,

Firstly, thanks for creating this. I've been seeking a better way of viewing and organising my sentry footage since setting up my Teslausb. I'm successfully running it in docker on my NAS.

I've played around with Tesla Dashcam a bit, and while it's a nice tool, it's incredibly resource-intensive and you lose the interactivity of switching between cameras.

Merging each video channel into a single stream would be a fantastic addition to this tool and much less resource-intensive.

I think the ideal situation (for me at least) would be to run an instance of teslacamviewer on my pi4 teslausb which would merge the video streams of the sentry events as they happen so I could view them locally from my pi and upload these merged streams to my NAS via teslausb, where I would have another instance of teslacamviewer running to access from my local home network.

MrPaulAR commented 3 years ago

I don't think the actual merging of videos will be very hard with zero quality loss and no cpu usage. Just IO from the copy itself. I don't know if/how this will break the website portion.

ffmpeg -f concat -safe 0 -i <(for f in ./*-front.mp4; do echo "file '$PWD/$f'"; done) -c copy front.mp4
ffmpeg -f concat -safe 0 -i <(for f in ./*-left_repeater.mp4; do echo "file '$PWD/$f'"; done) -c copy left_repeater.mp4
ffmpeg -f concat -safe 0 -i <(for f in ./*-right_repeater.mp4; do echo "file '$PWD/$f'"; done) -c copy right_repeater.mp4
ffmpeg -f concat -safe 0 -i <(for f in ./*-back.mp4; do echo "file '$PWD/$f'"; done) -c copy back.mp4

I do think this will break the landing page a little if this is used since it counts the number of videos. Best case is that video count would be replaced with a video duration.

rufogongora commented 3 years ago

I had a branch where I was actually trying to do this in memory, and also try to do some conversion because of the issue of not being able to see it in chrome due to the encoding but I haven't had the time to go back, feel free to open up a pull request meanwhile, but I think I will have to take a look this still maybe next week