All examples
Video and vision

Fetch a remote camera snapshot

Fetch a finite HTTP(S) image with bounded waits and an optional opaque authorization reference.

video_remote.aner
// Check without contacting a server. Replace the fictional endpoint privately.
// A finite HTTP snapshot uses no redirects; authenticated snapshots require HTTPS.
import aner.video

let source = video.snapshot_url("https://camera.example.invalid/snapshot.jpg",
    timeout_ms: 3000)
let frame = video.frame_slot()
let status = source.read_into(frame, timeout_ms: 4000)
if status == "ready" {
    print(frame.width())
    print(frame.height())
} else {
    print(status)
    print(source.error())
}
source.close()

// For continuous media, configure an explicit RTSP or HTTP(S) media URL:
// let live = video.stream("rtsp://camera.example.invalid/live")
// For an authenticated single image, add an opaque stored SecretRef:
// import aner.secrets
// let image = video.snapshot_url("https://camera.example.invalid/snapshot.jpg",
//     authorization: secrets.stored("camera-authorization"))

Make it your experiment.

Use Aner 0.1.0 or newer. Save this program as examples/video_remote.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.

Terminal
aner check examples/video_remote.aner
aner run examples/video_remote.aner

The aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.

Requires Aner 0.1.0 or newer. Synthetic capture and CPU vision examples need no external source; cameras, remote media and encoded recording require optional FFmpeg support and explicit inputs. Checking opens no camera, network connection or recording.

Credential setup
aner check examples/video_remote.aner

Bundled datasets retain their own source attribution and license notices. Example outcomes are not comparative benchmarks or evidence of clinical validity.

Dataset sources & attribution
Install Aner