2 minutes
Garmin Virb Ultra 30 WiFi API
I recently found myself wanting a GoPro-ish camera that I could power for extended periods of time using a cable and download images to my desktop over WiFi programmatically, without needing to pull a MicroSD card out or fire up a mobile app and drag MP4 files off via my phone one at a time. After looking at options on B&H’s website, I decided that the Garmin Virb Ultra 30, even though it’s getting kinda old, was probably the best choice for my needs.
Garmin publishes a
doc
with a reasonable-looking HTTP API, including curl
examples for half
of the commands, but the doc mostly covers their previous camera
models. It doesn’t actually say that the Ultra 30 supports more than
a couple of the commands on the list. I figured the doc was probably
just incomplete, and was willing to risk needing to return the camera
and give it a shot.
For the record, it seems to work fine:
$ curl --data '{"command":"mediaList"}' http://10.1.0.172/virb
{"media":[{"type":"photo","url":"http://10.1.0.172/DCIM/100_VIRB/VIRB0001.JPG","thumbUrl":"http://10.1.0.172/thumb/DCIM/100_VIRB/VIRB0001.BMP","fav":"false","name":"VIRB0001.JPG","fileSize":4371237,"date":1555644712,"lensMode":"unknownLensMode"},
{"type":"video","subtype":"video","url":"http://10.1.0.172/DCIM/100_VIRB/VIRB0002.MP4","thumbUrl":"http://10.1.0.172/DCIM/100_VIRB/VIRB0002.THM","fav":"true","lowResVideoPath":"http://10.1.0.172/DCIM/100_VIRB/VIRB0002.GLV","fitURL":"http://10.1.0.172/GMetrix/2019-04-18-20-06-05.fit","name":"VIRB0002.MP4","fileSize":91297976,"date":1555644728,"duration":12.000000}],"result":1}
$ curl -o virbtest.mp4 http://10.1.0.172/DCIM/100_VIRB/VIRB0002.MP4
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 87.0M 100 87.0M 0 0 2248k 0 0:00:39 0:00:39 --:--:-- 1268k
$
The same API probably works with the Virb 360 as well. I bought one of those last year for recording VR bike videos, but it’s a pain to get files off of the camera after every ride. I should be able to write a simple sync tool that will look for either camera and then download video and metadata onto my desktop, deleting it off of the SD card once it’s done downloading. Then I can just leave the 360 on the charger next to my bike when I’m not riding and the videos will be sitting on my desktop ready for processing an hour or two after I get home.
Next stop: getting the Ultra 30 to stream video over RTSP so I can use it to watch my CNC if I need to step out for a couple minutes during long operations.
Update: My Virb actually shows an HTTP index page on
http://10.1.0.172/DCIM/100_VIRB/
, so for now I can just use
something like wget --mirror
to fetch everything from the card.
Dead simple.