A GoPro is a surprisingly good vision camera. It's small, it's rugged, it shoots sharp wide-angle video, it runs on battery or USB power, and it can stream over Wi-Fi with no cable back to a computer. That makes it handy anywhere running a camera cable is a pain: a pilot on a production line, a loading dock, a job site, or a quick test before you buy fixed cameras.
In this guide, I'll stream a GoPro straight to Roboflow and run an RF-DETR model on the live video to find people. Everything happens in the GoPro Quik app on your phone and in Roboflow. You don't need a computer next to the camera, a capture card, or any custom software.
Which GoPros work?
Any GoPro that can live-stream to an RTMP address works. According to GoPro's live streaming guide (opens in a new tab), that's the HERO7 Black and newer, except the MAX2, Lit HERO, and HERO (2024).
Camera
Live streaming
Lenses for the stream
HERO13 Black (used in this guide)
Yes
SuperView, Wide, Linear
HERO12 Black
Yes
SuperView, Wide, Linear
HERO11 Black and HERO11 Black Mini
Yes
SuperView, Wide, Linear
HERO10 Black, HERO9 Black, HERO8 Black, HERO7 Black
Yes
Wide only
MAX2, Lit HERO, HERO (2024)
No
Not applicable
Older than the HERO7 Black
No
Not applicable
A newer camera is the better pick for vision. The Linear lens keeps straight lines straight, which most models like, and it's only on the HERO11 and newer.
For the rest of this guide, I'll use a HERO13 Black on GoPro's standard firmware (02.14.00). On older cameras, the Quik menus can look a little different, but the steps are the same.
What you'll need
A GoPro from the list above. I'm using a HERO13 Black.
The GoPro Quik app on an iPhone or Android phone. I used an Android phone.
A Wi-Fi network the camera can join, with internet access. Networks with a sign-in page don't work.
RTMP is the protocol most streaming apps and encoders use to push live video to a server. Roboflow can be that server, so the first step is to make a place for the GoPro to send its video.
In Roboflow, open Streams under Cloud and click Add Video Source. Choose the RTMP Stream tab, give the source a name, and click Create Stream Source.
Roboflow gives you a server URL and a stream key. Here's the one thing that tripped me up: select RTMP, not RTMPS, above the server URL. GoPro says Quik supports both, but with my HERO13 Black, the RTMPS address failed and the RTMP address worked right away. Then click Copy Full URL. The GoPro has a single address field, so you want the server URL and the stream key together in one address.
The full URL includes your stream key, and anyone who has it can send video to this source. RTMP also sends it without encryption, so stream over a network you trust. If the key ever leaks, open Connection Settings on the source and click Rotate Key.
Get the URL onto your phone in a way that keeps it private. The easiest way is to open Roboflow on the phone, find the source, and copy it there.
Step 2: Pair your GoPro with Quik
Quik talks to the camera over Bluetooth to set it up. If your GoPro is already paired, skip ahead.
Otherwise, open Quik, tap the add camera icon at the top of the GoPro tab, and choose your camera. On the camera, swipe down, then left, and tap Pair Device. Back in Quik, tap Connect. When pairing finishes, the camera shows up on the GoPro tab with its battery and SD card status.
If Quik offers a camera firmware update, take it before you go on.
Step 3: Set up the live stream in Quik
On the camera's card, tap the ⋮ menu, then Live Stream. Quik asks where you want to stream. Choose Other/RTMP.
Then fill in the Stream to Other/RTMP form:
Connect to a Network: pick the Wi-Fi network for the camera and enter its password. The camera, not your phone, streams over this network. Mine streamed fine on 5 GHz.
Enter your RTMP URL: paste the full URL from Roboflow. It should start with rtmp://.
Resolution: 1080p for the most detail, or 720p on a slower network.
Lens: I'd pick Linear. It keeps straight lines straight, which helps most models.
Save a Copy to my SD Card: turn it on if you also want a recording on the camera.
Tap Continue. The camera joins the network and gets the stream ready.
Step 4: Go live
On the next screen, tap Go Live. Don't worry if it says "Preview Not Available". Quik switches to a timer, a red Live badge, and a Stream Health meter that shows the bitrate.
In Roboflow, the source turns Live within about 20 seconds.
To stop, tap the square button in Quik, then Done. Quik remembers your network, URL, and settings. Next time it's ⋮, Live Stream, Other/RTMP, Continue, and Go Live. If Quik asks to connect to the saved network, tap OK.
Step 5: Run a Workflow on the video
Now for the fun part. Once the video is in Roboflow, the GoPro is like any other camera, and you can run any Workflow (opens in a new tab) on it.
For this demo I built a small Workflow that finds people. It has three blocks: an Object Detection Model block using rfdetr-small (RF-DETR Small, pretrained on the 80 COCO classes) with its class filter set to person, then Bounding Box Visualization and Label Visualization to draw the results on the video.
On the source page, open the Workflow picker, choose Run a Model or Workflow, select your Workflow, and click Start Processing. The panel shows the processing rate before you start.
Results appear in a few seconds. In my test, the first result came back in about 17 seconds, and the Workflow kept up with the stream at over 20 frames per second. Every frame also comes with JSON you can use: each person's box, confidence, and class.
From here, the Workflow can do anything a Workflow can do: count people in a zone, send an alert, or save events to review later. If you stop and restart the stream in Quik, the Workflow usually picks the video back up on its own. If it doesn't, restart it from the source page.
Troubleshooting
Problem
What to check
"Can't Connect: We couldn't connect your camera to this network"
Check whether the URL starts with rtmps://. That caused this error in my test. Select RTMP in Roboflow, copy the full URL again, and paste it into Quik.
"Live Stream" or "Other/RTMP" doesn't appear in Quik
Update Quik and the camera firmware. Some older cameras can't stream to RTMP.
The camera can't join Wi-Fi
The password, and that the network has no sign-in page.
Quik says it's live, but Roboflow shows no video
That you pasted the full URL, not just the server URL, and that the key wasn't rotated after you copied it.
The stream stops after a while
Battery, heat, and Wi-Fi signal. Use a USB-C power adapter for long sessions, and give the camera some airflow.
Bonus: Stream every time the camera gets power
The Quik setup has one limitation: someone has to tap Go Live each time the camera turns on. For a camera mounted up on a wall, you'd rather it start streaming by itself whenever it gets power.
GoPro has a way to do that. GoPro Labs (opens in a new tab) is experimental firmware from GoPro that adds extra features you control by scanning QR codes, and one of them is a boot script that runs every time the camera starts.
GoPro's Labs page lists live streaming for the HERO8 Black through the HERO13 Black. Here's how it worked on my HERO13 Black with Labs firmware 02.10.70. Labs releases can lag behind GoPro's standard firmware.
Prepare the camera with Quik. Live streaming won't work on a new or factory-reset camera until it's been set up with Quik. Pair it as in Step 2. On a HERO12 or HERO13, GoPro's Labs page also says to turn on Auto Upload once, and you can turn it off again right away.
Install Labs. Download the firmware for your camera from GoPro Labs: Install (opens in a new tab), copy its UPDATE folder to the root of the SD card, and turn the camera on. It installs and restarts.
Store your Wi-Fi and stream URL. On GoPro Labs: Live Streaming (opens in a new tab), enter your network, its password, and your Roboflow RTMP URL (RTMP, not RTMPS), and check "Using HERO12 or 13" if that's your camera. Point the camera at each QR code. The camera keeps both in memory.
Runs the saved script named bt each time the camera starts
!SAVEbt=!5N!GL
Saves that script: wait 5 seconds, then stream at 1080p. Use !GM for 720p or !GS for 480p.
Unplug the camera from any computer, turn it off, and connect it to a USB power adapter, with the battery and SD card still in. In my tests it woke up and was streaming to Roboflow 20 to 45 seconds after power connected. To restart a stream, cycle the power.
Two things to know before you rely on it:
Your Wi-Fi password ends up on the SD card. Labs logs the text of every QR code it scans to MISC/qrlog.txt, in plain text, including your Wi-Fi password and stream key. Delete that file after setup, and rotate the stream key in Roboflow if the card leaves your hands.
Undo it before you leave Labs. The wake and boot settings stayed in the camera's memory for me even after a factory reset and a firmware change. Scan a code with *WAKE=0*BOOT=0 while Labs is still installed, then install GoPro's standard firmware again.
Get started
A GoPro and a phone are enough to get live video into Roboflow in a few minutes, and from there you can run any model or Workflow on it. It's a quick way to test vision on a real scene before you install fixed cameras.
原文来源:roboflow.com