Analyze images and video files
Choose image analysis for a single JPEG or PNG. Choose a file-backed stream for a video file available to a processing node. Each path requires its corresponding licensed capabilities.
Analyze an image
Section titled “Analyze an image”- Prepare an
imageobject withmediaTypeset toimage/jpegorimage/pngand the image bytes encoded asdataBase64. - Add the requested
naturalLanguageQueries, reference image, or face-recognition options using the schema for Create image analysis. - Submit the JSON request. Store the returned analysis resource ID.
- Read Get image analysis to inspect its state and results.
For example, create an image request locally with Python. Keep example.jpg within the operation’s supported size limits.
python3 - <<'JSON' > image-analysis.jsonimport base64, jsonfrom pathlib import Pathprint(json.dumps({"image": { "mediaType": "image/jpeg", "dataBase64": base64.b64encode(Path("example.jpg").read_bytes()).decode("ascii")}}))JSONcurl --fail-with-body --silent --show-error \ --header "Authorization: Bearer ${EOI_SERVICE_TOKEN}" \ --header "Content-Type: application/json" \ --data-binary @image-analysis.json \ "${EOI_API_BASE_URL}/image-analyses"Process a video file
Section titled “Process a video file”- Use the video-file operations to list available source nodes and files.
- Probe the selected relative file path. Keep the returned fingerprint together with the node ID and relative path.
- Create a stream with the matching
fileSourceobject. Re-probe if the server reports that the file changed. - Configure the scene and send a stream start command.
- Inspect the stream’s runtime state and file progress fields. A completed file reports its completion state and source progress.
Use rerun only when you intend to process the file again. Follow Connect and manage cameras for stream command handling and teardown.
