Fix Rivian Drive Cam Distortion

Corrected Rivian Drive Cam Frame

Rivians have a drive cam feature that will continually record footage from four cameras (front, rear, left and right) while you're driving. It's a built in dash cam which immediately got me excited to make hyperlapse style movies of interesting drives.

My first attempt was very, very sad. Rivian dumps out the footage in some fisheye format that looks terrible. It also often skips frames, so when imported to DaVinci Resolve the dread Media Offline error pops up all the time during playback. Insta360 Studio handles the dropped frames and so I created the hyperlapse there and tried to zoom in enough to fix the fisheye but overall I was very disappointed. Hopefully Rivian fixes the footage or provides some sort of tool to make this feature usable at some point.

Today I wrestled with the problem a bit more deeply and got something working. The image at the top of this post is a drive cam frame that is dramatically improved. The trick is using the lenscorrection filter in ffmpeg. The filter requires k1 and k2 coefficients which I solved for by generating hundreds of videos and eyeballing them, like the horrifying experience of visiting an optician and suspecting that they're going to write your prescription based on your opinion of which letter looks better. After much juggling I settled on -0.45 and 0.11. In terms of command line this translates to:

This re-encoding also has the happy side effect of fixing the dropped frames.

I would love to have some official numbers to plug in (hint, hint Rivian). My Rivian is a 2025 Gen 2 R1S - I have no idea how much the camera module varies between different Rivian variants so this might work for you or might need more fine tuning. Having cracked this I'm currently processing some footage of a trip to Shasta Lake and will post that soon (update - it's here).

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: Fix Rivian Drive Cam Distortion #code #rivian #ffmpeg Using ffmpeg and the lenscorrection filter to fix the fisheye distortion on Rivian Drive Cam footage. )

Add Comment

All comments are moderated. Your email address is used to display a Gravatar and optionally for notification of new comments and to sign up for the newsletter.